[Neuroimaging] Nibabel API change - always read as float

Satrajit Ghosh satra at mit.edu
Wed Jul 22 14:40:36 CEST 2015


hi matthew,

Sorry, it's early here, but to me this looks as if ITK is explicitly
> treating 0 and 1 as the same:
>
> bool
> NiftiImageIO::MustRescale()
> {
> return std::abs(this->m_RescaleSlope) > std::numeric_limits< double
> >::epsilon()
> && ( std::abs(this->m_RescaleSlope - 1.0) > std::numeric_limits<
> double >::epsilon()
> || std::abs(this->m_RescaleIntercept) > std::numeric_limits< double
> >::epsilon() );
> }
>

MustRescale returns False if  this->m_RescaleSlope == 0 or
(this->m_RescaleSlope == 1 && this->m_RescaleIntercept == 0).

this boolean then gets used in the read function. i.e. under these
conditions data does not get scaled.

>
> > CIFTI/NIFTI2 library:
> >
> >
> https://github.com/Washington-University/CiftiLib/blob/master/Nifti/NiftiHeader.cxx#L115
>
> Same here surely?  It looks like they are setting the scaling to 1 if
> the slope is 0.
>

also returns false here, even though it sets it to 1 and 0, outside this
check it returns true.


> >
> > niftilib:
> >
> >
> http://anonscm.debian.org/cgit/pkg-exppsy/nifticlib.git/tree/niftilib/nifti1_io.c#n5438
>
> It does look like a different code path here, but do you know what
> effect if any this has on the subsequent processing?
>

here it doesn't do anything with scale or slope. leaves it to the developer.

cheers,

satra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150722/c50ba044/attachment.html>


More information about the Neuroimaging mailing list