====== Standard Prep-Script and Its Components ====== After you have followed the directions for downloading and renaming the raw data from the CD(s) as found on the [[public:downloading_data_from_cd_to_cfn_cluster_and_renaming|downloading data]] page the following steps will help you to pre-process the data so that that data will be able to be viewed, verified for validity, and processed with a General Linear Model (GLM). A sample/general script can be found at /jet/aguirre/Scripts/prep_Human_Raw.vbp You may also view the sample script by clicking FIXME [[http://example.com|here]]. Below, we will demonstrate how to modify this script for use with your raw data and cover them line-by-line. ===== Beginning ===== **Most modifications will be done here** **//All occurances of "MyStudyName" should be replaced with the subject's study code, (subject's first initial + month + day + year + subject's last initial), e.g. X000000X//** **__If the scan names following "FirstLoc=", "MPRAGE1=", "RawEPI", and "raw=" are not exact the script will result in MANY errors. Double check these modifications before submitting the script for processing__** **LN1** SEQUENCENAME RawPrep_[//Subject study code, e.g. X000000X//] **LN2** DIR [//full path to the directory containing your raw data beginning with /jet/aguirre/'study code'///] **LN4** PRIORITY [//a number 1 - 4 determining the priority of processing of the script, generally 2, 1 if able to wait and be processed overnight//] **LN6** globals FirstLoc=[//number preceding "_localizer"//]_localizer **LN7** globals MPRAGE=[//number preceding "_t1"//]_t1_mpr_AX_MPRAGE * If you have more than 1 MPRage - duplicate this line for each additional scan - make the names MPRage1, MPRage2,... **LN8** globals RawEPI=[//full title of the single EPI scan, normally includes number + "_ep2d_pace"//] **LN10** FILE scan=[//subject code + "_" + scan number, e.g. "X000000X_01"//] raw=[//full title of the scan that includes "ep2d" and the number of TRs, e.g. "0100_ep2d_max_pace_160acq" shown after typing "ls" following the Renaming step of [[public:downloading_data_from_cd_to_cfn_cluster_and_renaming|downloading data]]//] **LNS11-15** __same as LN10 except this is modified for scans #2-6__ * Duplicate the above lines if there are more than 6 BOLD scans and be **sure** to adjust the scan number (studyname_#) * If fewer than 6 BOLD scans were acquired, use the "#" symbol at the beginning of the line to "comment out" any lines that are extraneous and they will not be used during the processing of the script. ===== Settings ===== **LN22** - no modification necessary **LN23** globals thresh= [value to threshold fMRI data, generally 200] **LN24** globals xa= [x value for the anatomical scan, generally 1] **LN25** globals ya= [y value for the anatomical scan, generally 1] **LN26** globals za= [z value for the anatomical scan, generally 1] * LNS 24-26 indicate that the anatomical scan is made up of 1mm3 voxels **LN27** globals xf= [x value for the functional scans, generally 3] **LN28** globals yf= [y value for the functional scans, generally 3] **LN29** globals zf= [z value for the functional scans, generally 3] * LNS 27-29 indicate that the functional scans are made up of 3mm3 voxels **LNS31-34** - Do NOT modify, these are globals specified for use throughout the rest of the script **LN36** "bb_anat= :!: **LN37** "bb_func= :!: **LN38** "bb_disp= :!: ===== Reset any previous analysis ===== This section converts the entire subject folder back to it's state prior to any script processing (a.k.a. the state directly after completing the [[public:downloading_data_from_cd_to_cfn_cluster_and_renaming]]. Place the "#" sign before lines that are irrelevant to the data. For example, LNs 50 & 51 should appear as: #runonce shellcommand "mv DTI/00* ./" #runonce shellcommand "rm -rf DTI" if no DTI scans were completed as part of the scan protocol. ===== Prep anatomy ===== ** There should __NOT__ be __ANY__ modifications to this section** **LNs 62 &63** are commented out since there are not currently any motion correction images being collected. However, they have been collected in the past. Therefore, these shellcommands remain in the scripts, but are currently 'commented out', in case they are needed in the future. This section: - Makes the Anatomy directory - Makes the Models directory - Converts the single EPI scan to a Functional.cub image by way of a functional.tes image, then removes the functional.tes - Converts the MPRage to an Anatomical.cub image - Moves the raw MPRage, localizer, and single EPI to the Anatomy/raw directory ===== Align origins of functional and anatomical data ===== **LN79** Aligns the origin of the anatomical.cub with the functional.cub **LN80** Aligns the origin of the functional.cub with the anatomical.cub * The combination of these two commands guarantee that the two scans are exactly aligned **LN81** :!: ===== Perform normalization of anatomicals ===== ===== Perform noise reduction, skull-stripping and inhomogeneity correction with FSL tools ===== ===== Make the data directory, raw subdirectory, tes file from the raw, move the raw Siemens data to the raw subdirectory===== ** There should __NOT__ be __ANY__ modifications to this section** These commands are run for each scan defined as a "FILE scan" in the beginning section. **LN125** Makes the scan directory **LN126** Makes the scan/raw directory **LN127** Converts the raw scan images to a .tes file **LN128** Moves the raw data to the scan/raw directory ===== Process the tes file ===== ===== Create the average power spectrum and one-over-f file ===== ===== Other useful scripts ===== A general script used for averaging several MPRages * /jet/aguirre/Scripts/prep_Human_MPRAGEs.vbp A general script used to prep canine raw fMRI data * /jet/aguirre/Scripts/prep_Dog_RawData.vbp Scripts used to prep fMRI, DTI, and Perfusion data :!: Make general scripts soon to be added to /jet/aguirre/Scripts * Stock_CMP_Prep_new.vbp * V061908W.vbp ====== Questions/Concerns ====== If you have questions or concerns about the information found here or difficulty trouble-shooting a prep-script, please contact the author of this page, [[thomasam@mail.med.upenn.edu|Amy Thomas]], or another member of the Aguirre Lab.