AD: File/Folder Setup and Preparation for Preprocessing

Once you have converted the raw data for all subjects, as outlined in the 'MP3 Conversion of Raw Data’ page, follow these instructions to organise your files and folders.

  1. Open a new ‘MATLAB’ window and type '2' into the command window.

  2. On the network drive, create a folder and name it to describe the type of analysis e.g. ‘Longitudinal_Analysis’.

  3. Within this folder create 2 sub-folders: ‘projects’ and 'stats'.

  4. Within the ‘projects’ folder create a ‘CONTROL’ folder.

  5. Within the ‘CONTROL’ folder create a folder for your individual subject e.g. ‘LM001_Day2_PostCCI’.

  6. Create a folder named ‘anatomical’ with a sub-folder named ‘coreg (native)’, a folder named ‘T2map' with a subfolder named ‘raw’, a folder named ‘DTI’ with a sub-folder named ‘raw’, a folder named ‘fMRI’ with the subfolders ‘rest01’, ‘stimulus01’ and ‘stimulus02' (etc. depending on how many functional scans were collected), with 'raw’ sub-folders in each of these fMRI subfolders.

  7. To save time, copy and paste the individual subject folder (in this example, the ‘LM001_Day2_PostCCI’ folder) for as many subjects you have i.e. if you have a total of 50 subjects, copy and paste the folder 50 times and then rename each folder with it’s subject’s name. This saves you from having to create all of these subfolders for each subject (would be very time consuming).

  8. Look through a few subjects’ DTI and fMRI images in your ‘Converted Data’ folder and confirm that they are not distorted. If your DTI and/or fMRI images are distorted see the ‘DTI Distortion Correction’ confluence page, before proceeding to the next step.

  9. Now copy in the necessary files from your ‘Converted data’ folder into each of the sub-folders as outlined in the table below:

Folder

Sub-folders

Files*

Folder

Sub-folders

Files*

'anatomical'

‘coreg (native)’

  • Copy in the T2map file (file size: approx. 86 000 KB) and rename this file ‘T2map’ e.g. ‘LM001_Day2_PostCCI_T2map’

  • Create a text document file named ‘movement parameters’

'T2map'

‘raw’

Leave empty for now. Refer to step 16.

'DTI'

‘raw’

  • Copy in the DWI file (file size: approx. 118 000 KB) and rename this file ‘DTI’ e.g. ‘LM001_Day2_PostCCI_DTI’

fMRI

‘rest01'

  • with a 'raw’ subfolder

‘stimulus01'

  • with a 'raw’ subfolder

‘stimulus02’

  • with a 'raw’ subfolder

  • Copy in the fMRI resting image into the ‘rest01’ folder (the first image with a file size of approx. 154 000 KB), fMRI first stimulation image (the second image with a file size of approx. 154 000 KB) into the ‘stimulus01’ folder and the fMRI second stimulation image (the third image with a file size of approx. 154 000 KB) into the ‘stimulus02’ folder

    • Rename these three files to indicate they are fMRI files e.g. ‘LM001_Day2_PostCCI_fMRI_resting’, ‘LM001_Day2_PostCCI_fMRI_1st_stimulation’, ‘LM001_Day2_PostCCI_fMRI_2nd_stimulation’.

*All of these files are 4D nifti images which need to be converted into 3D nifti images. Once you have copied a file into the right folder and renamed it, in the CSPM GUI, click Image → '4D nifti to 3D', paste in the file path and select the 4D nifti file. This will create 13 3D images for the T2map, 82 3D images for the DTI and 136 3D images for the fMRI. Do this 4D to 3D conversion as you go.

  1. Open the first subject’s folder and then click into the ‘anatomical’ folder and the ‘coreg (native)' sub-folder. In the SPM12 GUI, click the ‘Display’ button, paste in this file path and select the first T2map image i.e. the one ending in ‘0000’. It will look something like this:

Screenshot 2024-05-20 170755.jpg
  1. Click the ‘Origin’ button.

  2. You will need to play around with the ‘pitch’, ‘roll', and ‘yaw’ values (trial and error) until the image is realigned and the coronal slice appears in the top left corner, the sagittal on the right and the axial under the coronal, like so:

Screenshot 2024-05-20 172252.jpg
  1. Move the crosshairs to the anterior commissure (just by clicking on the anterior commissure):

  1. Write down the pitch, roll, yaw and crosshair position values the text document file named ‘movement parameters’ in the ‘coreg (native)' subfolder of the subject’s anatomical folder.

  2. In the Display window, click ‘Set Origin’, then click ‘Reorient’ and select all 13 T2map images to have the same movement parameters applied to these images. Now all 13 3D T2map images are realigned i.e. “coregistered”.

  3. Copy and paste the 13 realigned T2map images from the anatomical folder to that subject’s T2 map folder and then delete all but the first T2map image (i.e. the image ending in ‘0000’) from the ‘native (coreg)’ folder.

  4. Repeat steps 9-16 for each subject.

  5. Once all of the T2maps have been realigned i.e. “coregistered” for each subject, go to the CSPM window → Utilities → T2maps from Bruker.

  6. Paste in the folder path of your method file in the box next to ‘File or Folder’, then paste in the path of your ‘CONTROL’ folder in the box below and in the ‘Folder with nifti files’ box. Make sure to select the ‘Subfolders’ box so that it can process all subjects' T2maps in one go.

  1. Click through the buttons of the GUI in the following order: ‘Load T2’, ‘Apply T2 to Nifti’, ‘Apply and Create T2maps’.

  2. Open the T2 relaxation image that was created for each subject. It should look like this:

Move your cursor around the image and check that the relaxation value (the value highlighted in the screenshot) is below 100 throughout (excluding values near the edges of the brain or near CSF).

  1. Add ‘T2map’ to the end of the name of the newly created relaxation image and move the relaxation image from the ‘T2map' folder to the ‘raw’ sub-folder within the 'T2map’ folder.

  2. Delete all files in the ‘raw’ folder except for the ‘0000’ T2map image and the newly created T2map relaxation image.

  3. Now for the DTI images, in CSPM, click ‘DTI’ → DTI Info (Bruker- alpha). Paste in the folder path of your method file in the box next to ‘File or Folder’, paste in the path of your ‘CONTROL’ folder in the box below and in the ‘Folder with nifti files’ box. Tick the ‘Rodent’ box and again, make sure to select the ‘Subfolders’ box so that it can process all subjects' DTI images in one go.

  1. Click on the ‘Apply DTI to Nifti’ button and then on the ‘Run DTI Processing’ button. ‘Apply DTI to Nifti’ will create a MATLAB file for each of the 82 3D nifti DTI images, and ‘Run DTI Processing’ will create a mean image and a standard deviation image, a few text files. a ‘b0_images’ folder and a ‘tensors’ folder, in the ‘raw' folder (will take a while to run ~ days).

  2. You are now ready to perform preprocessing using the ‘Preclinical’ GUI as outlined in the next confluence page: ‘Preclinical Preprocessing’.