Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 36: Line 36:
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: 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:
Line 40: Line 40:
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: 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:
Line 46: Line 46:
A second acquisition can be converted to mgz format using this command: A second acquisition (assuming it is found in directory 015-anon) can be converted to mgz format using this command:

[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 mri_convert, and placed in the correct directory as created by mksubjdirs.

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}

Run the mksubjdirs command to create the standard FreeSurfer directory structure for your subject. The usage for mksubjdirs is:

mksubjdirs <subject name>

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

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

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). 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:

tkmedit anon orig.mgz

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