oh duh! Sorry, wasn’t thinking clearly.
Okay, I see how to generate the betas now. I don’t even need to mess with the mkcontrast-sess command.
I just run selxavg3-sess with the -no-con-ok flag.
With spmhrf 0 I generated a beta.nii.gz file with 85 betas in each vertex.
With spmhrf 1 I generated a beta.nii.gz file with 97 betas in each vertex.
With 12 conditions, 12 more betas is exactly right.
So how do I know which of the betas is which?
I looked through the files and couldn’t find any labels.
I’m guessing the first twelve are the condition betas for "spmhrf 0".
If so, for "spmhrf 1", is it arranged as:
1) c1 c2 c3…d1 d2 d3...
or
2) c1 d1 c2 d2...
(where d is the first derivative term)
also, when I asked you earlier about implementing this procedure, I had suggested reading the betas, computing the Calhoun, then generating new beta.nii.gz files with the new betas replacing the original spmhrf0 betas and then continuing with the regular analysis stream but you said it would result in invalid p-values. Instead, you suggested:
"I was just thinking you could load the beta into matlab, make the
Calhoun computations on each condition, then compute the contrasts, then
write out the new volume”
can you expand on how one might “compute the contrasts” and “write out the new volume”?
Thanks again for this help!
Joe
The setwdelay is an option for mkcontrast-sess (not mkanalysis-sess)On 03/13/2016 10:29 PM, Joseph Dien wrote:After a long break, back to this…
My goal is still to get the betas for the first and maybe second spm
hrf so I can calculate a Calhoun derivative boost measure.
As a first step I ran:
mkanalysis-sess -fsd bold -analysis RPA.sm05.lh -surface fsaverage lh
-fwhm 5 -event-related -paradigm RPA1fix.par -nconditions 12 -spmhrf
1 -TR 2 -refeventdur .25 -polyfit 2 -per-run -force -nuisreg
nuisreg.dat 6 -tpexclude tpexclude.dat -b0dc
to use the SPM HRF with one derivative.
Then:
selxavg3-sess -sf sessidlistALL.dat -analysis RPA.sm05.lh
I got the following error:
ERROR: flac_evconw(): conVinc, Condition01 evrw dim mismatch
This condition has 2 regressors, but evrm has 1
Struct contents reference from a non-struct array object.
Error in flac_conmat (line 37)
if(nthcon > length(flac.con))
Error in flac_customize (line 369)
flacnew = flac_conmat(flacnew,nthcon);
Error in fast_selxavg3 (line 65)
flac0 = flac_customize(flac0);
------------------------------------------
ERROR: fast_selxavg3() failed\n
This ran fine with spmhrf 0
based on your prior response below that:
"This is what happens. If you want to use the derivatives,
then you need to spec -setwdelay. When you run the command, it will
prompt you
for 3 values to use. If you spec 1 0 0, then it will be the same as the
default. If you want to test only the first derivative, then
you would spec 0 1 0. Note that the 3rd regressor is the 2nd
derivative wrt time, not the first derivative wrt the dispersion
parameter. You
cannot get the Calhoun 2004 value using a contrast (it is non-linear).”
I tried:
mkanalysis-sess -fsd bold -analysis RPA.sm05.lh -surface fsaverage lh
-fwhm 5 -event-related -paradigm RPA1fix.par -nconditions 12 -spmhrf
1 -TR 2 -refeventdur .25 -polyfit 2 -per-run -force -nuisreg
nuisreg.dat 6 -tpexclude tpexclude.dat -b0dc -setwdelay
but I just got the error:
ERROR: Flag -setwdelay unrecognized.
I also tried using the flag when setting up the contrasts but that
didn’t work either.
so not quite sure what I’m doing wrong. I had understood from your
response below that the contrast weights didn’t need to be changed
from the spmhrf 0 case but perhaps I misunderstood?
any help would be welcome!
Joe
On Jul 10, 2013, at 13:58, Douglas N Greve <greve@NMR.MGH.HARVARD.EDU
<mailto:greve@nmr.mgh.harvard.edu>> wrote:
I was just thinking you could load the beta into matlab, make the
Calhoun computations on each condition, then compute the contrasts, then
write out the new volume
On 07/10/2013 01:40 PM, Joseph Dien wrote:
Sounds good!
Regarding creating a new volume and computing contrasts from it, what
do you mean? I didn't follow that.
Thanks!
Joe
On Jul 10, 2013, at 1:33 PM, Douglas N Greve
<greve@nmr.mgh.harvard.edu
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@nmr.mgh.harvard.edu>> wrote:
On 07/10/2013 01:29 PM, Joseph Dien wrote:
Sorry, not following what you are suggesting?
I want the second derivative for calculating the Calhoun et al 2004
derivative boost measure.
My understanding is that to the extent that the BOLD signal deviates
from the canonical hrf, the amplitude of the primary regressor will be
attenuated and the variance will instead end up in the first and
second derivatives (to the extent that they are able to accommodate
the divergence). By using a Calhoun measure that incorporates both
the first and second derivatives, in principle I'll have a BOLD
measure that is more robust to deviations from the canonical hrf.
Sorry, it had been a while since I read that paper. I did not know that
they had a formulation that included the 2nd derivative.
However, if the way FSFAST is calculating the second derivative
regressor is resulting in loss of statistical power due to shared
variance with the primary regressor, then it would be best to just not
include it at all in the estimation step.
I don't know how much it will hurt the power. You'd have to look at the
efficiency.
doug
On Jul 10, 2013, at 1:21 PM, Douglas N Greve
<greve@nmr.mgh.harvard.edu
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@nmr.mgh.harvard.edu>
<mailto:greve@nmr.mgh.harvard.edu>> wrote:
Why not just create a new volume and then compute contrasts from
the new
volume? What you are suggesting will work I think, but it leaves me a
little nervous. The p-values will be meaningless.
As for the 2nd derivative, I think it must be a numerical issue
(it is
not computed analytically). Why do you need the 2nd derivative?
doug
On 07/10/2013 12:47 PM, Joseph Dien wrote:
I'm thinking of generating a modified beta.nii.gz file where the
primary betas have been replaced with the Calhoun et al (2004)
derivative boost measure. What do you think? Also, please note my
question below about the second derivative as it is causing me
concern
about my analysis. Thanks!
Joe
On Jul 10, 2013, at 12:39 PM, Douglas N Greve
<greve@NMR.MGH.HARVARD.EDU
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@NMR.MGH.HARVARD.EDU>
<mailto:greve@NMR.MGH.HARVARD.EDU>
<mailto:greve@NMR.MGH.HARVARD.EDU>> wrote:
I think that would work. You would need to change the time stamps
on the
.mat file in the analysis folder. When you re-run selxavg3-sess, it
will
see that the .mat files are newer than the beta and regenerate the
contrasts. But what are you planning to do the the beta file? It
sounds
like a potentially bad idea
doug
On 07/09/2013 10:26 PM, Joseph Dien wrote:
It looks as though selxavg3-sess generates the contrast
analyses at
the same time as the beta weights. Would it be possible to
run selxavg3-sess once to obtain the beta weights, modify the
beta.nii.gz file, and then rerun selxavg3-sess to obtain the
contrast
statistics using the modified beta weights?
Joe
On Jul 9, 2013, at 5:08 PM, Joseph Dien <jdien07@mac.com
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>> wrote:
I tried correlations and the 2nd derivative is definitely not
orthogonal.
corrcoef([X(1:207,4) X(1:207,5) X(1:207,6)])
ans =
1.0000 -0.0000 -0.5427
-0.0000 1.0000 -0.0298
-0.5427 -0.0298 1.0000
I looked at the regressors that SPM generates for the same data:
ans =
1.0000 0.0436 0.1740
0.0436 1.0000 -0.0226
0.1740 -0.0226 1.0000
The first derivative is not as orthogonal but the second
derivative
was much more orthogonal.
Does this have to do with what you noted below about how the
second
derivative is being calculated?
So does this mean I should avoid the spmhrf 2 option entirely to
avoid loss of statistical power?
Thanks for the help!
Joe
On Jul 9, 2013, at 4:34 PM, Joseph Dien <jdien07@mac.com
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>> wrote:
Thanks for the quick response! So if I wanted to use the
Calhoun
2004 approach, I should be able to use the Steffener 2010
correction
to address the violation of the assumption that the regressors
were
standardized and generate a new beta.nii.gz file where the
primary
beta values have been replaced with the Calhoun 2004 measure.
Can I
assume the three regressors are more or less orthogonal? I got
non-zero numbers when I tried to test the assumption in the
Xtmp.X
variable
sum(X(1:207,4).*X(1:207,5))
but not hugely non-zero so maybe just rounding errors?
On Jul 9, 2013, at 4:16 PM, Douglas N Greve
<greve@NMR.MGH.HARVARD.EDU
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@NMR.MGH.HARVARD.EDU>
<mailto:greve@NMR.MGH.HARVARD.EDU>
<mailto:greve@NMR.MGH.HARVARD.EDU>
<mailto:greve@NMR.MGH.HARVARD.EDU>> wrote:
On 07/09/2013 04:11 PM, Joseph Dien wrote:
Hi,
I have a question about how mkcontrast-sess works. I ran an
analysis using the mkanalysis-sess option spmhrf 2 so
there are
three
regressors for each predictor, the primary, the latency,
and the
dispersion. When specifying the contrast weights for
mkcontrast-sess,
the documentation indicates that they are specified in terms
of the
conditions as numbered in the paradigm file, not the
individual
regressors. Furthermore there only appears to be one contrast
value
output for each contrast, not three.
How are the three regressors being handled? I can think of
several
scenarios:
1) the contrast weights are not actually in terms of
conditions (the
documentation is incorrect), they are actually in terms of the
regressors (so contrasting conditions 1 and 2 could be
specified
as -a
1 -a 2 -a 3 -c 4 -c 5 -c 6).
2) the latency and dispersion regressors are being ignored (a
common
practice). The contrast weights should therefore be
specified as
-a 1
-c 2.
This is what happens. If you want to use the derivatives,
then you
need
to spec -setwdelay. When you run the command, it will
prompt you
for 3
values to use. If you spec 1 0 0, then it will be the same
as the
default. If you want to test only the first derivative,
then you
would
spec 0 1 0. Note that the 3rd regressor is the 2nd
derivative wrt
time,
not the first derivative wrt the dispersion parameter. You
cannot get
the Calhoun 2004 value using a contrast (it is non-linear).
doug
3) The Calhoun et al (2004) approach is being used to
combine the
three regressors into a "derivative boost" amplitude
measure. The contrast weights should therefore be specified
as -a
1 -c 2.
Thanks for any help you can give me!
Joe
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
University of Maryland
E-mail:jdien07@mac.com
<mailto:jdien07@mac.com><mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
Phone: 202-297-8117
http://joedien.com//
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
<mailto:Freesurfer@nmr.mgh.harvard.edu>
<mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@nmr.mgh.harvard.edu>
<mailto:greve@nmr.mgh.harvard.edu>
<mailto:greve@nmr.mgh.harvard.edu>
<mailto:greve@nmr.mgh.harvard.edu>
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs:surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
<http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
FileDrop:https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
Outgoing:
ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
<mailto:Freesurfer@nmr.mgh.harvard.edu>
<mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the
person to
whom it is
addressed. If you believe this e-mail was sent to you in
error and
the e-mail
contains patient information, please contact the Partners
Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was
sent to
you in error
but does not contain patient information, please contact the
sender
and properly
dispose of the e-mail.
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
University of Maryland
E-mail:jdien07@mac.com
<mailto:jdien07@mac.com><mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
Phone: 202-297-8117
http://joedien.com//
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
<mailto:Freesurfer@nmr.mgh.harvard.edu>
<mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the
person to
whom it is
addressed. If you believe this e-mail was sent to you in
error and
the e-mail
contains patient information, please contact the Partners
Compliance
HelpLine at
http://www.partners.org/complianceline. If the e-mail was
sent to
you in error
but does not contain patient information, please contact the
sender
and properly
dispose of the e-mail.
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
University of Maryland
E-mail:jdien07@mac.com
<mailto:jdien07@mac.com><mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
Phone: 202-297-8117
http://joedien.com//
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
<mailto:Freesurfer@nmr.mgh.harvard.edu>
<mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to
whom it is
addressed. If you believe this e-mail was sent to you in
error and
the e-mail
contains patient information, please contact the Partners
Compliance
HelpLine at
http://www.partners.org/complianceline. If the e-mail was sent to
you in error
but does not contain patient information, please contact the
sender
and properly
dispose of the e-mail.
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
University of Maryland
E-mail:jdien07@mac.com
<mailto:jdien07@mac.com><mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
Phone: 202-297-8117
http://joedien.com//
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@nmr.mgh.harvard.edu>
<mailto:greve@nmr.mgh.harvard.edu>
<mailto:greve@nmr.mgh.harvard.edu>
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs:surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
<http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
FileDrop:https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
Outgoing:
ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
<mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
University of Maryland
E-mail:jdien07@mac.com
<mailto:jdien07@mac.com><mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
Phone: 202-297-8117
http://joedien.com//
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@nmr.mgh.harvard.edu>
<mailto:greve@nmr.mgh.harvard.edu>
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs:surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
<http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
FileDrop:https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
Outgoing:
ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
<mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
University of Maryland
E-mail:jdien07@mac.com
<mailto:jdien07@mac.com><mailto:jdien07@mac.com>
<mailto:jdien07@mac.com>
Phone: 202-297-8117
http://joedien.com//
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu
<mailto:greve@nmr.mgh.harvard.edu><mailto:greve@nmr.mgh.harvard.edu>
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs:surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
<http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
FileDrop:https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
Outgoing:ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
University of Maryland
E-mail:jdien07@mac.com <mailto:jdien07@mac.com><mailto:jdien07@mac.com>
Phone: 202-297-8117
http://joedien.com//
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs:surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
<http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
FileDrop:https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
<http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
Outgoing:ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--------------------------------------------------------------------------------
Joseph Dien, PhD
Senior Research Scientist
Maryland Neuroimaging Center
University of Maryland, College Park
E-mail: jdien07@mac.com <mailto:jdien07@mac.com>
Cell Phone: 202-297-8117
http://joedien.com
-- Douglas N. Greve, Ph.D.MGH-NMR Centergreve@nmr.mgh.harvard.eduPhone Number: 617-724-2358Fax: 617-726-7422Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReportingFileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2www.nmr.mgh.harvard.edu/facility/filedrop/index.htmlOutgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/_______________________________________________Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--------------------------------------------------------------------------------
Joseph Dien, PhD
Senior Research Scientist
Maryland Neuroimaging Center
University of Maryland, College Park
addressed. If you believe this e-mail was sent to you in error and the e-mail
http://www.partners.org/complianceline . If the e-mail was sent to you in error
dispose of the e-mail.