|Deletions are marked like this.||Additions are marked like this.|
|Line 1:||Line 1:|
[[FsTutorial|top]] | [[FsTutorial/MorphAndRecon|previous]]
== Troubleshooting Guide ==
This guide provides troubleshooting information for common problems in cortical reconstruction.
=== 1.0 Problems creating surfaces ===
'''1.1 Skull stripping'''
Refer to the [[FsTutorial/SkullStripFix|Skull Stripping exercise]] for troubleshooting guidelines.
'''1.2 Failure of automatic cutting planes'''
In some cases, the cutting planes are not found correctly during the white matter fill step of the volume processing pipeline. The results of this can be seen in [[FsTutorial/Tools|tkmedit]] as incorrectly colored voxels in the filled volume, as straight lines making inappropriate cuts in the volume, or in the inflated surface using tksurfer. Automatic cutting plane failure can also be seen in the wm volume, where the brain stem is being incorrectly identified as white matter, and in tksurfer where there is a large protrusion in the center of the medial aspect of the inflated surface.
The following instructions describe how to manually define the two cutting planes to correct these problems. Note that after you run recon-all with the -autorecon2-wm flag, you will still need to run it with the -autorecon3 flag. You can run it with both -autorecon2-wm and -autorecon3, though if the changes you made did not fix the problem, then the time spent running autorecon3 will be wasted.
'''1.2.1 Left-right hemisphere separation (corpus callosum cutting plane)'''
Load the subjects WM volume into [[FsTutorial/Tools|tkmedit]] with the T1 volume as the aux volume (tkmedit subject wm.mgz -aux T1.mgz). Find a sagittal slice in the WM volume in which the corpus callosum is disconnected from the rest of the wm. This slice should be near the mid-line. If you cannot find a slice with the corpus callosum already disconnected, then detach it manually by erasing a fine line of voxels around its perimeter. Select Edit Voxels under [[FsTutorial/Tools|tkmedit]]s Tools menu, then click with button-3 to erase (see Guide to [[FsTutorial/Tools|tkmedit]] for more information on editing voxels). Then select Save Main Volume under the File menu.
Now pick a point (mouse button-1) in the corpus callosum and verify with both the horizontal view and the coronal view that your cursor is central in all three views adjust as necessary. Once you have a good point you can use these coordinates, available in the Cursor section of the [[FsTutorial/Tools|tkmedit]] Tools window, with the following command to run the recon-all process starting from the mri_fill step:
recon-all -autorecon2-wm -cc-crs <X Y Z> -subjid <subject name>
If the pons cutting plane also needs to be set, see below for instructions and then you can use one command, with two sets of coordinates, to run recon-all from the mri_fill step.
'''1.1.2 Separation of brain stem and cerebellum (pons cutting plane)'''
Load the subjects WM volume into [[FsTutorial/Tools|tkmedit]] with the T1 volume as the aux volume (tkmedit subject wm.mgz -aux T1.mgz). Find a horizontal slice in the WM volume in which the brainstem is disconnected from the rest of the brain. This slice should be near the top of the pons. Click on a point (left mouse button) and verify in both the sagittal and the coronal views that your cursor is in the center of the pons. Adjust as necessary. Once you have a good point, record the three numbers (X, Y, Z) in the "Volume index" field of the Cursor section in the [[FsTutorial/Tools|tkmedit]] Tools window, then use the following command to run the recon-all process starting from the mri_fill step:
recon-all -autorecon2-wm -pons-crs <X Y Z> -subjid <subject name>
If both the corpus callosum and pons cutting planes need to be set you can use one single command to do this:
recon-all -autorecon2-wm -cc-crs <X Y Z> -pons-crs <X Y Z> -subjid <subject name>
If you cannot find a slice with the mid-brain disconnected, then separate the mid-brain manually by erasing a thin line of voxels by clicking button-3 in [[FsTutorial/Tools|tkmedit]], then save your changes to the WM volume by choosing '''File -> Save Main Volume'''.
'''1.2.3 Cerebellar attachment'''
Sometimes after mri_fill is run, creating the WM volume and inflated surface, you will find that the cerebellum is attached to the rest of the cortex. This is usually due to failure of the automatic cutting planes, as shown in the previous section, but sometimes the segmented hippocampal strands are joined to the cerebellum. These adjoining voxels must be manually erased. Load the WM volume into tkmedit and select '''Tools -> Edit Voxels''' and using mouse button-3 you can remove the necessary voxels. After saving your changes, rerun the surface creation steps using the command:
recon-all -autorecon2-wm -subjid <subject name>
'''1.3 Manually editing topological defects'''
Refer to the [[FsTutorial/WhiteMatterEdits|Manual Edits exercise]] for troubleshooting guidelines.
'''1.4 Automatically fixing surface topology'''
On occasion, you may find that the topology fixer seems to fail, snarling the surface in regions quite a distance from the area of your edits. The reason for this is that the topology correction procedure assumes that a defect is small relative to the "correct" topology of the surface. If this is not the case, either because there is one large defect or a number of smaller ones close to one another, then the topology correction may result in a local geometric inaccuracy in the surface. Note that the topology of the surface is guaranteed. You can get the mris_fix_topology binary to write out the labels (i.e. the sequentially numbered contiguous regions of what it detected as defects) on the original surface by typing:
setenv DIAG 0x04048
setenv DIAG_VERBOSE 1
mris_fix_topology -suffix _fixed <subject name> <hemisphere>
This will cause the topologically correct surfaces to have the suffix "fixed" appended to their names (e.g. lh.orig_fixed), so that the unfixed surfaces will not be overwritten. You should be able to bring up the unfixed surface in tksurfer (e.g. tksurfer <subject name> <hemisphere> inflated) and read in the curvature file named lh.defect_labels or rh.defect_labels. This will show you exactly what the topology correction detected as defects.