EPI Data Initialization


Jump to: navigation, search

You have come here if you need to initialize your fMRI EPI data for use with mrVista.

First, in case you cannot remember the number of slices you had or the number of time points, the following commands will come in handy. Make sure you are one directory above the Raw directory (all your data should be in a Raw directory, split by scans).

 singleDicom = 'Raw/EPI_run1/I0001.dcm';
 mr = mrLoad(singleDicom, 'dicom');
 % Now you can look at your header using mr.hdr
 timePoints = mr.hdr.NumberOfTemporalPositions
 numSlices = mr.hdr.ImagesInAcquisition  % If data are from CNI, do: numSlices = mr.hdr.ImagesInAcquisition/timePoints

Now, you'll want to initialize your anatomical inplane. (Change the directory name below to match yours.)

 ip = mrReadDicom('Raw/Anatomy/Inplane/*.dcm', 3, numSlices); % 3 is to concatenate across 3rd dimension
 mrSave(ip, pwd, '1.0anat'); %This will create a mrSESSION file and an Inplane directory.

Next, you need to do something very similar with the functional data as you did with the inplane, except that you save it out as a time series (instead of an anatomical), and you need to give it the number of time points in your time series. You do this for each functional scan (i.e. usually each run). The code will automatically add a scan each time you do this without overwriting anything. This step will take a minute for each scan. (It's a good idea to write a script or a loop to do all your scans and then just let it run.)

 func = mrReadDicom('Raw/EPI_run1/*.dcm',[3 4],[numSlices timePoints]); % update the directory name for each of your scans

Now it's time to look at your data. To do so, type mrVista into matlab while in the directory where your mrSESSION file was created. If everything went well, this will just show your inplanes. One way to make sure your inplanes line up reasonably well to your functionals is to choose

 View --> Mean Map
 Adjust the mapWinMin about one click, until not everything is red.
Personal tools