Differences between revisions 1 and 8 (spanning 7 versions)
Revision 1 as of 2005-09-06 22:22:15
Size: 3079
Editor: anonymous
Comment: missing edit-log entry for this revision
Revision 8 as of 2015-09-29 13:40:14
Size: 2719
Editor: LeeTirrell
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[wiki:Self:FsTutorial top] | [wiki:Self:FsTutorial/MorphAndRecon previous] [[FsTutorial|top]] | [[FsTutorial/MorphAndRecon|previous]]

 *To follow this exercise exactly be sure you've downloaded the [[FsTutorial/Data|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.
Line 5: Line 8:
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 10: Line 13:
cd $FREESURFER_HOME/subjects/buckner_data/tutorial_subjs cd $TUTORIAL_DATA/buckner_data/tutorial_subjs
Line 16: Line 19:
setenv SUBJECTS_DIR ${PWD} export SUBJECTS_DIR=$PWD
Line 19: Line 22:
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 24:
''mksubjdirs <subject name>'' ''recon-all -all -i <in volume 1> -i <in volume 2> -s <subject name>''
Line 23: Line 26:
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 28:
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 FS!TutorialDataSet/conversion_tutorial/deface. 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 deface/01 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 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 49:
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:

top | previous

  • 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.

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 $TUTORIAL_DATA/buckner_data/tutorial_subjs

Set the current directory to be the default subjects directory using this command:

export 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 -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

FsTutorial/Conversion (last edited 2015-09-29 13:40:14 by LeeTirrell)