Skip to content

Commit

Permalink
mri_segstats.cpp. #NF. Added stand-alone --xfm2etiv
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Greve committed Jun 22, 2021
1 parent f30ed80 commit 8bc750c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mri_segstats/mri_segstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,20 @@ static int parse_commandline(int argc, char **argv)
{
InVolRegHeader = 1;
}
else if(!strcmp(option, "--xfm2etiv"))
{
if(nargc < 2) argnerr(option,1);
double etiv_scale_factor = 1948.106, determinant = 0, atlas_icv;
atlas_icv = MRIestimateTIV(pargv[0],etiv_scale_factor,&determinant);
printf("%12.4lf\n",atlas_icv);
if(strcmp(pargv[1],"nofile")!=0){
FILE *fp = fopen(pargv[1],"w");
if(fp == NULL) exit(1);
fprintf(fp,"%12.4lf\n",atlas_icv);
fclose(fp);
}
exit(0);
}
else if ( !strcmp(option, "--in-intensity-name") )
{
if (nargc < 1)
Expand Down
2 changes: 2 additions & 0 deletions mri_segstats/mri_segstats.help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ white surface. This is more accurate than from the aseg. The aseg values for the
<explanation>compute intracranial volume from subject/mri/transforms/talairach_with_skull.lta and exit</explanation>
<argument>--talxfm fname</argument>
<explanation>specify path to talairach.xfm file for etiv</explanation>
<argument>--xfm2etiv xfm outfile</argument>
<explanation>Stand-alone option to convert xfm to eTIV and write to outfile (unless nofile)</explanation>
<argument>--euler</argument>
<explanation>Write out number of defect holes in orig.nofix based on the euler number. This is the orig file prior to topology fixing. </explanation>
<intro>Average waveform options</intro>
Expand Down

0 comments on commit 8bc750c

Please sign in to comment.