hdr=spm_vol('GreyMatterImageFilename');
[Y,XYZ] = spm_read_vols(hdr);
Ym=Y(:).*prod(sqrt(sum(hdr.mat(1:3,1:3).^2)));
OUT=[Ym; XYZ'];
OUT will have the value you asked for c1 values multiplied by voxel
size in column 1 and then the XYZ coordinates in the next 3 columns.
However, I don't see much value in this script as it doesn't tell you
anything about which voxels are grey matter. The size of Y is the
number of voxels in the entire image.
I guess you might want to do something like:
OUT=OUT(Y(:)>.25);
This will give you the voxels that are more than 25% grey matter.
Hope this helps.
Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Research Fellow, Department of Neurology, Massachusetts General Hospital and
Harvard Medical School
Postdoctoral Research Fellow, GRECC, Bedford VA
Website: http://www.martinos.org/~mclaren
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
intended only for the use of the individual or entity named above. If the
reader of the e-mail is not the intended recipient or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at (773)
406-2464 or email.
On Mon, Jan 28, 2013 at 7:19 PM, SUBSCRIBE SPM Anonymous
<[log in to unmask]> wrote:
> Hello,
>
> I need to write a script that could give me grey matter values for each voxel. I found a script for computing the total volume of grey matter, which apparently sums the values in a "c1" image and then multiplies this by the volume of each voxel. I was thinking perhaps for my purposes what I should do is write a script that multiplies each value in a c1 image by the voxel volume (so without summing these values first). Then I'd want the output to give these values alongside of their coordinates. Would any of you have any ideas as to how to write a script for this?
>
> Thank you.
|