NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.volumeutils.finite_range

Next topic

nibabel.volumeutils.pretty_mapping

Reggie -- the one

nibabel.volumeutils.make_dt_codes

nibabel.volumeutils.make_dt_codes(codes_seqs)

Create full dt codes Recoder instance from datatype codes

Include created numpy dtype (from numpy type) and opposite endian numpy dtype

Parameters :

codes_seqs : sequence of sequences

contained sequences make be length 3 or 4, but must all be the same length. Elements are data type code, data type name, and numpy type (such as np.float32). The fourth element is the nifti string representation of the code (e.g. “NIFTI_TYPE_FLOAT32”)

Returns :

rec : Recoder instance

Recoder that, by default, returns code when indexed with any of the corresponding code, name, type, dtype, or swapped dtype. You can also index with niistring values if codes_seqs had sequences of length 4 instead of 3.