[Neuroimaging] Getting scaling and offset from nifti header in nibabel

Matthew Brett matthew.brett at gmail.com
Mon Jan 4 09:47:15 EST 2016


On Mon, Jan 4, 2016 at 2:43 PM, Samuel St-Jean <stjeansam at gmail.com> wrote:
> That is a good question which I am also trying to find an answer to.
> Actually, what are the slope and inter field specifically referring to?
> I know that for some reason the scanner likes to recast everything between 0
> and 4096 (probably for storage reason), so you cannot mix and match
> acquisitions from the same session but acquired in different block because
> of that.
> Because of some scaling (which I think might be slope and inter), it also
> means that your magnitude/phase data has weird values (which make no sense
> for the phase data), but correcting for this scaling from the dicom headers
> fix it.
> This field (which has a private tag for philips, but I can try to dig it out
> from somewhere with pydicom) let's you indeed recover sane values, so I was
> wondering if it is related to the slope and inter field from the nifti file,
> thus no need to dig it out from the dicom. The whole point if this nifti
> field is the same as the one in the dicom, I could dump my custom,
> half-baked dicom converter for problematic files and just scale the
> converted nifti myself (provided a converter works, magnitude/phase data are
> so seldom used that I have no tool working on those, if anyone has
> suggestions.)
> Didn't know about the dataobj thing though, thanks for pointing it out.

The slope and inter fields are what was in the nifti header when you
loaded the image.

How those values came about will depend on how the niftis got
generated by your scanner or conversion, it's difficult to speculate
further.  You could have a look at the DICOM values and see how they
compare, but that might not give you a reliable answer,



More information about the Neuroimaging mailing list