Differences between revisions 2 and 3
Deletions are marked like this. Additions are marked like this.
Line 48: Line 48:
Type your best guess at the correct command and corresponding flags into the terminal window and see if it works. Type your best guess at the correct command and corresponding flags into the terminal window and see if it works. If it's not working and you give up, scroll down past the arrows to see the correct command setup.

><<BR>>
><<BR>>
><<BR>>
><<BR>>
><<BR>>
><<BR>>>
><<BR>>
><<BR>>
><<BR>>
><<BR>>
><<BR>>
><<BR>>

{{{
unpacksdcmdir -src . -targ . -scanonly scan.log
}}}

'''Some explanation on the command:'''<<BR>>
 * {{{-src .}}} indicates which directory to source (you want it to be the one where the dicoms are located). The period indicates to use the directory you are currently located in. Instead of using the period, you could specify the full path to the dicom directory.
 * {{{-targ .}}} indicates the target destination for the text file. Again, you could specify a path to a location instead of using the current directory.
 * {{{-scanonly scan.log}}} says to only scan the directory and create a text file with a list of scans. We decided to call this scan.log but you can name it anything you want.

Back to list of all tutorials

Back to course page

Practice Working with Data

In this exercise, you will take what you've learned from the course & tutorials so far and apply it to a new dataset.


Preparations

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

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


Finding the correct input for the FreeSurfer pipeline

Let's pretend that you just finished scanning a research subject. You collected several different kinds of scans. You would like to get reconstructed surfaces off of this data. What do you do first?

Presumably, you have copied the dicoms for this subject off the scanner to somewhere else. Running the unpacksdcmdir command on the directory in which the dicoms are located creates a text file showing the name of the scan (as you named it on the scanner) and the dicom series it corresponds with. From there, you can identify the T1-weighted image you want to use as input to FreeSurfer.

For the purposes of this tutorial, we have a directory of dicoms for you to work with here:

/path/to/dicoms

Open a terminal window. It will be easiest to 'cd' into the directory above to work with the dataset.

Now, run the help flag to learn how to set up the unpacksdcmdir command to create the text file mentioned above:

unpacksdcmdir --help

Type your best guess at the correct command and corresponding flags into the terminal window and see if it works. If it's not working and you give up, scroll down past the arrows to see the correct command setup.

>
>
>
>
>
>
> >
>
>
>
>
>

unpacksdcmdir -src . -targ . -scanonly scan.log

Some explanation on the command:

  • -src . indicates which directory to source (you want it to be the one where the dicoms are located). The period indicates to use the directory you are currently located in. Instead of using the period, you could specify the full path to the dicom directory.

  • -targ . indicates the target destination for the text file. Again, you could specify a path to a location instead of using the current directory.

  • -scanonly scan.log says to only scan the directory and create a text file with a list of scans. We decided to call this scan.log but you can name it anything you want.

FsTutorial/PracticeV6.0 (last edited 2022-08-26 10:32:49 by DevaniCordero)