Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
In this exercise, an image from a scanner, in DICOM format, will be converted into mgz format, using mri_convert, and placed in the correct directory as created by mksubjdirs. | In this exercise, an image from a scanner, in DICOM format, will be converted into mgz format, using recon-all. |
Line 19: | Line 19: |
Run the mksubjdirs command to create the standard FreeSurfer directory structure for your subject. The usage for mksubjdirs is: | Two acquisitions of an anonymized volume have been provided for this tutorial with the recognizable face characteristics removed, in the directory buckner_data/tutorial_subjs/014-anon and buckner_data/tutorial_subjs/015-anon. Using the recon-all script you can specify both the acquisitions to be converted to mgz format as well as the name you wish to give your subject in the following format: |
Line 21: | Line 21: |
''mksubjdirs <subject name>'' | ''recon-all -i <in volume 1> -i <in volume 2> -s <subject name>'' |
Line 23: | Line 23: |
Where <subject name> is the directory that will be created to hold the hierarchy of volumes related to this subject. In this case, our subject is named 'anon'. |
where <in volume 1> is the first file that appears in the first acquisition directory, and <in volume 2> is the first file that appears in the second acquisition directory. For this example we will use ''anon'' as our <subject name>. To convert the two ''anon'' acquisitions use the command: |
Line 26: | Line 25: |
mksubjdirs anon }}} This will create the directory anon, as well as the following subdirectories: {{{ /bem /label /morph /mpg /mri /rgb /scripts /surf /tiff /tmp }}} The mri_convert program is run from the directory holding the original scan in DICOM format, with the output placed in the subject's mri/orig directory. An anonymized volume has been provided for this tutorial with the recognizable face characteristics removed, in the directory buckner_data/tutorial_subjs/014-anon. The usage for mri_convert is: ''mri_convert <in volume> <out volume>'' where <in volume> is the first file that appears in each acquisition directory. mri_convert will determine the file types automatically, or it can be specified using the --in-type and --out-type options. For example, if your first acquisition is in directory 014-anon in DICOM format, and the first image is named 001.dcm, to convert the volume to mgz format, run the following commands: {{{ mri_convert 014-anon/001.dcm ${SUBJECTS_DIR}/anon/mri/orig/001.mgz }}} A second acquisition (assuming it is found in directory 015-anon) can be converted to mgz format using this command: {{{ mri_convert 015-anon/001.dcm ${SUBJECTS_DIR}/anon/mri/orig/002.mgz |
recon-all -i 014-anon/001.dcm -i 015-anon/001.dcm -s anon |
Line 70: | Line 46: |
The full path to the converted volume is specified with the -f option because a file is being specified explicitly. If tkmedit is called without the -f, it will assume that the data is in ${SUBJECTS_DIR}/<subject name>/mri, where <subject name> is the first argument on the tkmedit command line (anon in the example below). Once motion correction has been performed using 001.mgz and 002.mgz, and the volume ${SUBJECTS_DIR}/anon/mri/orig.mgz has been produced, tkmedit will be able to find that volume using the subject directory and the volume name: |
The full path to the converted volume is specified with the -f option because a file is being specified explicitly. If tkmedit is called without the -f, it will assume that the data is in ${SUBJECTS_DIR}/<subject name>/mri, where <subject name> is the first argument on the tkmedit command line (anon in the example below). You can motion correct your two acquisitions using the -motioncor option of recon-all like this: {{{ recon-all -motioncor -s anon }}} Once motion correction has been performed using 001.mgz and 002.mgz, the volume ${SUBJECTS_DIR}/anon/mri/orig.mgz has been produced, tkmedit will be able to find that volume using the subject directory and the volume name: |
[wiki:FsTutorial top] | [wiki:FsTutorial/MorphAndRecon previous]
Data Conversion
In this exercise, an image from a scanner, in DICOM format, will be converted into mgz format, using recon-all.
You first want to make sure you are working in the appropriate directory and that you have set your SUBJECTS_DIR variable correctly. You can do this by entering the following directory:
cd $FREESURFER_HOME/subjects/buckner_data/tutorial_subjs
Set the current directory to be the default subjects directory using this command:
setenv SUBJECTS_DIR ${PWD}
Two acquisitions of an anonymized volume have been provided for this tutorial with the recognizable face characteristics removed, in the directory buckner_data/tutorial_subjs/014-anon and buckner_data/tutorial_subjs/015-anon. Using the recon-all script you can specify both the acquisitions to be converted to mgz format as well as the name you wish to give your subject in the following format:
recon-all -i <in volume 1> -i <in volume 2> -s <subject name>
where <in volume 1> is the first file that appears in the first acquisition directory, and <in volume 2> is the first file that appears in the second acquisition directory. For this example we will use anon as our <subject name>. To convert the two anon acquisitions use the command:
recon-all -i 014-anon/001.dcm -i 015-anon/001.dcm -s anon
The output file list can be viewed with the following command:
ls ${SUBJECTS_DIR}/anon/mri/orig
which will show:
001.mgz 002.mgz
View the output of the data conversion with tkmedit:
tkmedit -f ${SUBJECTS_DIR}/anon/mri/orig/001.mgz
The full path to the converted volume is specified with the -f option because a file is being specified explicitly. If tkmedit is called without the -f, it will assume that the data is in ${SUBJECTS_DIR}/<subject name>/mri, where <subject name> is the first argument on the tkmedit command line (anon in the example below).
You can motion correct your two acquisitions using the -motioncor option of recon-all like this:
recon-all -motioncor -s anon
Once motion correction has been performed using 001.mgz and 002.mgz, the volume ${SUBJECTS_DIR}/anon/mri/orig.mgz has been produced, tkmedit will be able to find that volume using the subject directory and the volume name:
tkmedit anon orig.mgz