I guess it uses an implicit brain mask, which assumes that zeros are
unknown values. By default though, it is not supposed to use implicit
brain masking (only if you do [Y,XYZ] = spm_read_vols(V_brainmask, 1);
). That's the behaviour with the SPM version I'm using.
Best regards,
-John
On 29 October 2010 16:01, Joćo Duarte <[log in to unmask]> wrote:
> Sorry if this is something basic, but
>
> Why do I get NaNs when I read the brainmask into Matlab with spm_vol and
> spm_read_vols? Shouldn't it have only values in [0,1] ? I simply do
>
> V_brainmask = spm_vol('brainmask.nii');
> [Y,XYZ] = spm_read_vols(V_brainmask);
>
> and Y contains NaNs...
>
> However, when I Display it in SPM, the brainmask has no problems, it has
> intensity values in [0,1].
>
> JD
>
> On Fri, Oct 29, 2010 at 12:01 PM, John Ashburner <[log in to unmask]>
> wrote:
>>
>> You could just multiply the images (voxel by voxel) using i1.*i2
>>
>> Best regards,
>> -John
>>
>> On 29 October 2010 11:51, Joćo Duarte <[log in to unmask]> wrote:
>> > Thank you for your help.
>> >
>> > One more question, now what should I write in the ImCalc expression? Can
>> > I
>> > do it for all my images at once?
>> > What I want to do is to be sure that all voxels outside the brain (those
>> > that have 0 value in the brain mask) have 0 intensity in the segmented
>> > images.
>> >
>> > Thank you for your help again.
>> >
>> > Best regards,
>> >
>> > JD
>> >
>> > On Fri, Oct 29, 2010 at 11:32 AM, John Ashburner <[log in to unmask]>
>> > wrote:
>> >>
>> >> You can reslice this brain mask (with NN interpolation) to be the same
>> >> size/orientation etc as your data. The reslice only option of Coreg
>> >> could be used for this.
>> >>
>> >> Best regards,
>> >> -John
>> >>
>> >> 2010/10/29 Joćo Duarte <[log in to unmask]>:
>> >> > Dear SPMers,
>> >> >
>> >> > how can I apply a brain mask to the segmented images originated with
>> >> > VBM8
>> >> > toolbox. I know that spm8\apriori includes a brainmask.nii but this
>> >> > image
>> >> > has different size and voxel size than those that are output from
>> >> > VBM8
>> >> > Estimate and Write module.
>> >> >
>> >> > Is there a way I can put this brainmask.nii in the same space as the
>> >> > new
>> >> > segmented images? Or is there a new brainmask with this size?
>> >> >
>> >> > Thank you for your help.
>> >> >
>> >> > Best regards,
>> >> >
>> >> > Joćo Duarte
>> >> >
>> >
>> >
>
>
|