Skip to content

Commit

Permalink
mris_flatten.cpp #NF. Copy now take a -copy-coords option to flatten …
Browse files Browse the repository at this point in the history
…a surface that is diff than the surface the patch was made from
  • Loading branch information
Douglas Greve committed Apr 16, 2021
1 parent b1d3b65 commit 1183358
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mris_flatten/mris_flatten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static void print_usage(void) ;
static void print_help(void) ;
static void print_version(void) ;
int MRISscaleUp(MRI_SURFACE *mris) ;
MRIS *SurfCopyCoords = NULL;

const char *Progname ;

Expand Down Expand Up @@ -430,6 +431,7 @@ main(int argc, char *argv[])
MRISsetNeighborhoodSizeAndDist(mris, nbrs) ;
#endif
}
if(SurfCopyCoords) MRIScopyCoords(mris,SurfCopyCoords);

if (Gdiag_no >= 0)
printf("vno %d is %sin patch\n", Gdiag_no,
Expand Down Expand Up @@ -750,6 +752,13 @@ get_option(int argc, char *argv[])
nargs = 1 ;
fprintf(stderr, "dilating cuts %d times\n", dilate) ;
}
else if (!stricmp(option, "copy-coords"))
{
SurfCopyCoords = MRISread(argv[2]);
if(SurfCopyCoords == NULL) exit(1);
nargs = 1 ;
fprintf(stderr, "copying coords from %s\n", argv[2]);
}
else if (!stricmp(option, "dist"))
{
sscanf(argv[2], "%f", &parms.l_dist) ;
Expand Down Expand Up @@ -1022,6 +1031,9 @@ print_help(void)
fprintf(stderr,
" -dilate <# of dilations>\n\t"
"specify the number of times to dilate the ripped edges to ensure a clean cut\n") ;
printf(" -copy-coords surf : copy xyz coords from surface before flattening\n");
printf(" This allows creating cuts on, eg, white surface, but flattening the inflated\n");
printf(" eg, mris_flatten -copy-coords lh.inflated -dilate 1 lh.white.cut lh.inflated.cut.flatten\n");
exit(1) ;
}

Expand Down

0 comments on commit 1183358

Please sign in to comment.