tcsh
source .cshrc
- Download the dicom folder to your drive from the subject folder located on the server. (EX. home/fhlin/lin2/fhlin/eegmri_wm/subjects/s004/mri/orig/dicom). If you have not already, install XQuartz to prevent an error with reading the dicom files (Ex. ERROR: reading ../dicom/EEGFMRI_WM_S004.MR.RESEARCH_FHLIN.0037.0001.2023.02.24.17.53.54.227018.233311136.IMA tag 28 30)
- Add the dicom folder to your subjects orig folder, you should have the following folder path for your subject
mri_info
checks if all freesurfer items are theresetenv SUBJECTS_DIR $PWD
setenv SUBJECTS_DIR /Users/jessica/data_analysis/seeg/subjects
set your subject directoryecho $SUBJECTS_DIR
sees what path your subjects are incd /Users/jessica/data_analysis/seeg/subjects/s004/mri/orig
get into right directory in orig foldermkdir unpack
creates empty folder called unpack (in orig folder)cd unpack/
vi unpack.rule
makes a file called unpack.rule, enter "37 3danat COR blah" (number changes based on dicom scan, in this case is it 37)unpacksdcmdir -src ../dicom -targ . -scanonly ./info
output should be "Done scanning"mri_convert -all-info
unpacksdcmdir -src ../dicom -targ . -cfg ./unpack.rule
make sure you are in the unpack folder (this step may take some time)cd ../
make sure you are in orig file for next step (going back one folder)mri_convert unpack/3danat/037/COR-.info ./001.mgz
this step converts COR files into a 001.mgz file in the orig folder (number changes based on dicom scan, in this case is it 37. Leading zeros should not be added in the unpack.rule, EX. if dicom number is 0037, only put 37)cd /Users/jessica/data_analysis/seeg/subjects/s004
make sure you are in the subjects folderrecon-all -subjid s004 -all
change based on subject ID, this step will take about 10 hours to complete the whole processing- If done successfully, you should have the following folder path for your subject
- Go to Mango and open the dicom folder of your subject
- File save as .nii.gz file into your orig folder
mri_convert EEGFMRI_WM_S004.nii.gz 001.mgz
in orig file, converts file to 001.mgzcd ../
make sure in orig file for next step (going back one folder)mri_convert unpack/3danat/037/COR-.info ./001.mgz
after this step there should be a 001.mgz in the orig folderrecon-all -subjid s004 -all
change based on subject ID
mri_convert ../dicom/EEGFMRI_WM_S004.MR.RESEARCH_FHLIN.0037.0001.2023.02.24.17.53.54.227018.233311136.IMA -ot COR -o c
converts file (which can be copied from error message in setp 17) to ‘c’cd c
ls
to check if all COR files are therecd ..
to go back to unpack foldermv c 037
to rename folderls
to check if folder named 037 is in unpack foldermkdir 3danat
makes foldermv 037 3danat/
ls
to see if 3danat folder is theremri_convert 3danat/037/COR-.info 001.mgz
ls
to see if 001.mgz file is therecd ../
make sure in orig file for next step (going back one folder)mri_convert unpack/3danat/037/COR-.info ./001.mgz
after this step there should be a 001.mgz in the orig folderrecon-all -subjid s004 -all
change based on subject ID