HFM Version 1.0
(All keypresses are indicated in bold, menu
selections in italics)
- Put in the loadret directory
copies of the following:
- 1) Enter parameters, import structural
EPI data
% matlab -nojvm
>> HFM
Number of anatomy inplanes: 11 (# of slices in the volume,
before interpolation)
Number of experiments (P files): 1 (This is the number of
runs)
Number of temporal frames (functional images per plane): 116
(Enter the number of images in the longest run)
Number of temporal cycles per experiment: 5 (Any random
number is fine here)
Discard the first (n) temporal frames: n= 0
Directory of anatomy images is /data/subject/loadret
Press <return> to accept, or enter a new directory: (enter)
Size of epi anatomies? [128 128] (EPI resolution)
Size of signa anatomies? [512 512] (Structural resolution)
Size of functionals? [128 128] (EPI resolution)
Target size? [512 512] (Destination resolution = structural resolution)
Fake anatomies from functional data? 1 = yes 0 (hit 1 for yes if you did not acquire an extra
set of coplanar EPIs)
Give me offset x: epiplane + x = functional plane (0) 2 (This would be for slices 3-13)
Enter EPI Coplanar Image Name: HC-Subj+8+2+1_001.img
ans =
A1.s1.bshort
Enter correct series number: [default 1]:1
- 2) Import high-resolution structural spin-echo images,
and align with EPI structural images
Select a good slice near the
center of the brain. Then, HFM -> Signa Anatomies
>> Give me offset x: epiplane + x = functional plane (0) 2
offset =
2
ans =
E1636S3I11.MR
Signa exam number and series number ([1636 3]? [1636 3] (or
hit enter if the default is correct)
Enter shift if known (eg. [-8 -4]), or hit enter to continue and
find the shift: (enter)
Clicking on 5 homologous points in the structural and functional
images.
shift =
-8 1
Hit 0 to try again, 1 to accept: 1 (Do several trials
until you get a number (xshift, yshift) that does not vary by more than
1.Write the final number down somewhere)
- Switch slices ... this will update the images to the hires ones.
- 3) Crop Anatomies
HFM ->Clip Anatomies
- Hit Y to auto-extract crop from file conversionDataKS.mat. This is best.
- Hit N to crop yourself. Select the region
- be sure to include all the gray matter. In general I choose superior
to the HC in the most anterior slice, and inferior to the FG in the most
posterior slice, and laterally the edges of the brain.
- 4) Import EPI Time series
HFM ->EPI -> AIR
tSeries
- Enter the pathname and directory for each timeseries,
ie, each experiment in the run:
- Eg. For /space/zeineh/subject/run1/run1.s001.bshort,
type
Directory: /data/subject/air/run1/
Filename: run1
- Then, if slices 3-13 were selected, type
3:13
- It will work for about an hour or so as it
imports the functional data and interpolates up the functional data to match
the resolution of the structural data. I default it to nearest neighbor interpolation
for honesty's sake. If your functionals are not an even multiple of your
structurals, I suggest changing this hard-coded NN interpolation to linear,
bilinear, or bicubic in the file HC_AIRTseries.m in the HFM-Code directory.
- 5) Register time series with structurals, and import unfolding
transformation
Special -> mrAlign
- Enter in parameters
>> Current list of subjects:
HC-PinkFloyd/ HC-Rush/ HC-Yes/ HC-PamAnd/ HC-Subj/ HH-Farihi/
HH-Rex/
Subject name: HH-Subj
Enter size of inplane anatomy pixels/mm in x,y and z directions
Default is [256/260,256/260,1/4]: [512/200 512/200 1/3] (this
is the size of your anatomic volume before interpolation #pixels
per mm)
Finished saving AlignParams.
/usr/local/mri/anatomy/UnfoldParams.mat not found. Please enter values.
Enter size of volume anatomy pixels/mm in x,y and z directions
Default is [256/240,256/240,1]: [512/200 512/200 7/3] (this
is the size of your anatomic volume after interpolation #pixels
per mm)
- Then go to HFM -> EPI -> Compute
Trans
- Verify rotation by selecting various planes
in figure 1, and hitting Select -> Check Rotation in figure 2.
- Close figures 2-5
- 6) Create flattened anatomy maps
Init -> Full Analysis
-> Create Flat Anat
- Hit b for both hemispheres
- Just keep hitting enter until it is done.
- Close Fig 2
- 7) Manually adjust coregistration
between EPI time series and high-res structurals
HFM -> EPI -> Shift
tSeries
- Click Generate Selpts, then Save Selpts
- Use arrow buttons to shift image until overlap
is good.
- Check different slices by clicking on slice
# in figure 1, and then clicking update to view overlay on EPI
- You want to check slices throughout, that is,
2-10. You don't need to check every single slice, though. Slices 2,5,10
should do it.
- Click execute to shift
- 8) Mask all zero points in data
HFM -> EPI -> strictmean
(This routine masks the data,
so if any pixels are zero at any timepoint, then that voxel will be zero for
the entire time series. If you have more than one run, and if some runs have
more or less time points than other runs, you want to tell strictmean the
exact number of time points in each run, because it zero-fills all of the
empty time points on the shorter runs, and strictmean
will then zero out the entire run!)
- Number of images in run 1: [116] (enter
if correct)
HFM -> EPI -> remake
firstslice (This will recreate
a volume image of the 1st time point)
- 9) Project 3-D volume EPI time series to flat space, and
create (empty) correlation map files in flat space, and correct gray scale
scheme
Init -> Full Analysis
-> Create Flat Timeseries, Create Flat Correlations
HFM -> Fix Flat Anats
Note that these
correlation maps only correlate with a sinusoid with a frequency of the number
of cycles you specified earlier. It is much easier and more precise to do
the next step instead.
- 10) Create correlation
maps in 3-D and 2-D that correlate with your paradigm files: Note you need
paradigm files for this step.
HFM -> Statistics
-> Inplane Correlations
HFM -> Statistics ->
Flat Correlations
- 11) To visualize activity,
click L or R, and View-> Phase Map. Hit HFM -> colorph
to make it look nice, and adjust the threshold bar at the top.
- 12) You will want to add the
demarcations ... see the next section for how to do this.
- 13) After you are done with demarcations
bilaterally, if you hit Fill Regions on the demarcation window, it
will create ROIs for each of the 7 subregions on each hemisphere (the rigth
column of the demarcation window). You can plot timeseries from each subregion,
or extract all timeseries to a spreadsheet.
To create the regions:
(Demarcation Menu) Fill Regions
To plot a single region:
(Demarcation Menu) CA23DG (or any other region you want
to plot)
(Figure 1 Image Window) Load tSeries
(matlab window) a=tSeries(:,selpts(1,:)); b=mean(a,2);
figure(3); plot(b);
To store the time series of all regions:
(Demarcation Menu) Region TS
threshold images (1=yes, 0=no) [0] 0 (better
to not threshold to make analyses unbiased)
Paradigm Drift Correction Value (ie baseline in paradigm file) [0]
0 (ie which values in your paradigm file correspond
to a physiological baseline for fMRI signal intensity)
Drift Correction Order [1] 1 (1=1st order, 2=2nd
order, 0=0th order: what happens is that a polynomial of this order is fit
to all of the timepoints who are baseline timepoints as specified above.
The data is divided by this polynomial curve to deliver drift corrected %
change from baseline signal intensity).
Saved RegionTS TS TS_points
Saving RegionTS.txt (you can view this file with a spreadsheet
program)
If you want to process another run on a subject who
was already unfolded and processed, you can use the following shortcut:
- Copy the following files from that subject's
prior loadret data directory:
mkdir /data/HC-Subject/loadret2
cd /data/HC-Subject/loadret2
set subject = /data/HC-Subject/loadret
cp ${subject}/AlignParams.mat .
cp ${subject}/ExpParams.mat .
cp ${subject}/Fanat_left.mat .
cp ${subject}/Fanat_right.mat .
cp ${subject}/anat.mat .
cp ${subject}/mrLoadRetPrefs.mat .
cp ${subject}/roi14.mat .
(Note, get the latest ROI file)
cp ${subject}/HC.mat .
- run MATLAB - nojvm, and run the script
changeExpParams
>> HC_ChangeExpParams
# of experiments [2] 2
Images per experiment: [96] 103
- clear all, then run the
HFM module
>> clear all
>> HFM
HFM Version 1.0 by Michael Zeineh
mrLoadRet, version 1.0. Matlab 5.0
Initializing general workspace variables
Initializing Callbacks
Checking anat file
Loading anat.mat.
Reading mrLoadRet Preferences file.
Done loading mrLoadRet-1.0
- Import the EPI fMRI data
HFM ->EPI -> AIR
tSeries
- Enter the pathname and directory for each timeseries:
- Eg. For /space/zeineh/subject/run2/S1.scan2.bshort,
type
Directory: /space/zeineh/subject/run2/
Filename: scan2
- Then, if slices 3-13 were selected, type
3:13
- It will work for about an hour or so
- Align the data
HFM -> EPI -> Shift
tSeries
- Click Generate Selpts, then Save Selpts
- Use arrow buttons to shift image until overlap
is good
- Check different slices by clicking on slice
# in figure 1, and then clicking update to view overlay on EPI
- Click execute to shift
- Mask the data, and remake an image of the 1st volume timepoint
HFM -> EPI -> strictmean
- Number of images in run 1: [116] (enter if correct)
- Number of images in run 2: [116] (enter if correct)
HFM -> EPI -> remake
firstslice
- Create the flat anatomy and
correlation map files
Init -> Full Analysis
-> Create Flat Timeseries, Create Flat Correlations
- Create a correlation map,
putting in this directory the appropriate paradigm files: run1_p.mat, etc.
HFM -> Statistics
-> Inplane Correlations
HFM -> Statistics ->
Flat Correlations
Creating a paradigm file:
Option 1: Use the program Cproto.
To convert a Cproto paradigm file to a matlab file, do the following:
paradigm=load('CprotoParadigm.p');
whos paradigm (Confirm that paradigm is a
column vector)
save run1_p paradigm
Option 2: If you do not want to use Cproto, simply create in matlab a
column variable called paradigm, place it in a correlation model for your
paradigm, with the # of columes = to the # of time points, and save it to
a file.
Example: For an alternating paradigm, 20 images off, 20 on, 4 repetitions,
end with 20 image block off, delay by 1 timepoint:
matlab -nojvm
>> paradigm = zeros(120,1);
>> paradigm(22:(22+19))=ones(20,1);
>> paradigm(62:(22+19))=ones(20,1);
>> save run1_p paradigm
You can obviously employ hemodynamic models as does Cproto at your discretion
(and coding).
Back to
main