Skip to content

oldmin and oldmax required for NHDRs pertinent to intensity calibrated NIFTI images #2

@tashrifbillah

Description

@tashrifbillah

Nifti1 has scl_slope and scl_inter. The equivalent attributes in the Nrrd are oldmin and oldmax. However, we don't have support for oldmin and oldmax in Pynrrd if they are present in intensity calibrated images (for relative intensity images, they are ignored).

In NIFTI-->NRRD conversion old_min and old_max are calculated as follows:
datatype= nifti1.header.datatype
scl_slope= nifti1.header.scl_slope
scl_inter= nifti1.header.scl_inter

oldmin=(datatype_min)*scl_slope + scl_inter
oldmax= (datatype_max)*scl_slope + scl_inter

NRRD voxels should be reported by recovering scl_slope and scl_inter from the NHDR header and then unquantizing NRRD voxels:

find scl_slope and scl_inter from above and
unquantized_data= quantized_data*scl_slope+scl_inter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions