Reply-To: | | [log in to unmask][log in to unmask]> wrote:
> HI Anders, > > I'm curious as to why you have a ~1000 fMRI datasets with different TR, > voxel res, etc but to answer your question, it is possible to batch the > analysis, given that you know how to program in Matlab. > > Here are some things you will need to know: > > 1. How to convert a batch job in SPM(8) to a .m file (This part is easy: > File: save as .m file) > > 2. How to convert this .m file into a Matlab function so that you can > specify TR, slices, etc as inputs. > > Depending on the value that is different for each dataset...you will set > that Matlabbatch structure field description in the .m file to a variable. > > $--------------------------------------------- > (overview of a sample function) > function function_A(TR, slices,dim,timepoints) > matlabbatch.field1.field2.field3.TR = TR; > % run the matlabbatch job > spm_jobman('run',matlabbatch); % <--use this command to run the batch job > $--------------------------------------------- > Conversely, you can follow the directions in the SPM manual for running a > batch job in the command line. Check the forum too, it has lots of > suggestions on how to create a batch file! > > 3. How to create a .mat file or structure for each dataset that specifies > each condition (which you can specify as an input when calling the > function). Create a .mat for each dataset with the variables defined. > > Example: > A.mat has the variables: > TR = 2.0 > slices =21 > dim = [3 3 3] > timepoints = 300 > > 4. How to create a batch code that will load the variables from the .mat > file in 3 and call the function with these variables as inputs. > > -------------------------------------------------------- > % Overview of a sample batch script: > % go to dataset directory > % load A.mat > function_A(TR,slices,dim,time-points) > -------------------------------------------------------- > > Good luck with the rest. > > > Vy T.U. Dinh > Research Assistant, Neurological Sciences > Rush University Medical Center > Phone: (312) 563-3853 > Fax: (312) 563-4660 > Email: [log in to unmask] > > ________________________________________ > From: SPM (Statistical Parametric Mapping) [[log in to unmask]] on behalf > of Anders Eklund [[log in to unmask]] > Sent: Thursday, August 04, 2011 6:34 AM > To: [log in to unmask] > Subject: [SPM] Analyze 1000 datasets > > Hello, > > I have ~ 1000 fMRI datasets (each stored as one *.nii file) that I would > like to analyze with SPM. These datasets have different number of > timepoints, TR, voxel resolution and slices. For each dataset I only > want to save the number of significantly active voxels. Is it possible > to do this as a batch job in SPM or do I have to do it manually for each > file? > > /Anders > > -- > -- > ----------------------------------------------------------------------- > > Anders Eklund > Phd ïZhte |