Skip to content

Commit

Permalink
mris_convert.cpp #NF Added ability to remove (invalidate) volume geom…
Browse files Browse the repository at this point in the history
…etry
  • Loading branch information
Douglas Greve committed Sep 7, 2021
1 parent 8a2bcff commit dd58ae8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions mris_convert/mris_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ static int combinesurfs_flag = 0;
static int userealras_flag = 0;
static int usesurfras_flag = 0;
static MRI *VolGeomMRI=NULL;
static int RemoveVolGeom = 0;
static int cras_add = 0;
static int cras_subtract = 0;
static int ToScanner = 0;
Expand Down Expand Up @@ -631,8 +632,11 @@ main(int argc, char *argv[])
}
else
{
if(MRISfileNameType(out_fname) == MRIS_VOLUME_FILE)
{
if(RemoveVolGeom){
printf("Removing Vol Geom\n");
mris->vg.valid = 0;
}
if(MRISfileNameType(out_fname) == MRIS_VOLUME_FILE) {
printf("Saving surface xyz %s as a volume format\n",out_fname);
MRI *vol = MRIallocSequence(mris->nvertices, 1, 1, MRI_FLOAT, 3);
MRIScopyMRI(mris,vol,0,"x");
Expand All @@ -645,8 +649,8 @@ main(int argc, char *argv[])
{
// default output:
printf("Saving %s as a surface\n",out_fname);
if(VolGeomMRI)
{
if(VolGeomMRI) {
printf("Adding Vol Geom\n");
getVolGeom(VolGeomMRI,&mris->vg);
}
MRISwrite(mris, out_fname) ;
Expand Down Expand Up @@ -819,6 +823,10 @@ get_option(int argc, char *argv[])
}
nargs = 1 ;
}
else if (!stricmp(option, "-remove-vol-geom"))
{
RemoveVolGeom = 1;
}
else switch (toupper(*option))
{
case 'A':
Expand Down Expand Up @@ -934,6 +942,7 @@ print_help(void)
printf( " --userealras : set the useRealRAS flag in the surface file to 1 \n") ;
printf( " --usesurfras : set the useRealRAS flag in the surface file to 0 \n") ;
printf( " --vol-geom MRIVol : use MRIVol to set the volume geometry\n") ;
printf( " --remove-vol-geom : sets the valid flag in vg to 0\n") ;
printf( " --to-surf surfcoords : copy coordinates from surfcoords to output (good for patches)\n") ;
printf( " --to-scanner : convert coordinates from native FS (tkr) coords to scanner coords\n") ;
printf( " --to-tkr : convert coordinates from scanner coords to native FS (tkr) coords \n") ;
Expand Down

0 comments on commit dd58ae8

Please sign in to comment.