Dear Michael:
I fixed the problem noted below.
A variable wasn't getting assigned when that section of code was being
called non-interactively.
I have posted version 1.11 to the website
http://www.brain.northwestern.edu/cbmg/cbmg-tools/index.html
Two other things I've noticed- the code does not deal with parametric
events, and it absolutely requires that in a multi-session analysis all
sessions must contain the same number and type of events. I'm not sure if
or when these limitations might be fixed, since more sophisticated queries
can be performed in tools such as marsbar.
>PS -- The detail you added to the documentation about pci conversion to
>SEM helps a lot. I was wondering about that myself. I imagine you could
>average the .pci across subjects the same way I'm trying to average
>.psth? Or, is it more appropriate statistically to make a gargantuan
>fixed-effects model and simply extract a single psth and pci for each
>regressor of interest?
I don't know the correct statistical answer to this. I think there are
tradeoffs doing it either way. We have tried both methods including
multi-session runs and then averaging the session psth results, vs single
session runs. A problem with multi-session runs occurs if some sessions
have very few events of a particular type, then the estimation of the psth
can go horribly wrong, for example if there is only a single event. Single
session runs can cause a problem if some of your events bridge across the
run barrier, so you have to be careful to try not to estimate events too
close to the end of one run and the start of the next.
Darren
At 05:12 PM 10/15/2004, you wrote:
>Hi... I have one (hopefully last) follow-up email. The code you posted
>today works fine for me as a GUI, but the instructions on calling it as a
>function lead me to an error I cannot seem to get past. I spent the
>better part of yesterday afternoon scripting up some matlab code to
>interactively loop through subjects, assign and average psth's across
>subjects, then generate and save plot *.tifs for the regressors of
>interest for each voxel. Needless to say, I really want your function
>call to work! When I try running this updated get_psth.m file, I get the
>following MATLAB error message:
>
>
>??? One or more output arguments not assigned during call to 'get_psth (my
>regions)'.
>
>Error in /opt/local/spm2/get_psth.m
>On line 147 ==> [PSTH.xY, SPM, SPMfile] = my_regions(xY,SPM);
>
>
>I've troubleshooted this a little bit... It seems like it may be a problem
>loading the SPM.mat file. Breaking down the function call, I notice that
>PSTH = get_psth([-21 -69 27]) gets the voxel coordinates inputted just
>fine, then prompts for the SPM.mat file via GUI (as the programming
>dictates). Whereas, PSTH = get_psth([-21 -69 27],fullfile(pwd,'SPM.mat')
>simply bombs.
>
>Has anyone else had this problem? Am I just missing something that would
>be obvious to me if it wasn't Friday and I was worn out from the long
>week? I checked that the fileparts.m command was working fine within the
>function call to parse up the path to the SPM.mat file. (Just in case, I
>disabled the 'cd(pth)' command in the get_psth.m file to make sure it
>wasn't pointing to some weird directory, but alas the code seems to be
>doing what it's supposed to). Beyond this, I'm a bit at a loss...
>
>Any further help you can offer would still be greatly appreciated!
>Mike
>
>PS -- The detail you added to the documentation about pci conversion to
>SEM helps a lot. I was wondering about that myself. I imagine you could
>average the .pci across subjects the same way I'm trying to average
>.psth? Or, is it more appropriate statistically to make a gargantuan
>fixed-effects model and simply extract a single psth and pci for each
>regressor of interest?
>
>
>Michael C. Stevens, Ph.D.
>
>Senior Research Scientist, Clinical Cognitive Neuroscience Laboratory
>Olin Neuropsychiatry Research Center
>The Institute of Living / Hartford Hospital
>200 Retreat Avenue
>Hartford, CT 06106
>
>Assistant Clinical Professor of Psychiatry
>Yale University School of Medicine
>
>Tel: (860)545-7552
>Fax: (860)545-7797
>
> >>> Darren Gitelman <[log in to unmask]> 10/15/04 01:01PM >>>
>Michael:
>
>Oooh. that is a bit raw. There were multiple updates since then and I just
>posted an update (version 1.9) today after reading your query. It includes
>some instructions for plotting that I discussed with my students.
>
>Here are the changes
>There were probably changes in between version 0.1 and version 1 but I
>didn't keep track.
>version 1.1 Multiple changes to avoid selecting SPM.mat file twice. Changes
>to properly adjust for other columns.
>version 1.2-1.3 changes to help
>version 1.4 better feedback if data cannot be extracted.
>version 1.5 identifies the interactive window for better designation of
>events.
>version 1.6 added hack to check if beta seems way too large. This might
>occur if there were only 1-2 events used to estimate the beta.
>version 1.7 added field for storing bad results PSTH.events(n).bad
>version 1.8 updated choices for adjustments to be defaults.
>version 1.9 updated some help text.
>
>Go to the website:
>http://www.brain.northwestern.edu/cbmg/cbmg-tools/index.html to get the
>newest version.
>
>Darren
>
>At 11:39 AM 10/15/2004, you wrote:
> >Thank you very much for your reply. It certainly does help a great
> >deal. On what date did you post the update onto the webpage? I'll check
> >to make sure I've got the most current code. My function says v0.1 from
> >06/09/04. From what you said, I guess there's a more current one.
> >
> >Thanks much again!
> >
> >Sincerely,
> >Mike
> >
> >Michael C. Stevens, Ph.D.
> >
> >Senior Research Scientist, Clinical Cognitive Neuroscience Laboratory
> >Olin Neuropsychiatry Research Center
> >The Institute of Living / Hartford Hospital
> >200 Retreat Avenue
> >Hartford, CT 06106
> >
> >Assistant Clinical Professor of Psychiatry
> >Yale University School of Medicine
> >
> >Tel: (860)545-7552
> >Fax: (860)545-7797
> >
> > >>> Darren Gitelman <[log in to unmask]> 10/15/04 12:04PM >>>
> >At 09:19 AM 10/15/2004, you wrote:
> > >Dear Dr. Giitelman,
> > >
> > >I just downloaded from the SPM email-list your get_psth.m script. If
> > >you don't mind, I have 2 very quick questions for you:
> > >
> > >1) Is this script limited to event-related designs? My most current
> > >project invovles an epoch-modeled dataset, so I tested it out on that
> > >first. It appeared to give me data that plots similar to what I would
> > >have expected given one of my rapid event-related designs. So I
> > >wondered if the duration of the 'event' was taken into account when
> > >calculating the PST estimates.
> >
> >No it isn't restricted to event related data per se. The duration of the
> >psth to estimate is given by your specification of the PSTH window. You
> >should get exactly the same answer in SPM if you choose to graph the
> >event-related response and select PSTH (assuming the data are in 1
> >session). The calculation effectively implements a least squares
> >deconvolution so it shows you the HRF that when multiplied (convolved) by
> >the design matrix and with the added error would give you back your signal.
> >There is no explicit representation of the event duration except for the
> >window of the psth and each bin of the psth is usually a TR.
> >
> >
> > >2) I was a little uncertain interpreting the time scale of the graph.
> > >Given the GUI interface you programmed, the X-axis appears to be
> > >measured in seconds, correct. I was wondering if it perhaps was
> > >demarked as multiples of the bin (for this dataset, a TR of 1.5
> > >seconds). The data I get out for the epoch-design would make a LITTLE
> > >more sense as is, if each point was 1.5 seconds.
> >
> >No it should be actual seconds. The calculation is on lines 209 - 210 of
> >get_psth (version 1.8 or lines 242-243 in version 1.9)
> >209 j = round(xBF.length/xBF.bin);
> >210 PSTH.pst = [1:j]*xBF.bin - xBF.bin/2;
> >
> >In line 209, j is in units of TR's or bins (window length (=secs) / TR
> >(=sec/TR). So for a window length of 30 sec and TR of 2, j = 15.
> >Line 210 sets up a vector of TR's ([1:j]) and multiplies it by the bin size
> >or TR (i.e., sec/TR), thus transforming the vector into seconds.
> >
> >I have posted an update to get_psth (version 1.9) which adds some
> >information about plotting the results.
> >Hope this helps,
> >Darren
> >
> >
> >-------------------------------------------------------------------------
> >Darren R. Gitelman, M.D.
> >Cognitive Neurology and Alzheimer¹s Disease Center
> >Northwestern Univ., 320 E. Superior St., Searle 11-470, Chicago, IL 60611
> >Voice: (312) 908-9023 Fax: (312) 908-8789
> >-------------------------------------------------------------------------
>
>
>-------------------------------------------------------------------------
>Darren R. Gitelman, M.D.
>Cognitive Neurology and Alzheimer¹s Disease Center
>Northwestern Univ., 320 E. Superior St., Searle 11-470, Chicago, IL 60611
>Voice: (312) 908-9023 Fax: (312) 908-8789
>-------------------------------------------------------------------------
|