tag:blogger.com,1999:blog-1405968300258104460.post1851869025205777334..comments2024-03-29T08:33:38.267-04:00Comments on Andy's Brain Blog: Using SPM.mat to Stay on Track (II)Andrew Jahnhttp://www.blogger.com/profile/16435706598096921650noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-1405968300258104460.post-15674058686863430332017-06-25T18:38:14.317-04:002017-06-25T18:38:14.317-04:00Hello Andy,
Thanks a lot for your patient answers!...Hello Andy,<br />Thanks a lot for your patient answers! I am very sorry to trouble you but I have another general question for beginners like me:<br />How can we know which specific functions involved in a preprocessing step in SPM? <br />Although we can define structures and conduct these structures using the function spm_jobman to preprocess data of many subjects. We still don't know the specific Matlab function behind a preprocessing step. For example, we all know the structure jobs{1}.stats{1}.fmri_spec is in charge of GLM in SPM but we don't know which functions are in charge of GLM. Now I want to know how to find out the specific Matlab functions used in a preprocessing step. <br />Thank you in advance!<br />Po<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-82440293511252655392017-06-24T16:45:57.669-04:002017-06-24T16:45:57.669-04:00Hi Po,
I haven't done DCM analysis before, so...Hi Po,<br /><br />I haven't done DCM analysis before, so I don't know all the details. That said, here's my best guess about the answers to your questions:<br /><br />1. You could try creating them manually by creating them as structures within SPM and assigning variables to the fields that you need. My feeling is that SPM may look for the entire structure, not just the fields you specified, so you may need to populate the rest of the fields with null values.<br /><br />2. I can't say how much the slice timing will affect your DCM analysis. If you set the delays to zero, which sounds as though it will prevent DCM from doing any additional slice timing, then I don't see how that will be problem. It could be that SPM looks for the DCM.delays field later on and uses it for the actual model comparison, so I would look in the scripts to see if that's the case.<br /><br />-AndyAndrew Jahnhttps://www.blogger.com/profile/16435706598096921650noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-5407740640946395822017-06-23T07:40:08.405-04:002017-06-23T07:40:08.405-04:00Hi Andy,
Thanks a lot for your always helpful tuto...Hi Andy,<br />Thanks a lot for your always helpful tutorials on fMRI! <br />I have done all the preprocessing and 3Ddeconvole using AFNI. Now I need do DCM using SPM. So pb05.sub.scale+tlrc and roi.mask+tlrc will be transformed to nifti format using 3dAFNItoNIFTI and the voi.mat will be generated later using SPM functions. The time series of first scaled eigenvariates of VOI will be inputted to DCM functions. But now I have two questions:<br />1.The DCM in SPM also needs the input 'SPM.Sess.U.dt' and 'SPM.Sess.U.u'. <br />Do you know how to create SPM.Sess.U.dt and SPM.Sess.U(1).u by myself without using GLM function in SPM?<br />2.Timing slices has already been done in AFNI preprocessing and all slices have already been aligned to the first slice. And I have not too much time for repeating the preprocessing which omits ‘slice-timing correction’. So I will set the timing slice input 'DCM.delays' to zeros because the paper (which has been attached following) says that the DCM models whether including timing slice or not doesn't matter too much for very short TR ( TR 2s in my experiment). Do you think I will do something wrong with the timing slices for DCM? <br />Your answers will be very appreciated!<br />Po<br />(Kiebel, S. J., Klöppel, S., Weiskopf, N., & Friston, K. J. (2007). Dynamic causal modeling: a generative model of slice timing in fMRI. Neuroimage, 34(4), 1487-1496.)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-43131826117062658152017-05-03T14:29:40.375-04:002017-05-03T14:29:40.375-04:00Thank you again for your help! I will hopefully fi...Thank you again for your help! I will hopefully figure it out - Jesshttps://www.blogger.com/profile/10631339844959368361noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-25206711746087758292017-05-02T17:01:50.910-04:002017-05-02T17:01:50.910-04:00I don't know how SPM generates the fitted time...I don't know how SPM generates the fitted time series. I'm sure you could find out by looking at how SPM's .m files create it, but unfortunately I don't know where to direct you to.<br /><br />Good luck!<br /><br />-AndyAndrew Jahnhttps://www.blogger.com/profile/16435706598096921650noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-79089172606650450082017-05-02T10:55:22.223-04:002017-05-02T10:55:22.223-04:00Thank you for your help! The problem is that I don...Thank you for your help! The problem is that I don't want the initial fMRI time series which are encoded in the fMRI images, I would like to have the fitted responses (after preprocessing and after determining the contrast and pvalue) which as you said are not encoded in any separate file so I wouldn't know which .hdr file to concatenate since the images generated are all 3D. I assume that since you can extract the information for a single voxel, in theory you could extract the same information for all voxels (maybe writing a matlab script). If you have any ideas please let me know; my final goal is to calculate the pair correlations of the timeseries of the activated voxels, this is why I need the fitted responses instead of the raw signal. <br />Thank you again<br />JessJesshttps://www.blogger.com/profile/10631339844959368361noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-65175110152419105692017-05-02T10:18:24.755-04:002017-05-02T10:18:24.755-04:00Hi Jess,
Someone recently asked me a similar ques...Hi Jess,<br /><br />Someone recently asked me a similar question, and I recommended using AFNI's 3dmaskdump tool. I've reprinted the email below:<br /><br /><br />I don't know how to do that in SPM, but you can do it in AFNI using the command 3dmaskdump.<br /><br />First, concatenate all of your .hdr files into a single dataset using 3dTcat; e.g., 3dTcat -prefix myRun.nii swar*.hdr<br /><br />Then, use your mask to extract the timecourse from each voxel:<br /><br />3dmaskdump -mask mask.nii -noijk -xyz myRun.nii > allTimeCourses.txt<br /><br />This will print the timecourses to the file allTimeCourses.txt. Each row will be a timecourse from each voxel, and the number of columns will be the number of volumes in your dataset. You can import this into Excel for further manipulation or statistics. Check the help of 3dmaskdump to learn more about the options -noijk and -xyz.<br /><br /><br />=========<br /><br />The only problem is that I don't know where SPM keeps its fitted timecourse; unlike AFNI, which has the option of generating a separate dataset with the fitted timecourse at each voxel, SPM does not create a separate file. How it calculates the fitted timecourse in the GUI, I do not know.<br /><br />-AndyAndrew Jahnhttps://www.blogger.com/profile/16435706598096921650noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-37609141890338970362017-05-01T17:58:24.544-04:002017-05-01T17:58:24.544-04:00Hi Andy!
I really need your help. Once I get the S...Hi Andy!<br />I really need your help. Once I get the SPM.mat how can I extract the fitted time series of the BOLD signal for ALL the voxels in the activation map? I guess in theory I can do it at a ROI level (don't know how) and I know I can do it for a single voxel by plotting the 'fitted response' and selecting the contrast I choose and this would generate a 'y' variable which corresponds to the fitting response. How do I get this fitted response for all voxels? Also, if a voxel is active in different contrasts, why is the fitting function different? <br />Thank you in advance for your help!<br />Jesshttps://www.blogger.com/profile/10631339844959368361noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-62479980984492827692015-04-05T15:54:20.247-04:002015-04-05T15:54:20.247-04:00Hi, how do I create a SPM.mat file?
I have the tim...Hi, how do I create a SPM.mat file?<br />I have the time series already from a DCM file, but I want to create other model.<br />Thank youAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-51771882998243634072014-12-01T10:24:39.074-05:002014-12-01T10:24:39.074-05:00Life saving post!Life saving post!Anonymousnoreply@blogger.com