|
Size: 9642
Comment:
|
Size: 10390
Comment: added correct "_after" subjects for edits to brainmask volume
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| #pragma section-numbers 1 | |
| Line 4: | Line 5: |
| = Troubleshooting your output = This set of exercises will take you through a few examples of problem outputs, asking you to identify the problems and possible methods to fix the problems. Each example will have a before and after picture, as well as an explanation of how to fix the problems seen. '''<<TableOfContents>>''' |
{{{#!html <h1>Troubleshooting your output</h1> }}} This set of exercises will take you through a few examples of problem outputs, asking you to identify the problems and possible methods to fix the problems. Each example will have a before and after picture, as well as an explanation of how to fix the problems seen. '''<<TableOfContents(2)>>''' |
| Line 11: | Line 14: |
| Line 12: | Line 16: |
| setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs | export SUBJECTS_DIR=$TUTORIAL_DATA/buckner_data/tutorial_subjs |
| Line 15: | Line 19: |
| ''To copy: Highlight the command in the box above, right click and select copy (or use keyboard shortcut Ctrl+c), then use the middle button of your mouse to click inside the terminal window (this will paste the command). Press enter to run the command.'' These two commands set the SUBJECTS_DIR variable to the directory where the data is stored and then navigates into this directory. You can now skip ahead to the tutorial (below the gray line). |
''To copy: Highlight the command in the box above, right click and select copy (or use keyboard shortcut Ctrl+c), then use the middle button of your mouse to click inside the terminal window (this will paste the command). Press enter to run the command.'' These two commands set the SUBJECTS_DIR variable to the directory where the data is stored and then navigates into this directory. You can now skip ahead to the tutorial (below the gray line). |
| Line 19: | Line 23: |
| Line 20: | Line 25: |
| tcsh source your_freesurfer_dir/SetUpFreeSurfer.csh setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs |
<source_freesurfer> export TUTORIAL_DATA=<path_to_your_tutorial_data> export SUBJECTS_DIR=$TUTORIAL_DATA/buckner_data/tutorial_subjs |
| Line 25: | Line 30: |
| Notice the command to open tcsh. If you are already running the tcsh command shell, then the 'tcsh' command is not necessary. If you are not using the tutorial data you should set your {{{SUBJECTS_DIR}}} to the directory in which the recon(s) of the subject(s) you will use for this tutorial are located. | If you are not using the tutorial data you should set your {{{SUBJECTS_DIR}}} to the directory in which the recon(s) of the subject(s) you will use for this tutorial are located. |
| Line 27: | Line 33: |
| == Troubleshooting == Below, we ask you to look at several subjects with various errors that require manual intervention. Open each subject and try to identify the problem on your own. For each subject, there is a link to instructions on how to fix the problem. |
Below, we ask you to look at several subjects with various errors that require manual intervention. Open each subject and try to identify the problem on your own. For each subject, there is a link to instructions on how to fix the problem. |
| Line 30: | Line 35: |
| If you need a reminder of how to view the various outputs, you can refer back to the [[FsTutorial/OutputData_freeview|previous exercise]]. While troubleshooting, feel free to open other outputs for inspection. | If you need a reminder of how to view the various outputs, you can refer back to the [[FsTutorial/OutputData_freeview|previous exercise]]. While troubleshooting, feel free to open other outputs for inspection. |
| Line 32: | Line 38: |
| === Edits to the brainmask volume === | == Edits to the brainmask volume == |
| Line 34: | Line 40: |
| Line 42: | Line 49: |
| The command above will open the brainmask.mgz and T1.mgz volumes and the surfaces for both hemispheres. Scroll through the slices of this subject to check the pial and white surfaces for accuracy, making sure they follow the actual gray/white boundaries and that they do not include anything that should not be included. | |
| Line 43: | Line 51: |
| The command above will open the brainmask.mgz and T1.mgz volumes and the surfaces for both hemispheres. Scroll through the slices of this subject to check the pial and white surfaces for accuracy, making sure they follow the actual gray/white boundaries and that they do not include anything that should not be included. | Once you have identified the problem (or have given up!), click [[FsTutorial/PialEdits_freeview|here]] for detailed instructions on how you can fix it using Freeview. |
| Line 45: | Line 53: |
| Once you have identified the problem (or have given up!), click [[FsTutorial/PialEdits_freeview|here]] for detailed instructions on how you can fix it. ---- === Edits to the wm volume === Now, take a look at the next subject, '''wm1_edits_before'''. |
You can also compare the original data to a corrected and rerun version, '''pial_edits_after'''. To view this corrected subject (which was corrected by following the detailed instructions provided to you): |
| Line 50: | Line 56: |
| freeview -v wm1_edits_before/mri/T1.mgz \ wm1_edits_before/mri/brainmask.mgz \ -f wm1_edits_before/surf/lh.white:edgecolor=yellow \ wm1_edits_before/surf/lh.pial:edgecolor=red \ wm1_edits_before/surf/rh.white:edgecolor=yellow \ wm1_edits_before/surf/rh.pial:edgecolor=red |
freeview -v pial_edits_after/mri/T1.mgz \ pial_edits_after/mri/brainmask.mgz \ -f pial_edits_after/surf/lh.white:edgecolor=yellow \ pial_edits_after/surf/lh.pial:edgecolor=red \ pial_edits_after/surf/rh.white:edgecolor=yellow \ pial_edits_after/surf/rh.pial:edgecolor=red |
| Line 58: | Line 64: |
| Again, this will bring up the brainmask.mgz volume, the T1.mgz volume, and the surfaces for both hemispheres. | |
| Line 60: | Line 65: |
| If you would like to see the inflated surfaces for each hemisphere of this subject, you can view the inflated surfaces in a separate instance of freeview by running the command below in a new terminal window. (Note: Initially, only the right inflated hemisphere will be visible to prevent overlap) | ---- == Edits to the wm volume == Now, take a look at the next subject, '''wm1_edits_before'''. |
| Line 63: | Line 70: |
| freeview -f \ wm1_edits_before/surf/lh.inflated:visible=0 \ wm1_edits_before/surf/rh.inflated \ -viewport 3d |
freeview -v wm1_edits_before/mri/brainmask.mgz \ wm1_edits_before/mri/wm.mgz:colormap=heat:opacity=0.4 \ -f wm1_edits_before/surf/lh.white:edgecolor=blue \ wm1_edits_before/surf/lh.pial:edgecolor=red \ wm1_edits_before/surf/rh.white:edgecolor=blue \ wm1_edits_before/surf/rh.pial:edgecolor=red \ wm1_edits_before/surf/rh.inflated:visible=0 \ wm1_edits_before/surf/lh.inflated:visible=0 |
| Line 68: | Line 79: |
| Again, this will bring up the brainmask, the wm.mgz volume, the surfaces for both hemispheres, as well as the inflated surfaces. | |
| Line 69: | Line 81: |
| The trouble with this subject has occurred during the white matter segmentation step. Check the surfaces in the T1 volume to find the spot that does not match the actual gray/white boundary. If you load the wm.mgz volume you will see a hole in this area. If you are looking at the inflated surfaces in the 3D view, you will see a hole or dimple in the area in question. | The trouble with this subject has occurred during the white matter segmentation step. Check the surfaces in the brainmask volume to find the spot that does not match the actual gray/white boundary. In the wm.mgz volume you will see a hole in this area. If you are looking at the inflated surfaces in the 3D view, you will see a hole or dimple in the area in question. |
| Line 71: | Line 83: |
| Click [[FsTutorial/WhiteMatterEdits_freeview|here]] for detailed instructions on how you can fix it. You can also compare the original data to a corrected and rerun version, '''wm1_edits_after'''. To view this corrected subject (which was corrected by following the detailed instructions provided to you): |
Click [[FsTutorial/WhiteMatterEdits_freeview|here]] for detailed instructions on how you can fix it using Freeview. You can also compare the original data to a corrected and rerun version, '''wm1_edits_after'''. To view this corrected subject (which was corrected by following the detailed instructions provided to you): |
| Line 82: | Line 96: |
| === Correcting topological defects === | == Correcting topological defects == |
| Line 84: | Line 98: |
| Line 92: | Line 107: |
| This will open the brainmask.mgz volume, the wm.mgz, and the surfaces for both hemispheres. Take a look at this subject and see if you can identify what is wrong. ''Hint: It's a very small error in the posterior part of the brain.'' Once you spot the error, click [[FsTutorial/TopologicalDefect_freeview|here]] for detailed instructions on how you can fix it. After you have fixed it, you can compare the original data to the corrected and rerun version, '''topo_defect_after'''. To view this corrected subject: |
This will open the brainmask.mgz volume, the wm.mgz, and the surfaces for both hemispheres. Take a look at this subject and see if you can identify what is wrong. ''Hint: It's a very small error in the posterior part of the brain.'' Once you spot the error, click [[FsTutorial/TopologicalDefect_freeview|here]] for detailed instructions on how you can fix it using Freeview. After you have fixed it, you can compare the original data to the corrected and rerun version, '''topo_defect_after'''. To view this corrected subject: |
| Line 105: | Line 122: |
| === Skull strip === | == Skull strip == |
| Line 107: | Line 124: |
| Line 115: | Line 133: |
| Line 118: | Line 135: |
| Click [[FsTutorial/SkullStripFix_freeview|here]] for detailed instructions on how you can fix it. You can also compare this to the finished version, '''skullstrip1_after'''. | Click [[FsTutorial/SkullStripFix_freeview|here]] for detailed instructions on how you can fix it using Freeview. You can also compare this to the finished version, '''skullstrip1_after'''. To view this corrected subject: {{{ freeview -v skullstrip1_after/mri/T1.mgz \ skullstrip1_after/mri/brainmask.mgz \ -f skullstrip1_after/surf/lh.white:edgecolor=yellow \ skullstrip1_after/surf/lh.pial:edgecolor=red \ skullstrip1_after/surf/rh.white:edgecolor=yellow \ skullstrip1_after/surf/rh.pial:edgecolor=red }}} |
| Line 120: | Line 148: |
| === Adding control points === | == Adding control points == |
| Line 122: | Line 150: |
| Line 130: | Line 159: |
| Line 133: | Line 161: |
| Click [[FsTutorial/ControlPoints_freeview|here]] for detailed instructions on how you can fix it. | Click [[FsTutorial/ControlPoints_freeview|here]] for detailed instructions on how you can fix it using Freeview. |
| Line 135: | Line 164: |
| === Talairach transformation === | == Talairach transformation == |
| Line 137: | Line 166: |
| Line 139: | Line 169: |
| tal_before/mri/brainmask.mgz:reg=transforms/talairach.xfm | tal_before/mri/brainmask.mgz:reg=tal_before/mri/transforms/talairach.xfm |
| Line 141: | Line 171: |
| In a second terminal window, open the inflated surfaces in a new instance of freeview. (Note: Initially, only the right inflated hemisphere will be visible to prevent overlap) | |
| Line 142: | Line 173: |
| In a second terminal window, open the inflated surfaces in a new instance of freeview. (Note: Initially, only the right inflated hemisphere will be visible to prevent overlap) | |
| Line 149: | Line 179: |
| Line 152: | Line 181: |
| Click [[FsTutorial/Talairach_freeview|here]] for detailed instructions on how you can fix it. | Click [[FsTutorial/Talairach_freeview|here]] for detailed instructions on how you can fix it using Freeview. |
| Line 154: | Line 184: |
| === Editing the Aseg === We generally advise against editing the aseg.mgz unless absolutely necessary. Try using an xopts script first to change the intensity thresholds being used. Editing the aseg will add more variance to your data. Instructions on how to edit the aseg are [[TkMeditGuide/TkMeditWorkingWithData/FreeviewSegmentations|here]]. |
== Editing the Aseg == If you are at an organized course, this is '''NOT''' something you need to work on. This section is here to refer to if you run into issues at a later point. We generally advise against editing the aseg.mgz unless absolutely necessary. Try using an xopts script first to change the intensity thresholds being used. Editing the aseg will add more variance to your data. Instructions on how to edit the aseg using Freeview are [[TkMeditGuide/TkMeditWorkingWithData/FreeviewSegmentations|here]]. |
Troubleshooting your output
This set of exercises will take you through a few examples of problem outputs, asking you to identify the problems and possible methods to fix the problems. Each example will have a before and after picture, as well as an explanation of how to fix the problems seen.
1. Preparations
1.1. If You're at an Organized Course
If you are taking one of the formally organized courses, everything has been set up for you on the provided laptop. The only thing you will need to do is run the following commands in every new terminal window (aka shell) you open throughout this tutorial. Copy and paste the commands below to get started:
export SUBJECTS_DIR=$TUTORIAL_DATA/buckner_data/tutorial_subjs cd $SUBJECTS_DIR
To copy: Highlight the command in the box above, right click and select copy (or use keyboard shortcut Ctrl+c), then use the middle button of your mouse to click inside the terminal window (this will paste the command). Press enter to run the command. These two commands set the SUBJECTS_DIR variable to the directory where the data is stored and then navigates into this directory. You can now skip ahead to the tutorial (below the gray line).
1.2. If You're not at an Organized Course
If you are NOT taking one of the formally organized courses, then to follow this exercise exactly be sure you've downloaded the tutorial data set before you begin. If you choose not to download the data set you can follow these instructions on your own data, but you will have to substitute your own specific paths and subject names. These are the commands that you need to run before getting started:
<source_freesurfer> export TUTORIAL_DATA=<path_to_your_tutorial_data> export SUBJECTS_DIR=$TUTORIAL_DATA/buckner_data/tutorial_subjs cd $SUBJECTS_DIR
If you are not using the tutorial data you should set your SUBJECTS_DIR to the directory in which the recon(s) of the subject(s) you will use for this tutorial are located.
Below, we ask you to look at several subjects with various errors that require manual intervention. Open each subject and try to identify the problem on your own. For each subject, there is a link to instructions on how to fix the problem.
If you need a reminder of how to view the various outputs, you can refer back to the previous exercise. While troubleshooting, feel free to open other outputs for inspection.
2. Edits to the brainmask volume
Open the subject, pial_edits_before.
freeview -v pial_edits_before/mri/T1.mgz \ pial_edits_before/mri/brainmask.mgz \ -f pial_edits_before/surf/lh.white:edgecolor=yellow \ pial_edits_before/surf/lh.pial:edgecolor=red \ pial_edits_before/surf/rh.white:edgecolor=yellow \ pial_edits_before/surf/rh.pial:edgecolor=red
The command above will open the brainmask.mgz and T1.mgz volumes and the surfaces for both hemispheres. Scroll through the slices of this subject to check the pial and white surfaces for accuracy, making sure they follow the actual gray/white boundaries and that they do not include anything that should not be included.
Once you have identified the problem (or have given up!), click here for detailed instructions on how you can fix it using Freeview.
You can also compare the original data to a corrected and rerun version, pial_edits_after. To view this corrected subject (which was corrected by following the detailed instructions provided to you):
freeview -v pial_edits_after/mri/T1.mgz \ pial_edits_after/mri/brainmask.mgz \ -f pial_edits_after/surf/lh.white:edgecolor=yellow \ pial_edits_after/surf/lh.pial:edgecolor=red \ pial_edits_after/surf/rh.white:edgecolor=yellow \ pial_edits_after/surf/rh.pial:edgecolor=red
3. Edits to the wm volume
Now, take a look at the next subject, wm1_edits_before.
freeview -v wm1_edits_before/mri/brainmask.mgz \ wm1_edits_before/mri/wm.mgz:colormap=heat:opacity=0.4 \ -f wm1_edits_before/surf/lh.white:edgecolor=blue \ wm1_edits_before/surf/lh.pial:edgecolor=red \ wm1_edits_before/surf/rh.white:edgecolor=blue \ wm1_edits_before/surf/rh.pial:edgecolor=red \ wm1_edits_before/surf/rh.inflated:visible=0 \ wm1_edits_before/surf/lh.inflated:visible=0
Again, this will bring up the brainmask, the wm.mgz volume, the surfaces for both hemispheres, as well as the inflated surfaces.
The trouble with this subject has occurred during the white matter segmentation step. Check the surfaces in the brainmask volume to find the spot that does not match the actual gray/white boundary. In the wm.mgz volume you will see a hole in this area. If you are looking at the inflated surfaces in the 3D view, you will see a hole or dimple in the area in question.
Click here for detailed instructions on how you can fix it using Freeview.
You can also compare the original data to a corrected and rerun version, wm1_edits_after. To view this corrected subject (which was corrected by following the detailed instructions provided to you):
freeview -v wm1_edits_after/mri/T1.mgz \ wm1_edits_after/mri/brainmask.mgz \ -f wm1_edits_after/surf/lh.white:edgecolor=yellow \ wm1_edits_after/surf/lh.pial:edgecolor=red \ wm1_edits_after/surf/rh.white:edgecolor=yellow \ wm1_edits_after/surf/rh.pial:edgecolor=red
4. Correcting topological defects
Open the subject, topo_defect_before, in freeview.
freeview -v topo_defect_before/mri/brainmask.mgz \ topo_defect_before/mri/wm.mgz:colormap=heat:opacity=0.4 \ -f topo_defect_before/surf/lh.white:edgecolor=yellow \ topo_defect_before/surf/lh.pial:edgecolor=red \ topo_defect_before/surf/rh.white:edgecolor=yellow \ topo_defect_before/surf/rh.pial:edgecolor=red
This will open the brainmask.mgz volume, the wm.mgz, and the surfaces for both hemispheres. Take a look at this subject and see if you can identify what is wrong. Hint: It's a very small error in the posterior part of the brain.
Once you spot the error, click here for detailed instructions on how you can fix it using Freeview.
After you have fixed it, you can compare the original data to the corrected and rerun version, topo_defect_after. To view this corrected subject:
freeview -v topo_defect_after/mri/brainmask.mgz \ topo_defect_after/mri/wm.mgz:colormap=heat:opacity=0.4 \ -f topo_defect_after/surf/lh.white:edgecolor=yellow \ topo_defect_after/surf/lh.pial:edgecolor=red \ topo_defect_after/surf/rh.white:edgecolor=yellow \ topo_defect_after/surf/rh.pial:edgecolor=red
5. Skull strip
Now, take a look at the next subject, skullstrip1_before, in freeview.
freeview -v skullstrip1_before/mri/T1.mgz \ skullstrip1_before/mri/brainmask.mgz \ -f skullstrip1_before/surf/lh.white:edgecolor=yellow \ skullstrip1_before/surf/lh.pial:edgecolor=red \ skullstrip1_before/surf/rh.white:edgecolor=yellow \ skullstrip1_before/surf/rh.pial:edgecolor=red
The trouble with this subject has occurred in the skull stripping step. Check the brainmask.mgz volume carefully, comparing it to the T1.mgz volume to make sure that the skull has been completely stripped away, leaving behind the complete cortex and the cerebellum.
Click here for detailed instructions on how you can fix it using Freeview.
You can also compare this to the finished version, skullstrip1_after. To view this corrected subject:
freeview -v skullstrip1_after/mri/T1.mgz \ skullstrip1_after/mri/brainmask.mgz \ -f skullstrip1_after/surf/lh.white:edgecolor=yellow \ skullstrip1_after/surf/lh.pial:edgecolor=red \ skullstrip1_after/surf/rh.white:edgecolor=yellow \ skullstrip1_after/surf/rh.pial:edgecolor=red
6. Adding control points
Now, take a look at the next subject, cp_before.
freeview -v cp_before/mri/brainmask.mgz \ cp_before/mri/T1.mgz \ -f cp_before/surf/lh.white:edgecolor=blue \ cp_before/surf/lh.pial:edgecolor=red \ cp_before/surf/rh.white:edgecolor=blue \ cp_before/surf/rh.pial:edgecolor=red
The trouble with this subject has occurred during the intensity normalization. Check the white surface and be sure it is including all of the white matter as it should. If you find an area that is not included as white matter be sure to check to see that the brainmask voxel intensity is at (or very close to) 110.
Click here for detailed instructions on how you can fix it using Freeview.
7. Talairach transformation
Now, take a look at the next subject, tal_before.
freeview -v tal_before/mri/T1.mgz \ tal_before/mri/brainmask.mgz:reg=tal_before/mri/transforms/talairach.xfm
In a second terminal window, open the inflated surfaces in a new instance of freeview. (Note: Initially, only the right inflated hemisphere will be visible to prevent overlap)
freeview -f \ tal_before/surf/lh.inflated:visible=0 \ tal_before/surf/rh.inflated \ -viewport 3d
The trouble with this subject is a little tricky to figure out. The midline cutting planes are not actually on the midline, but the real root of this problem is in one of the very initial steps of recon-all. The talairach transform is bad and will need to be fixed.
Click here for detailed instructions on how you can fix it using Freeview.
8. Editing the Aseg
If you are at an organized course, this is NOT something you need to work on. This section is here to refer to if you run into issues at a later point.
We generally advise against editing the aseg.mgz unless absolutely necessary. Try using an xopts script first to change the intensity thresholds being used. Editing the aseg will add more variance to your data. Instructions on how to edit the aseg using Freeview are here.
