NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
cteOverlayThicknessImageOnFreeSurfer.sh

(Note: This page is automatically generated. Please do not attempt to edit it!)

This script takes a thickness image (for example, the output of cteRunCrossSectional.sh),
and inserts it onto a FreeSurfer directory structure, effectively replacing the 
lh.thickness and rh.thickness files.

This script will by default move any existing lh/rh.thickness files to a backup file, but
you can force the script to simply overwrite the existing one.

As with other FreeSurfer scripts you MUST set SUBJECTS_DIR environment variable.

Usage: cteOverlayThicknessImageOnFreeSurfer.sh thickness.nii directory [options ]

Mandatory Arguments:

  thickness.nii        : An image of thickness values
  directory            : A FreeSurfer directory structure, where FreeSurfer has already been successfully and completely run.
                         This assumes you have set SUBJECTS_DIR, so you just need the patient directory name.
Options:

  -overwrite           : Force this script to overwrite the lh/rh.thickness files.
    
  -radius              : Search radius. Default 2.
  
  -step                : Number of search steps within that radius. Default 5. 
    
  -background          : Background (zero) value in thickness file.

  -tmproot dir         : Define a root directory for temporary files. Default /tmp
                         The difference between this option and the next, is that this
                         one takes the root directory (eg. /tmp) and creates a sub directory
                         with a process ID in it. (eg. /tmp/seg.1234) whereas the next option
                         just uses exactly what you give it.
                            
  -tmpdir dir          : Set temporary workspace directory.

  -keeptmp             : Keep temporary workspace directory

  -suffix              : Provide a suffix, so that when we move the lh/rh thickness file out the way,
                         it is renamed to lh/rh.thickness.<suffix>
                         
  ******* NOTE ******* : The next two options will resample you thickness file.
  ******* NOTE ******* : You are strongly advised to check that the files
  
                         <patient>/mri/T1.mgz 
                         and
                         <tmpdir>/thickness_resampled.nii 
                         
                         are registered before trusting the final results.
                         
                         The reason you might need the next two flags could be due to:
                         
                         1. You calculated thickness on images outside of FreeSurfer, so when FreeSurfer runs,
                         is has registered to Talairach space, so you need to transform your thickness data to match.
                         So use the -apply_talairach flag.
                         
                         2. If you had been given a FreeSurfer project that has already been run, and you extracted
                         the <patient>/mri/orig/001.mgz, and generated some voxel based thickness, then you will
                         need to apply the FreeSurfer Talairach transform to transform your volume into FreeSurfer space.
                         So use the -apply_talairach flag.
                         
                         3. As above, if you used <patient>/mri/orig.mgz, or <patient>/mri/T1.mgz and calculated
                         thickness data on that, and at the same time you (erroneously) applied the Talairach transformation
                         when in fact these volumes are already in Talairach space, then you will need to invert the
                         Talairach transformation.
                         So use both the -apply_talairach -invert_talairach flags
                         
  -apply_talairach     : Resample the thickness values into the coordinate space of the FreeSurfer <patient>/mri/T1.mgz
  -invert_talairach    : Used in addition to the above flag, invert the transformation.
  
  -surf                : Specify which surface. This should be exactly [mid|white|pial].