Hi
The finite function does not appear to exist at least in Version 7.x of
Matlab (I don't know about 6.5.x), so I suggest the following code instead
of the one below (I ran this by John)
VN.dat(isnan(VN.dat)) = 0;
best regards,
darren
>
> > -----Original Message-----
> > From: SPM (Statistical Parametric Mapping)
> [mailto:[log in to unmask]]
> > On Behalf Of Ashburner John (PSYCHOLOGY)
> > Sent: Monday, May 07, 2007 8:02 AM
> > To: [log in to unmask]
> > Subject: Re: [SPM] NAN values in segmented Grey, White & CSF volumes
> >
> > These are probably modulated and warped tissue probability
> maps. The
> > NaNs are from regions for which there was no data available
> from the
> > original image. i.e. the point in spatially normalized
> space maps to
> > somewhere outside the FOV of the original volume.
> >
> > Fixing it would require a little change to the MATLAB code of
> > spm_preproc_write.m . At around line 161, you could try inserting
> >
> > Msk = find(~finite(VN.dat));
> > VN.dat(Msk) = 0;
> >
> > Best regards,
> > -John
> >
> > -----Original Message-----
> > From: SPM (Statistical Parametric Mapping)
> [mailto:[log in to unmask]]
> > On Behalf Of Brain Apprentice
> > Sent: Friday, May 04, 2007 9:26 PM
> > To: [log in to unmask]
> > Subject: [SPM] NAN values in segmented Grey, White & CSF volumes
> >
> > Hello,
> >
> > I am using SPM5 to generate Grey, White & CSF segmented
> volumes. The
> > problem is that in all of these files there are a few pixels which
> > have a value of NAN.
> >
> > The fundamental problem here is that some of the float
> values at the
> > end of these volumes are not valid numeric representations for a
> > 32-bit float value, which Windows does not like at all. When I
> > examined the data as floats, the following occurs towards
> the end of
> > the volume.
> >
> > 15476220 0.000000e+00 0.000000e+00 nan nan
> > 15476240 nan nan nan nan
> > *
> > 15502760 nan nan 0.000000e+00 0.000000e+00
> > 15503000 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
> > *
> > 15503120 nan nan nan nan
> > *
> > 15503440 nan 0.000000e+00 0.000000e+00 0.000000e+00
> > 15503460 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
> > *
> > 15503760 0.000000e+00 0.000000e+00 nan nan
> > 15504000 nan nan nan nan
> > *
> >
> > The nan result comes from 32-bit words that are not a valid numeric
> > representation - in fact they have the specific bit pattern
> for NaN -
> > Not a Number. By the IEEE 754 floating point standard, NaNs are
> > represented with the exponent field filled with ones and
> bit 22 set in
> > the mantissa:
> >
> > NaN bit pattern (without sign bit) = 1111 1111
> axxxxxxxxxxxxxxxxxxxxxx
> >
> > Having said all this is there a way in SPM to eliminate, filter or
> > restrict the volumes created so that the NAN values do not
> end up in
> > the volumes but are replaces by some arbitrary or fixed
> numeric value.
> >
> > Thanks,
> >
> > BA
> >
|