Hi Marcos,
1. your fix of MRIread.m is great. I forgot of this bug; we should
totally take care of it.
2. a problem is that nu.mgz (or norm.mgz) and the posteriors are in
difference voxel space. So, you need to resample norm.mgz to the space
of the subfields. To do so, you can use mri_convert with the option -rl
("reslice like"):
mri_convert norm.mgz norm_resampled.mgz -rl posterior_subiculum.mgz
3. Now you can do:
A=MRIread('norm.mgz');
data=A.vol(:);
B=MRIread('posterior_subiculum.mgz');
post=double(B.vol(:));
mean=sum(data.*post)/sum(post);
variance=sum((data-mean).^2.*post)/sum(post);
Cheers,
/Eugenio
On Mon, 2013-06-10 at 17:17 -0300, Marcos Martins da Silva wrote:
> Hi, Eugenio
> TY for your fast help. I understood you were suggesting to compute
> that on MatLab and I tried this:
>
> NU=MRIread('nu.mgz') ### that runs ok
> Ps=MRIread('posterior_left_subiculum.mgz') ### it fails with the
> following message
> WARNING: error reading MR params
> Attempted to access mr_parms(1); index out of bounds because
> numel(mr_parms)=0.
>
> Error in MRIread (line 100)
> tr = mr_parms(1);
>
> I solved creating a little customized nMRIread.m with the following
> changes:
>
> if numel(mr_parms) > 0
> tr = mr_parms(1);
> flip_angle = mr_parms(2);
> te = mr_parms(3);
> ti = mr_parms(4);
> else
> mr_parms(1) = 0;
> mr_parms(2) = 0;
> mr_parms(3) = 0;
> mr_parms(4) = 0;
> tr = mr_parms(1);
> flip_angle = mr_parms(2);
> te = mr_parms(3);
> ti = mr_parms(4);
> end
>
> With those changes I assigned 0 to mr-parms elements so it runs
> without errors
> But whe I tried the following line I copy and pasted from your
> message:
> mean=sum(Ps.*NU)/sum(Ps); ### I got the following error
> Undefined function 'times' for input arguments of type 'struct'.
>
> Any help?
> Cheers, Marcos
>
> PS: I promised I will post the final solution to list. But I guess it
> is more didactic if these little problems are solved before.
> TY, again.
> Em Seg, 2013-06-10 às 14:19 -0400, Juan Eugenio Iglesias escreveu:
> > Hi Marcos,
> > the right way of doing this is using the soft posteriors to compute the
> > mean and variance, rather than thresholding at p=0.5. For instance, if
> > you wanted to compute the mean and variance of the intensitites of the
> > subiculum, you would do something like this:
> > mean=sum(Ps.*NU)/sum(Ps);
> > variance=sum(Ps.*(NU-mean).^2)/sum(Ps);
> > (where Ps is the posterior of the subiculum)
> > Cheers,
> > /Eugenio
> >
> >
> >
> > On Mon, 2013-06-10 at 15:12 -0300, Marcos Martins da Silva wrote:
> > > Hi, Freesurfer Experts
> > >
> > > After usual processing with recon-all -all we get the aseg.stats file
> > > with several data including intensity values like:
> > > normMean normStdDev
> > > normMin normMax normRange
> > > Left-Hippocampus 77.8939 7.5748 46.0000
> > > 105.0000 59.0000
> > >
> > > How could I get similar results for each hippocampal subfield,
> > > assuming I also generated all posterior*.mgz files corresponding to
> > > each subfield?
> > > I guess I should first binarize each of the subfields file with a
> > > threshold=127 to map all the pertinent voxels, and then use these
> > > files as masks over nu.mgz and calculate the intensities values. But I
> > > do not know the best way to accomplish this after the binarize step.
> > >
> > > Thank you in advance for any help.
> > >
> > > Marcos
> > > _______________________________________________
> > > Freesurfer mailing list
> > > [email protected]
> > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> >
>
--
Juan Eugenio Iglesias, PhD
http://www.jeiglesias.com
[email protected]
Athinoula A. Martinos Center for Biomedical Imaging
149 Thirteenth Street, Suite 2301
Charlestown, Massachusetts 2129
U.S.A.
_______________________________________________
Freesurfer mailing list
[email protected]
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.