This is an old revision of the document!
Hardware & Software setup
Main analysis
<2014.11.8>
Created git repo in main directory. Plan is for this to track only matlab and documentation files in this directory; no data files, no subdirectories.
anthony@uniqua:/data/anthony/HolesFMRI/mri$ git init Initialized empty Git repository in /data/anthony/HolesFMRI/mri/.git/ anthony@uniqua:/data/anthony/HolesFMRI/mri$ git add *.m anthony@uniqua:/data/anthony/HolesFMRI/mri$ git commit -m "First commit." anthony@uniqua:/data/anthony/HolesFMRI/mri$ git ls-files L2_subs_spec.m L2_subs_spec_job.m Preprocess_BatchRunner_HolesFMRI.m Preprocess_BatchRunner_acCOPY.m Preprocess_BatchRunner_colpref.m Preprocess_Batch_HolesFMRI.m Preprocess_SubInfo_Setup_HolesFMRI.m vnCoreg_HolesFMRI.m vnNorm_HolesFMRI.m vnRealign_HolesFMRI.m vnSmooth_HolesFMRI.m
Which subjects did final version of study
Looks like H4 on:
anthony@uniqua:/data/anthony/HolesFMRI/mri$ ls -ltr | grep "H[0-9]" drwxr-xr-x 4 anthony anthony 4096 May 7 2014 CateLab_024_H1 drwxr-xr-x 10 anthony anthony 4096 May 8 2014 CateLab_021_H2 drwxr-xr-x 11 anthony anthony 4096 May 9 2014 CateLab_016_H3 drwxr-xr-x 6 anthony anthony 4096 May 30 16:14 CateLab_017_H4 drwxr-xr-x 5 anthony anthony 4096 Jun 1 11:58 CateLab_036_H8 drwxr-xr-x 5 anthony anthony 4096 Jun 1 13:29 CateLab_032_H7 drwxr-xr-x 5 anthony anthony 4096 Jul 16 11:47 CateLab_029_H6 drwxr-xr-x 4 anthony anthony 4096 Jul 17 15:03 CateLab_045_H17 drwxr-xr-x 4 anthony anthony 4096 Jul 18 12:04 CateLab_047_H19 drwxr-xr-x 4 anthony anthony 4096 Jul 18 16:17 CateLab_026_H16 drwxr-xr-x 4 anthony anthony 4096 Jul 18 22:23 CateLab_011_H18 drwxr-xr-x 4 anthony anthony 4096 Aug 4 22:03 CateLab_045_H15 drwxr-xr-x 5 anthony anthony 4096 Nov 8 10:36 CateLab_024_H5
Pilot study was done by 2014.5.15, according to wiki notes.
Also:
anthony@uniqua:/data/anthony/HolesFMRI/mri$ find -type d -name dcm | sort ./CateLab_011_H18/dcm ./CateLab_017_H4/dcm ./CateLab_024_H5/dcm ./CateLab_026_H16/dcm ./CateLab_029_H6/dcm ./CateLab_032_H7/dcm ./CateLab_036_H8/dcm ./CateLab_045_H15/dcm ./CateLab_045_H17/dcm ./CateLab_047_H19/dcm
I'm pretty sure that the two *045* files are due to misnaming one subject; see paper notes from scanner.
For now, try running all non-045 and non-H4 subjects through Preproc_Batch script. That is:
anthony@uniqua:/data/anthony/HolesFMRI/mri$ find -type d -name dcm | sort | grep -v 045 ./CateLab_011_H18/dcm ./CateLab_017_H4/dcm ./CateLab_024_H5/dcm ./CateLab_026_H16/dcm ./CateLab_029_H6/dcm ./CateLab_032_H7/dcm ./CateLab_036_H8/dcm ./CateLab_047_H19/dcm
anthony@uniqua:/data/anthony/HolesFMRI/mri$ find -type d -name L1 | sort ./CateLab_016_H3/L1 ./CateLab_017_H4/L1 ./CateLab_021_H2/L1
Subjects who have an L1 dir. have been functionally processed, and so have had preprocessing.
Pilot study analysis notes
<2014.5.7>
Current version of SPM T1 template (/usr/local/spm/templates/T1.nii) is tilted – I don't know how it got this way.
Searched web to find out how to download the file from SPM. SPM website not helpful, as predicted. But figured out that this template is the ICBM 152 linear template. Read this on:
http://imaging.mrc-cbu.cam.ac.uk/imaging/Templates
So searched and found website for download:
http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152Lin
NOTE: there exist other versions of the ICBM 152 template, including a non-linear one, but wanted to stick with what SPM includes.
Today ADC has been using the copy of the downloaded template straight from the uniqua /home/anthony/Downloads folder:
icbm_avg_152_t1_tal_lin.nii
On uniqua, takes about 1.5 h to do SPM coregistration for 4 runs (656 files). Took less than 5 min for realignment.
<2014.5.21>
Downloaded and started preprocessing of first post-pilot subject (CateLab_017_H4).
Made new directory:
/data/anthony/HolesFMRI/mri/
Moved all previous (pilot study) data and files to there.
Untarred the .tar.bz2 files in there.
Notes on CateLab_017_H4
This participant didn't have anatomical scans done during SR's PartsyScan study. We ran two mprage scans in this (H4) session.
Made directory new directory:
/data/anthony/HolesFMRI/mri/[SubjectID]/dcm/
Converted DICOMS to nifti format:
anthony@uniqua:~/data/HolesFMRI/mri/CateLab_017_H4/dcm$ dcm2nii ./*
This found and converted all files in all subdirectories.
Made copies of the dcm/ subdirs in a new dir called nii/, using this command:
anthony@uniqua:~/data/HolesFMRI/mri/CateLab_017_H4/dcm$ find ./* -type d -exec mkdir ../nii/{} \;
Moved all the .nii files from the dcm/ dir to the nii/ dir, using this nifty one-line script:
anthony@uniqua:~/data/HolesFMRI/mri/CateLab_017_H4/dcm$ for d in `find ./* -type d`; do mv $d/*nii ../nii/$d; done
See this page for examples for bash (the command line language) “for” loop syntax. The semicolons in the line above indicate “end of line” – they provide a way to squeeze multiple lines of code into one line.
PROBLEM: this trick didn't work for the directories that contain the anatomical files, because the scanner protocol (which becomes part of the directory name) includes square brackets, which linux doesn't allow to be used in file/directory names. Here's the error I got telling me that the move command had failed for these directories:
mv: cannot stat `./006-mprage_[Davis]/*nii': No such file or directory
If you try to list this directory (or do anything with it on the command line), you'll need to “escape” the square bracket character by putting a backslash in front of each instance. For example, here's how the command line auto-completes the directory name when I start typing the first few characters and then hit the Tab key:
ls 006-mprage_\[Davis\]/
I think I'll change the name of these directories, and in the future I want to change the name of the scanner protocol to “mprage_Davis”
I moved the .nii files from those two directories “by hand” – by typing the commands for one directory at a time.
Back to notes about the dcm2nii conversion. I didn't use the option that puts the scanner protocol name in the file name, or the time. So my .nii file names are short, e.g. s003a001_001.nii. I'm going to modify SR's scripts in my copies of her files, starting with:
CateLab_017_H4_Realign_job.m
anthony@uniqua:~/data/HolesFMRI/mri/CateLab_017_H4$ ll total 24 drwxr-xr-x 4 anthony anthony 4096 May 21 21:43 ./ drwxrwxr-x 9 anthony anthony 4096 May 21 20:45 ../ -rw-r--r-- 1 root root 3104 May 21 20:49 CateLab_017_H4_Realign_job.m
(NOTE: the *job.m file belongs to the user “root” because it was created in the Matlab editor while Matlab was being run as root, using the sudo command.)
Also made and run CateLab_017_H4_Coreg_job.m
<2014.5.25>
Appears that the coregistered files overwrote the realigned files. Contents of the functional dirs include only the orig. nii files (e.g. s002*nii) and a version starting with one “r” e.g. rs002*.nii. The latter are very large, as the coregistered files should be: 105MB each.
NOTE: Looking at *coreg_job.m script, my mistake was listing the original .nii files as inputs, NOT the realigned files. So the current rs002*nii (105MB size) files are NOT realigned. Will need to redo BOTH realignment and coregistration, after fixing *coreg_job.m
Do this the correct way, by making the *job.m files function files first.
Copied SR's Preprocess_Batchrunner.m to Preprocess_Batchrunner_acCOPY.m and *HolesFMRI.m. Used the last to do the realignment and coregistration.
Started running the script about 12:50pm 2014.5.25.
<2014.5.27>
Looks like that finished properly.
Copied SR's CateLab_039_PS20_Norm_job.m script to CateLab_017_H4_Norm_job.m
Copied SR's CateLab_039_PS20_Smooth_job.m script to CateLab_017_H4_Smooth_job.m
Modified them appropriately, ran them using Preprocess_BatchRunner_HolesFMRI.m in the /data/anthony/HolesFMRI/mri/ directory.
Had error in code that adds the T1 anatomical file to the beginning of the list of files to write. So normalized the mprage (the T1 anat.) “by hand,” using SPM pulldown menu “Normalize – Write” option that lets one load a *_sn.mat file created previously. Fixed the error, too.
Log files
Currently, need to identify which files are for which real (data acquired) run, and rename them HolesFMRI_Scanner_Run1.mat, etc.
NEED: change scanner script to take an input (from dialog box) indicating either run number or TEST, and use that value to determine which stimuli shown in scanner, and to name .mat file.
For now, use HolesFMRI_SPM_MakeConds.m script to make conds for functional analysis and do cursory examination of key presses, after identifying and renaming the proper .mat files by hand.
H4 subject was worst in the fourth (last) run, like the pilot subs, but unlike them only made 4 errors total in that run!
Did:
anthony@uniqua:~/data/HolesFMRI/mri/CateLab_017_H4$ mkdir L1
To hold SPM.mat and other files for first-level SPM functional analysis
Also did for specific versions of L1 analysis:
anthony@uniqua:~/data/HolesFMRI/mri/CateLab_017_H4/L1$ mkdir BlocksRuns
To indicate that the analysis in this directory has indicator vars for each block type and for n-1 runs.
