|
Size: 9170
Comment:
|
Size: 11542
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 30: | Line 30: |
| tkmedit pial_edits_before brainmask.mgz -aux T1.mgz -surfs | 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 \ pial_edits_before/surf/lh.inflated:visible=0 \ pial_edits_before/surf/rh.inflated:visible=0 |
| Line 32: | Line 39: |
| The command above will open the brainmask.mgz volume, the T1.mgz loaded as aux, and the surfaces for both hemispheres. (You can feel free to open other volumes in aux or to load in the aseg.mgz if you want or need to.) 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. If you would like to see the inflated surfaces for each hemisphere of this subject, '''open a second and third terminal window''', then open the surfaces in tksurfer: |
The command above will open the brainmask.mgz and T1.mgz volumes and the surfaces for both hemispheres. (You can feel free to open other volumes using the load volume button or to load in the aseg.mgz if you want or need to. 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. If you would like to see the inflated surfaces for each hemisphere of this subject, then you need to switch to the 3D view and check the boxes next to the ?h.inflated surfaces. Uncheck the same boxes before switching back to one of the three slice views. Alternatively, you can view the inflated surfaces in a separate instance of Freeview by running the command below in a new terminal window. |
| Line 35: | Line 45: |
| tksurfer pial_edits_before lh inflated | freeview -f \ pial_edits_before/surf/lh.inflated \ pial_edits_before/surf/rh.inflated |
| Line 37: | Line 49: |
| {{{ tksurfer pial_edits_before rh inflated }}} Once you have identified the problem (or have given up!), click [[FsTutorial/PialEdits|here]] for detailed instructions on how you can fix it. |
Once you have identified the problem (or have given up!), click [[FsTutorial/PialEdits_freeview|here]] for detailed instructions on how you can fix it. |
| Line 45: | Line 55: |
| tkmedit wm1_edits_before brainmask.mgz -aux T1.mgz -surfs | 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 \ wm1_edits_before/surf/lh.inflated:visible=0 \ wm1_edits_before/surf/rh.inflated:visible=0 |
| Line 47: | Line 64: |
| Line 48: | Line 66: |
| In your second and third terminal window, if not already open, open the surfaces in tksurfer: | If you would like to see the inflated surfaces for each hemisphere of this subject, then you need to switch to the 3D view and check the boxes next to the ?h.inflated surfaces. Uncheck the same boxes before switching back to one of the three slice views. Alternatively, you can view the inflated surfaces in a separate instance of Freeview by running the command below in a new terminal window. |
| Line 50: | Line 70: |
| tksurfer wm1_edits_before lh inflated | freeview -f \ wm1_edits_before/surf/lh.inflated \ wm1_edits_before/surf/rh.inflated |
| Line 52: | Line 74: |
| {{{ tksurfer wm1_edits_before rh inflated }}} This will open the inflated surfaces for both hemispheres in tksurfer. |
|
| Line 58: | Line 77: |
| Click [[FsTutorial/WhiteMatterEdits|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'''. | 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'''. |
| Line 61: | Line 80: |
| tkmedit wm1_edits_after brainmask.mgz -aux wm.mgz -surfs | 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 |
| Line 65: | Line 89: |
| Open the subject, '''topo_defect_before''', in tkmedit. | Open the subject, '''topo_defect_before''', in freeview. |
| Line 67: | Line 91: |
| tkmedit topo_defect_before brainmask.mgz -aux wm.mgz -surfs | 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 |
| Line 69: | Line 98: |
| This will open the brainmask.mgz volume, the wm.mgz loaded as aux, and the surfaces for both hemispheres. Take a look at this subject, inspecting the various outputs that were mentioned in the [[FsTutorial/OutputData|previous exercise]] and see if you can identify what is wrong. |
This will open the brainmask.mgz volume, the wm.mgz, and the surfaces for both hemispheres. Take a look at this subject, inspecting the various outputs that were mentioned in the [[FsTutorial/OutputData_freeview|previous exercise]] and see if you can identify what is wrong. |
| Line 72: | Line 101: |
| Once you spot the error, click [[FsTutorial/TopologicalDefect|here]] for detailed instructions on how you can fix it. After you have fixed it, you can compare the original data to the a corrected and rerun version, '''topo_defect_after'''. To view this corrected subject: | 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 a corrected and rerun version, '''topo_defect_after'''. To view this corrected subject: |
| Line 74: | Line 103: |
| tkmedit topo_defect_after brainmask.mgz -aux wm.mgz -surfs | 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 |
| Line 78: | Line 112: |
| Now, take a look at the next subject, '''skullstrip1_before''', in tkmedit. | Now, take a look at the next subject, '''skullstrip1_before''', in freeview. |
| Line 80: | Line 114: |
| tkmedit skullstrip1_before brainmask.mgz -aux T1.mgz -surfs | 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 |
| Line 82: | Line 121: |
| This will open the brainmask.mgz volume, the T1.mgz loaded as aux, and the surfaces for both hemispheres. | This will open the brainmask.mgz volume, the T1.mgz, and the surfaces for both hemispheres. |
| Line 85: | Line 124: |
| Click [[FsTutorial/SkullStripFix|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. You can also compare this to the finished version, '''skullstrip1_after'''. |
| Line 90: | Line 129: |
| tkmedit cp_before brainmask.mgz -aux T1.mgz -surfs | freeview -v cp_before/mri/brainmask.mgz -f pial_edits_before/surf/lh.white:edgecolor=blue pial_edits_before/surf/lh.pial:edgecolor=red pial_edits_before/surf/rh.white:edgecolor=blue pial_edits_before/surf/rh.pial:edgecolor=red |
| Line 93: | Line 136: |
| In your second terminal window, if not already open, open the surfaces in tksurfer: | In your second terminal window, if not already open, open the inflated surfaces in a new instance of Freeview: |
| Line 95: | Line 138: |
| tksurfer cp_before lh inflated & tksurfer cp_before rh inflated & |
freeview -f \ pial_edits_before/surf/lh.inflated \ pial_edits_before/surf/rh.inflated |
| Line 98: | Line 142: |
| This will open the inflated surfaces for both hemispheres in tksurfer. The trouble with this subject has occured 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 intensity is at (or very close to) 110. |
This will open the inflated surfaces for both hemispheres in Freeview. 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 intensity is at (or very close to) 110. |
| Line 101: | Line 146: |
| Click [[FsTutorial/ControlPoints|here]] for detailed instructions on how you can fix it. | Click [[FsTutorial/ControlPoints_freeview|here]] for detailed instructions on how you can fix it. |
| Line 106: | Line 151: |
| tkmedit tal_before brainmask.mgz -aux T1.mgz -surfs | freeview -v tal_before/mri/T1.mgz tal_before/mri/brainmask.mgz:reg=transforms/talairach.xfm |
| Line 108: | Line 153: |
| Again, this will bring up the brainmask.mgz volume and the T1.mgz volume and the surfaces for both hemispheres. In a second and third terminal window, if not already open, open the surfaces in tksurfer: |
Again, this will bring up the brainmask.mgz volume and the T1.mgz volume. In a second and third terminal window, if not already open, open the inflated surfaces in a new instance of Freeview: |
| Line 111: | Line 156: |
| tksurfer tal_before lh inflated | freeview -f \ tal_before/surf/lh.inflated \ tal_before/surf/rh.inflated |
| Line 113: | Line 160: |
| {{{ tksurfer tal_before rh inflated }}} This will open the inflated surfaces for both hemispheres in tksurfer. |
This will open the inflated surfaces for both hemispheres in Freeview. |
| Line 119: | Line 164: |
| Click [[FsTutorial/Talairach|here]] for detailed instructions on how you can fix it. | Click [[FsTutorial/Talairach_freeview|here]] for detailed instructions on how you can fix it. |
| Line 122: | Line 167: |
| 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/TkMeditSegmentations|here]]. | 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]]. |
1. 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.1. Preparations
1.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:
setenv 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.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:
tcsh source your_freesurfer_dir/SetUpFreeSurfer.csh setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs cd $SUBJECTS_DIR
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.
1.2. Failure Modes
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. While you are trying to identify the problems with the subjects listed below you may find it helpful to refer back to the previous exercise, or open your own instance of the subject good_output to compare these subjects to a good example.
1.2.1. 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 \ pial_edits_before/surf/lh.inflated:visible=0 \ pial_edits_before/surf/rh.inflated:visible=0
The command above will open the brainmask.mgz and T1.mgz volumes and the surfaces for both hemispheres. (You can feel free to open other volumes using the load volume button or to load in the aseg.mgz if you want or need to. 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.
If you would like to see the inflated surfaces for each hemisphere of this subject, then you need to switch to the 3D view and check the boxes next to the ?h.inflated surfaces. Uncheck the same boxes before switching back to one of the three slice views. Alternatively, you can view the inflated surfaces in a separate instance of Freeview by running the command below in a new terminal window.
freeview -f \ pial_edits_before/surf/lh.inflated \ pial_edits_before/surf/rh.inflated
Once you have identified the problem (or have given up!), click here for detailed instructions on how you can fix it.
1.2.2. Edits to the wm volume
Now, take a look at the next subject, wm1_edits_before.
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 \ wm1_edits_before/surf/lh.inflated:visible=0 \ wm1_edits_before/surf/rh.inflated:visible=0
Again, this will bring up the brainmask.mgz volume, the T1.mgz volume, and the surfaces for both hemispheres.
If you would like to see the inflated surfaces for each hemisphere of this subject, then you need to switch to the 3D view and check the boxes next to the ?h.inflated surfaces. Uncheck the same boxes before switching back to one of the three slice views. Alternatively, you can view the inflated surfaces in a separate instance of Freeview by running the command below in a new terminal window.
freeview -f \ wm1_edits_before/surf/lh.inflated \ wm1_edits_before/surf/rh.inflated
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 as the aux volume you will see a hole in this area. If you are looking in tksurfer you will see a hole or dimple in the inflated surface. You can use the "save point" "goto point" commands to find this spot in the volume.
Click 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):
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
1.2.3. 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, inspecting the various outputs that were mentioned in the previous exercise 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. After you have fixed it, you can compare the original data to the a 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
1.2.4. 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
This will open the brainmask.mgz volume, the T1.mgz, and the surfaces for both hemispheres. 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 (loaded in aux) to make sure that the skull has been completely stripped away, leaving behind the complete cortex and the cerebellum. You can feel free to open other volumes in aux or to load in the aseg.mgz if you want or need to. Click here for detailed instructions on how you can fix it. You can also compare this to the finished version, skullstrip1_after.
1.2.5. Adding control points
Now, take a look at the next subject, cp_before.
freeview -v cp_before/mri/brainmask.mgz -f pial_edits_before/surf/lh.white:edgecolor=blue pial_edits_before/surf/lh.pial:edgecolor=red pial_edits_before/surf/rh.white:edgecolor=blue pial_edits_before/surf/rh.pial:edgecolor=red
Again, this will bring up the brainmask.mgz volume, the T1.mgz volume, and the surfaces for both hemispheres. In your second terminal window, if not already open, open the inflated surfaces in a new instance of Freeview:
freeview -f \ pial_edits_before/surf/lh.inflated \ pial_edits_before/surf/rh.inflated
This will open the inflated surfaces for both hemispheres in Freeview. 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 intensity is at (or very close to) 110. You may need to open other volumes in order to see or fix the problem. Click here for detailed instructions on how you can fix it.
1.2.6. 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=transforms/talairach.xfm
Again, this will bring up the brainmask.mgz volume and the T1.mgz volume. In a second and third terminal window, if not already open, open the inflated surfaces in a new instance of Freeview:
freeview -f \ tal_before/surf/lh.inflated \ tal_before/surf/rh.inflated
This will open the inflated surfaces for both hemispheres in Freeview. 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. You may need to open other volumes in order to see or fix the problem. Click here for detailed instructions on how you can fix it.
1.2.7. 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 here.
