User Tools

Site Tools


processing_stream_-_image_file_conversion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
processing_stream_-_image_file_conversion [2010/05/26 19:34]
jochen Corrected the target path, etc.
processing_stream_-_image_file_conversion [2010/05/30 05:36]
jochen added instructions for SPM8
Line 21: Line 21:
 To ensure that the sorted list of filenames to be imported are in a correct temporal order, the use of the [[renamedicom]] function is highly recommended (unless you can confirm that the files you have already are properly named). To ensure that the sorted list of filenames to be imported are in a correct temporal order, the use of the [[renamedicom]] function is highly recommended (unless you can confirm that the files you have already are properly named).
  
-This functionality is **not yet** available as a compound function, but can be easily achieved by using the following code (adapted to your specific situation, of course):+This functionality is **not yet** available as a compound function, but can be easily achieved by using the following code for SPM5 (adapted to your specific situation, of course; wherever necessary and SPM8 instructions require, this is marked!):
  
 <code matlab>% load the DICOM import job file <code matlab>% load the DICOM import job file
 jobs = neuroelf_file('​p',​ '​spm5_dicomimport_job'​);​ jobs = neuroelf_file('​p',​ '​spm5_dicomimport_job'​);​
 +% for SPM8 it's '​spm8_dicomimport_job'​ of course!
 jobs = jobs.jobs; jobs = jobs.jobs;
  
 % use SPM's defaults % use SPM's defaults
-spm_defaults;​ % for SPM8 use spm('​defaults',​ '​FMRI'​);​+spm_defaults;​ 
 +% for SPM8 use spm('​defaults',​ '​FMRI'​);​ 
 + 
 +% ** IF YOU WISH TO USE THE SINGLE-FILE NIFTI FORMAT, SAY 
 +% jobs{1}.util{1}.dicom.convopts.format = '​nii';​ % for SPM5 or 
 +% jobs{1}.spm.util.dicom.convopts.format = '​nii';​ % for SPM8 ! 
 +% ** OTHERWISE THE TWO-FILE HDR+IMG FORMAT IS USED! **
  
 % change into your study'​s folder % change into your study'​s folder
Line 34: Line 41:
  
 % find all folders that contain DICOM import files (sessions) % find all folders that contain DICOM import files (sessions)
-importdirs = findfiles([pwd '/​CHIP*/func/​raw'​],​ '​*',​ '​dirs=1',​ '​depth=1'​);​+importdirs = findfiles([pwd '/​CHIP*/​raw'​],​ '*r*', '​dirs=1',​ '​depth=1'​);​
  
 % remove subjects that have already been imported % remove subjects that have already been imported
-donedirs = findfiles([pwd '/​CHIP*/​func'​],​ 'run*', '​dirs=1',​ '​depth=1'​);​+donedirs = findfiles([pwd '/​CHIP*/​func'​],​ 'r*', '​dirs=1',​ '​depth=1'​);​
 for dc = 1:​numel(donedirs) for dc = 1:​numel(donedirs)
  
Line 76: Line 83:
     jobs{1}.util{1}.dicom.data = dcmfiles;     jobs{1}.util{1}.dicom.data = dcmfiles;
     jobs{1}.util{1}.dicom.outdir{1} = target;     jobs{1}.util{1}.dicom.outdir{1} = target;
 +    % for SPM8, these two lines must be
 +    % jobs{1}.spm.util.dicom.data = dcmfiles;
 +    % jobs{1}.spm.util.dicom.outdir{1} = target;
     ​     ​
     % run import job     % run import job
processing_stream_-_image_file_conversion.txt · Last modified: 2010/05/30 05:36 by jochen