Thanks, that's really useful also for the rest of us.
Cheers,
Cornelius
On Thu, Feb 2, 2012 at 4:27 PM, Michael Harms <[log in to unmask]> wrote:
> Hi Rosalia,
>
> You can compute the spatial correlation within a user-defined mask using
> the following (in c-shell syntax):
>
> ######### Pearson's R correlation between two image volumes
> #############
>
> ## --- Compute the correlation from 1st principles
> ## --- i.e., account for the mask when determining which voxels to
> include
> ## --- in the computation
> # Note that within the mask, we will treat 0's as valid data
> set M1 = `fslstats $img1 -k $mask -m`
> set M2 = `fslstats $img2 -k $mask -m`
>
> fslmaths $img1 -sub $M1 -mas $mask demeaned1 -odt float
> fslmaths $img2 -sub $M2 -mas $mask demeaned2 -odt float
> fslmaths demeaned1 -mul demeaned2 demeaned_prod
> set num = `fslstats demeaned_prod -k $mask -m`
>
> fslmaths demeaned1 -sqr demeaned1sqr
> fslmaths demeaned2 -sqr demeaned2sqr
> set den1 = `fslstats demeaned1sqr -k $mask -m`
> set den2 = `fslstats demeaned2sqr -k $mask -m`
> set denprod = `echo "scale=4; sqrt($den1*$den2)" | bc -l`
>
> # The mean can be used instead of the sum because the
> # factor N/sqrt(N*N) will cancel
> set true_r = `echo "scale=4; $num/$denprod" | bc -l`
>
> -----
>
> Or, AFNI has a function called '3ddot' that allows one to specify a mask
> file. (Be sure to use its -demean option if you want the correlation).
> Also, '3ddot' allows one to compute the eta^2 between two images if you
> are interested in that measure of spatial correspondence.
>
> cheers,
> -MH
>
>
>
> On Thu, 2012-02-02 at 16:10 +0100, Rosalia Dacosta wrote:
>> Dear Michael,
>>
>> I am using fslcc command too for making my correlations between
>> melodic_IC.nii.gz and metaICA_4mm.nii.gz template for identifying
>> anatomical and psychological components, discarding
>> artifacts ...so....in your opinion, what would be the best option?
>>
>> Cheers,
>>
>> Rosalia.
>>
>> 2012/2/2 Michael Harms <[log in to unmask]>
>> Hi David,
>> Note that fslcc includes ALL voxels in its calculation of the
>> spatial
>> "correlation" including voxels with 0's outside of the brain.
>> In my
>> opinion, this is not a meaningful estimate of the true spatial
>> correlation.
>>
>> cheers,
>> -MH
>>
>> On Thu, 2012-02-02 at 07:40 +0000, Stephen Smith wrote:
>> > Hi - I'm not sure which analysis you're referrring to, but
>> for simply
>> > matching up maps (as opposed, for example, to doing a
>> dualregression),
>> > yes we would probably just use fslcc
>> >
>> >
>> > Cheers.
>> >
>> >
>> >
>> >
>> >
>> > On 1 Feb 2012, at 18:33, David V. Smith wrote:
>> >
>> > > OK, great -- thanks for both sets of images! Can you also
>> verify
>> > > that one of the methods below is the way you guys perform
>> the
>> > > spatial cross-correlation?
>> > >
>> > > fsl_glm -i IC01.nii.gz -d PNAS_Smith09_rsn10_3mm.nii.gz -o
>> PE --
>> > > out_z=z_score -m mask.nii.gz
>> > > where IC01.nii.gz is just the first image in the
>> melodic_IC image
>> > > (fslroi melodic_IC.nii.gz IC01 0 1)
>> > >
>> > >
>> > > And then report the PEs as the correlation estimates? This
>> method
>> > > seems odd because of the extremely high z-scores and PEs
>> aren't
>> > > explicitly r values for a correlation...
>> > > [smith@node52 groupICA_AU]$ more PE
>> > > 0.24856 0.437975 -0.135177 -0.0728717 0.0331276
>> -0.0438093
>> > > -0.0734834 0.0104588 0.0270564 0.0727842
>> > > [smith@node52 groupICA_AU]$ more z_score
>> > > 91.2948 141.214 -41.624 -25.2608 10.92 -13.4459
>> -20.1861
>> > > 3.80642 9.4519 24.6514
>> > >
>> > >
>> > > Or did you guys use fslcc?
>> > > fslcc RSN02.nii.gz IC01.nii.gz (in the 3rd column, this
>> has 0.46 as
>> > > the correlation)
>> > > where RSN02.nii.gz is the second image in the RSN template
>> image
>> > > (fslroi PNAS_Smith09_rsn10_3mm.nii.gz RSN02 1 1)
>> > >
>> > >
>> > > If both methods are valid, is one preferred over the
>> other?
>> > >
>> > >
>> > > Thanks again!
>> > >
>> > >
>> > > Cheers,
>> > > David
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > On Feb 1, 2012, at 12:02 PM, Stephen Smith wrote:
>> > >
>> > > > Hi - Christian has put this online now:
>> > > > http://www.fmrib.ox.ac.uk/analysis/royalsoc8/
>> > > > Cheers.
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > On 1 Feb 2012, at 08:26, Stephen Smith wrote:
>> > > >
>> > > > > Hi, the RSN/BrainMap images are at
>> > > > > http://www.fmrib.ox.ac.uk/analysis/brainmap+rsns/
>> > > > > We were going to put the Beckmann 05 images on there
>> as well -
>> > > > > haven't gotten around to that yet…
>> > > > > Cheers
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > On 1 Feb 2012, at 06:58, David V. Smith wrote:
>> > > > >
>> > > > > > Hello,
>> > > > > >
>> > > > > > Did these RSN template maps (from the 2005 Beckmann
>> paper?)
>> > > > > > ever get posted to the web? I can't find any other
>> mention of
>> > > > > > it on the forums, and I'm not exactly sure where to
>> look on
>> > > > > > the FMRIB site.
>> > > > > >
>> > > > > >
>> > > > > > Thanks!
>> > > > > > David
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > > On Sep 6, 2011, at 12:13 PM, Stephen Smith wrote:
>> > > > > >
>> > > > > > > Hi - we've been meaning to put the brainmap/RSN
>> PNAS maps up
>> > > > > > > on the web for a while but keep not getting around
>> to it -
>> > > > > > > we'll try to get these up by the end of September.
>> > > > > > > Cheers.
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > > On 2 Sep 2011, at 06:37, Eva Kenny wrote:
>> > > > > > >
>> > > > > > > > Hi,
>> > > > > > > > I was planning on using the template matching
>> procedure on
>> > > > > > > > my Melodic data to identify ICs of interest and
>> wondered
>> > > > > > > > if there were template RSNs available?
>> > > > > > > > Many thanks,
>> > > > > > > > Eva
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> ---------------------------------------------------------------------------
>> > > > > > > Stephen M. Smith, Professor of Biomedical
>> Engineering
>> > > > > > > Associate Director, Oxford University FMRIB
>> Centre
>> > > > > > >
>> > > > > > > FMRIB, JR Hospital, Headington, Oxford OX3 9DU,
>> UK
>> > > > > > > +44 (0) 1865 222726 (fax 222717)
>> > > > > > > [log in to unmask]
>> http://www.fmrib.ox.ac.uk/~steve
>> > > > > > >
>> ---------------------------------------------------------------------------
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > > >
>> ---------------------------------------------------------------------------
>> > > > > Stephen M. Smith, Professor of Biomedical Engineering
>> > > > > Associate Director, Oxford University FMRIB Centre
>> > > > >
>> > > > > FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
>> > > > > +44 (0) 1865 222726 (fax 222717)
>> > > > > [log in to unmask]
>> http://www.fmrib.ox.ac.uk/~steve
>> > > > >
>> ---------------------------------------------------------------------------
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > >
>> > > >
>> > > >
>> ---------------------------------------------------------------------------
>> > > > Stephen M. Smith, Professor of Biomedical Engineering
>> > > > Associate Director, Oxford University FMRIB Centre
>> > > >
>> > > > FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
>> > > > +44 (0) 1865 222726 (fax 222717)
>> > > > [log in to unmask] http://www.fmrib.ox.ac.uk/~steve
>> > > >
>> ---------------------------------------------------------------------------
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>> >
>> ---------------------------------------------------------------------------
>> > Stephen M. Smith, Professor of Biomedical Engineering
>> > Associate Director, Oxford University FMRIB Centre
>> >
>> > FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
>> > +44 (0) 1865 222726 (fax 222717)
>> > [log in to unmask] http://www.fmrib.ox.ac.uk/~steve
>> >
>> ---------------------------------------------------------------------------
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
--
Cornelius Werner
cornelius.werner<at>gmail.com
|