Differences between revisions 6 and 7
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
cd $SUBJECTS_DIR/subject cd $SUBJECTS_DIR/<subjid>/mri
Line 14: Line 14:
"rawavg.mgz" is a file created by FreeSurfer and is in the native space of your anatomical. The output is brain-in-rawavg.mgz and will be in the native space of the anatomical. "rawavg.mgz" is a file created by FreeSurfer and is in the native space of your anatomical so we use that volume as a target space. The output is brain-in-rawavg.mgz and will be in the native space of the anatomical. Substitute brain.mgz with whatever other images you want in native space.
Line 19: Line 19:
cd $SUBJECTS_DIR/subject
mri_label2vol --seg aseg.mgz --regheader rawavg.mgz --o aseg-in-rawavg.mgz --temp aseg.mgz}}}
cd $SUBJECTS_DIR/<subjid>/mri
mri_label2vol --seg aseg.mgz --regheader rawavg.mgz --o aseg-in-rawavg.mgz --temp aseg.mgz
}}}
Line 22: Line 23:
After running these two commands, tkmedit should show the aseg overlaid properly on the brain If you ran both of the commands above, tkmedit should show the aseg (in native space) overlaid properly on the brain (in native space) all matching up well with the rawavg.mgz (your native space target).
Line 24: Line 25:
tkmedit -f brain-in-rawavg.mgz -seg aseg-in-rawavg.mgz tkmedit -f brain-in-rawavg.mgz -aux rawavg.mgz -seg aseg-in-rawavg.mgz

How to Convert from FreeSurfer Space Back to Native Anatomical Space

Question: I have successfully run a subject's data through FreeSurfer. FreeSurfer creates volumes in 1mm3, 2563 space, but I want the FreeSurfer results in the space of my original anatomical. How do I do this?

The exact command you use depends on what you want to convert, an image (like brain.mgz) or a segmentation (like aseg.mgz).

For an image:

cd $SUBJECTS_DIR/<subjid>/mri
mri_vol2vol --mov brain.mgz --targ rawavg.mgz --regheader --o brain-in-rawavg.mgz

"rawavg.mgz" is a file created by FreeSurfer and is in the native space of your anatomical so we use that volume as a target space. The output is brain-in-rawavg.mgz and will be in the native space of the anatomical. Substitute brain.mgz with whatever other images you want in native space.

For a segmentation (aseg.mgz, aparc+aseg.mgz, wmparc.mgz, etc):

cd $SUBJECTS_DIR/<subjid>/mri
mri_label2vol --seg aseg.mgz --regheader rawavg.mgz --o aseg-in-rawavg.mgz --temp aseg.mgz

If you ran both of the commands above, tkmedit should show the aseg (in native space) overlaid properly on the brain (in native space) all matching up well with the rawavg.mgz (your native space target).

tkmedit -f brain-in-rawavg.mgz -aux rawavg.mgz -seg aseg-in-rawavg.mgz 

FsAnat-to-NativeAnat (last edited 2019-04-16 15:40:48 by 172)