Print

Print


V=spm_vol(P); --> this gives you the header info of a nifit file.
[Y,XYZ]=spm_read_vols(V); --> this gives you the XYZ coordinates in mm and
Y is the data in 4D form.
V = spm_write_vol(V,Y); --> this will create a nifti file with the name
V.fname.


If you only have XYZ and V, then you have no data to write to a file. Also,
if you have values at each location in XYZ, then you'd need to transform
those into a 3D/4D matrix for writing out a file. If you had a 3D/4D matrix
to write out, then I'd do the following:
V.fname='newfile.nii'
V = spm_write_vol(V,newY);

This will output a nifti file for you.

For a 4D image, then you need use V(n) to write out each volume using a for
loop and need to make sure that V(n).n=[n 1];.

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 Fri, May 15, 2015 at 12:47 AM, <[log in to unmask]> wrote:

> Thank you for this convenient way! Completely forgot.
> But nevertheless is any possibility to make .img- or .nii-file out of two
> mat matrixes (XYZ and V) being results of spm_vol?
> Thank you!
>
> σ ΥΧΑΦΕΞΙΕΝ,
> σΟΛΟΜΟΧ πΑΧΕΜ
>
> 2015-05-14 22:19 GMT+03:00 MCLAREN, Donald <[log in to unmask]>:
>
>> Assuming that you have a map for each subject indicating which voxels are
>> active in each subject (active voxel has a value of 1, all other voxels
>> have a value of 0), you can use imcalc to create a sum image of all your
>> subjects. The sum image would indicate the number of active subjects at
>> each voxel. Use the option to read data in as a matrix and the equation
>> should be sum(X).
>>
>> 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 Thu, May 14, 2015 at 12:24 AM, Pavel Sokolov <[log in to unmask]>
>> wrote:
>>
>>>
>>> Hello, Experts!
>>> Please, help.
>>> Advise some tool, script or method for backprojection. I want to make
>>> the map with scale (0, participants number ) indicating voxel activation
>>> frequency across subjects.
>>>
>>> Thank you,
>>> Pavel.
>>>
>>
>>
>