|
Size: 2339
Comment:
|
Size: 5153
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
| ["findsession patientname"] | {{{ findsession patientname }}} |
| Line 8: | Line 10: |
| This will give you a list of all matching data sets, including paths to where each one can be found. Eg, | This will give you a list of all matching data sets, including paths to where each one can be found. E.g., |
| Line 10: | Line 12: |
| /space/chartres/6/siemens/TRIO-20501-20020416-124756-468000 | /cluster/archive/296/siemens/TrioTim-35162-20111116-174401-767001 All the runs/series for your subject's visit will be in this directory. You can do more elaborate searches with findsession. To get more info, run findsession with -help. |
| Line 14: | Line 18: |
| Unpacking is the processes through which you convert the data from DICOM format (which is not very useful) to a format that can be used by an analysis programe (eg, bhdr, nifti, analyze, mgh, mgz). The program that does this is unpacksdcmdir (this is only used to unpack Siemens DICOM files). mri_convert can also be used to convert individual runs. | Unpacking is the process through which you convert the data from DICOM format (which is not very useful) to a format that can be used by an analysis program (e.g., bhdr, nifti, analyze, mgh, mgz). The program that does this is [[dcmunpack]] (this is only used to unpack Siemens DICOM files). mri_convert can also be used to convert individual runs, whereas dcmunpack can be used to unpack any or all data from a directory. Below we go through some simple unpacking. dcmunpack can do a lot more. Run it with -help to get full documentation. |
| Line 16: | Line 20: |
| Ask it to start, and you will find that instead it will tell you the path for unpacking. | The first step in unpacking is to decide where you want your data to be stored. Usually, you choose a "parent" directory under which all of the visits for a study will be stored. E.g., /space/data/1/users/you/data-parent. The actual target data for a given visit from a subject would be stored under something like /space/data/1/users/you/data-parent/yoursubject. |
| Line 18: | Line 22: |
| ["unpacksdcmdir"] -src <source> -targ <target> -scanonly file | Next, you need to find out exactly what data are in the dicom directory. Specificially you need to know which run/series number corresponds to which acquisition. To do this run: |
| Line 20: | Line 24: |
| NOTE: you must be in the targ dir for that command to work. This outputs the type of scans used. Now use a file at $FREESURFER_HOME/numaris4-protocols.unpackcfg |
{{{ dcmunpack -src dicomdir -targ targetdir -scanonly targetdir/scan.info -index-out dcm.index.dat }}} |
| Line 24: | Line 28: |
| to correctly make a config file. If you cannot find the file, check here [http://www.nmr.mgh.harvard.edu/~daniel/links/how/numaris4-protocols.unpackcfg] |
where dicomdir is the directory where the dicom data reside (as found above by findsession), targetdir is where you want the individual's data to go. The dcm.index.dat file will contain a list of files; this not necessary, but it can be used as below to make the unpacking go faster. and the scan.info file will contain a list of run/series numbers along with the scanning protocol that was used to acquire the data, and will look something like this: |
| Line 27: | Line 30: |
| The format is: num folder format fileprefix Here is an example config file. ||1 scout bshort f|| ||3 bold bshort f|| ||4 bold bshort f|| ||5 bold bshort f|| ||6 bold bshort f|| ||7 bold bshort f|| ||8 bold bshort f|| The number is acquisition number. The folder is where that acquisition is stored (bold directory, scout directory etc) The format is the form of the data files. The fileprefix is how the filenames start. |
{{{ 1 circle_localizer ok 256 256 3 1 74407231 2 ge_functionals ok 64 64 10 146 74407258 3 ge_functionals ok 64 64 10 146 74406408 4 ge_functionals ok 64 64 10 146 74405551 5 ge_functionals ok 64 64 10 146 74401663 6 ge_functionals ok 64 64 25 3 74400790 7 ep2d_T1w ok 64 64 10 1 74400835 8 tfl3d1_ns T1_MPRAGE_sag ok 256 256 128 1 74401012 9 tfl3d1_ns T1_MPRAGE_sag ok 256 256 128 1 74402212 }}} |
| Line 42: | Line 42: |
| == Next run it again with your config file. == ["unpacksdcmdir"] -src <source> -targ <target> -cfg<configfile> -fsfast |
To actually do the unpacking, you will need to run dcmunpack again with a slightly different set of arguments: |
| Line 45: | Line 44: |
| == If it is .ima format data... == Note: I have come across old data which was *.ima format. This can be unpacked using ["unpackimadir2"] which works just like unpacksdcmdir. |
{{{ dcmunpack -src dicomdir -index-in dcm.index.dat -targ targetdir -fsfast \ -run 2 bold nii f.nii \ -run 3 bold nii f.nii \ -run 4 bold nii f.nii \ -run 5 bold nii f.nii \ -run 6 bold nii f.nii \ -run 8 3danat mgz 001.mgz \ -run 9 3danat mgz 001.mgz }}} |
| Line 50: | Line 55: |
| == Check for TR bug == *** There is always a problem after unpacking that the TR is not set correctly. Please fix it. pico $SUBJECTS_DIR/$SUBJECT/bold/seq.info |
The -fsfast argument tells dcmunpack to use the FS-FAST directory structure (if you want to specify a structure explicitly, use -generic). Each -run flag is followed by 4 arguments: (1) the run number (as found in the scan.info file), (2) a directory, (3) format, and (4) file name. In fsfast directory structure, run 2 will be stored in targetdir/bold/002 in nifti (nii) format. nifti format will have a file name "f.nii" (i.e., the file name given as the 4th argument). Each of the fMRI runs (2-6) will be stored under the "bold" directory (this is also known as the "functional subdirectory" or fsd). '''Subsequent fsfast commands will expect this directory structure.''' Also, there will be a seq.info file in the bold directory with information about the acquisition. If you collected several types of fMRI scans (eg, different slice prescriptsion, TR, TE, resolution, etc), then you should put each type in a separate fsd (e.g., -run 7 bold-hires nii f). |
| Line 54: | Line 57: |
| == Copy the 3danat == Goto the 3danat/ dir |
Note that run 7 was not unpacked. Note also that the backslashes ("\") are unix command-line continuation characters and not part of the dcmunpack arguments list. Runs 8 and 9 are anatomicals which can be used in FreeSurfer processing; they will be stored in targetdir/3danat/008/001.mgz and 009/001.mgz (this is compressed mgh format). You can launch FreeSurfer on these volumes with: |
| Line 57: | Line 59: |
| cd $SUBJECTS_DIR/$SUBJECT/ | {{{ recon-all -s yoursubjectname -i targetdir/3danat/008/001.mgz -i targetdir/3danat/009/001.mgz -all }}} |
| Line 59: | Line 63: |
| Copy contents to mri/orig. For example... | where "yoursubjectname" is the FreeSurfer name for the subject as found in $SUBJECTS_DIR. Alternatively, you can create yoursubjname/mri/orig and then copy or link the mgz files into that directory as 001.mgz and 002.mgz and then launch recon-all. If you choose to do this, you do not have to pass -i in your command. This will be sufficient: |
| Line 61: | Line 65: |
| cp 3danat/* mri/orig | {{{ recon-all -s yoursubjectname -all }}} For information on Reconstruction Work Flow, click [[RecommendedReconstruction|here]] |
Unpack the data from bourget:
Find your subject...
To find your data, run the findsession command, passing it the "patient name", which is the name that you registered the subject under when scanning:
findsession patientname
This will give you a list of all matching data sets, including paths to where each one can be found. E.g.,
/cluster/archive/296/siemens/TrioTim-35162-20111116-174401-767001
All the runs/series for your subject's visit will be in this directory. You can do more elaborate searches with findsession. To get more info, run findsession with -help.
Unpack the data
Unpacking is the process through which you convert the data from DICOM format (which is not very useful) to a format that can be used by an analysis program (e.g., bhdr, nifti, analyze, mgh, mgz). The program that does this is dcmunpack (this is only used to unpack Siemens DICOM files). mri_convert can also be used to convert individual runs, whereas dcmunpack can be used to unpack any or all data from a directory. Below we go through some simple unpacking. dcmunpack can do a lot more. Run it with -help to get full documentation.
The first step in unpacking is to decide where you want your data to be stored. Usually, you choose a "parent" directory under which all of the visits for a study will be stored. E.g., /space/data/1/users/you/data-parent. The actual target data for a given visit from a subject would be stored under something like /space/data/1/users/you/data-parent/yoursubject.
Next, you need to find out exactly what data are in the dicom directory. Specificially you need to know which run/series number corresponds to which acquisition. To do this run:
dcmunpack -src dicomdir -targ targetdir -scanonly targetdir/scan.info -index-out dcm.index.dat
where dicomdir is the directory where the dicom data reside (as found above by findsession), targetdir is where you want the individual's data to go. The dcm.index.dat file will contain a list of files; this not necessary, but it can be used as below to make the unpacking go faster. and the scan.info file will contain a list of run/series numbers along with the scanning protocol that was used to acquire the data, and will look something like this:
1 circle_localizer ok 256 256 3 1 74407231 2 ge_functionals ok 64 64 10 146 74407258 3 ge_functionals ok 64 64 10 146 74406408 4 ge_functionals ok 64 64 10 146 74405551 5 ge_functionals ok 64 64 10 146 74401663 6 ge_functionals ok 64 64 25 3 74400790 7 ep2d_T1w ok 64 64 10 1 74400835 8 tfl3d1_ns T1_MPRAGE_sag ok 256 256 128 1 74401012 9 tfl3d1_ns T1_MPRAGE_sag ok 256 256 128 1 74402212
To actually do the unpacking, you will need to run dcmunpack again with a slightly different set of arguments:
dcmunpack -src dicomdir -index-in dcm.index.dat -targ targetdir -fsfast \ -run 2 bold nii f.nii \ -run 3 bold nii f.nii \ -run 4 bold nii f.nii \ -run 5 bold nii f.nii \ -run 6 bold nii f.nii \ -run 8 3danat mgz 001.mgz \ -run 9 3danat mgz 001.mgz
The -fsfast argument tells dcmunpack to use the FS-FAST directory structure (if you want to specify a structure explicitly, use -generic). Each -run flag is followed by 4 arguments: (1) the run number (as found in the scan.info file), (2) a directory, (3) format, and (4) file name. In fsfast directory structure, run 2 will be stored in targetdir/bold/002 in nifti (nii) format. nifti format will have a file name "f.nii" (i.e., the file name given as the 4th argument). Each of the fMRI runs (2-6) will be stored under the "bold" directory (this is also known as the "functional subdirectory" or fsd). Subsequent fsfast commands will expect this directory structure. Also, there will be a seq.info file in the bold directory with information about the acquisition. If you collected several types of fMRI scans (eg, different slice prescriptsion, TR, TE, resolution, etc), then you should put each type in a separate fsd (e.g., -run 7 bold-hires nii f).
Note that run 7 was not unpacked. Note also that the backslashes ("\") are unix command-line continuation characters and not part of the dcmunpack arguments list. Runs 8 and 9 are anatomicals which can be used in FreeSurfer processing; they will be stored in targetdir/3danat/008/001.mgz and 009/001.mgz (this is compressed mgh format). You can launch FreeSurfer on these volumes with:
recon-all -s yoursubjectname -i targetdir/3danat/008/001.mgz -i targetdir/3danat/009/001.mgz -all
where "yoursubjectname" is the FreeSurfer name for the subject as found in $SUBJECTS_DIR. Alternatively, you can create yoursubjname/mri/orig and then copy or link the mgz files into that directory as 001.mgz and 002.mgz and then launch recon-all. If you choose to do this, you do not have to pass -i in your command. This will be sufficient:
recon-all -s yoursubjectname -all
For information on Reconstruction Work Flow, click here
