ai4med.libs.writers package

3.1
class NiftiWriter(dtype='float32', use_identity=False, compressed=True, revert_canonical=False, transpose_axes=None, squeeze=False)

Bases: ai4med.libs.transforms.multi_format_transformer.MultiFormatTransformer

Write nifti files to disk.

Parameters
  • use_identity (bool) – If true, affine matrix of data is ignored. (Default: False)

  • compressed (bool) – Should save in compressed format. (Default: True)

  • revert_canonical (bool) – Reverse canonical on values or not (Default: False)

write(img: ai4med.common.medical_image.MedicalImage, file_basename)

Write Nifti file from given data.

Parameters
  • img – MedicalImage containing data.

  • file_basename (str) – path for written nifti file.

Returns

Nothing. Saves the nifti file to disk if successful.

image_file_name(basename, compressed)
© Copyright 2020, NVIDIA. Last updated on Feb 2, 2023.