Mark,
> I have a gray matter mask and I want to know it's voxel numbers and total size. How can I get that in SPM?
> I tried prod(size(find(V))) where V is the mask image file, bit it didn't work.
the three most useful commands within spm that allow you to get image
properties are spm_select (interactively select files), spm_vol (get
basic properties of an image volume and produce a handle that can be
passed), and spm_read_vols(reads in image files defined by a handle).
You can then combine them as in
img = spm_select(1, 'image', 'Please select the image');
V = spm_vol(img);
vol = spm_read_vols(V);
You can now get the size of the image volume by looking at either V.dim
or using size(vol). Now that the image is a matrix in memory, you can
play with it as much as you like, as in sum(sum(sum(vol > 0))) or so.
Hope this helps,
Marko
--
____________________________________________________
PD Dr. med. Marko Wilke
Facharzt für Kinder- und Jugendmedizin
Leiter, Experimentelle Pädiatrische Neurobildgebung
Universitäts-Kinderklinik
Abt. III (Neuropädiatrie)
Marko Wilke, MD, PhD
Pediatrician
Head, Experimental Pediatric Neuroimaging
University Children's Hospital
Dept. III (Pediatric Neurology)
Hoppe-Seyler-Str. 1
D - 72076 Tübingen, Germany
Tel. +49 7071 29-83416
Fax +49 7071 29-5473
[log in to unmask]
http://www.medizin.uni-tuebingen.de/kinder/epn/
____________________________________________________
|