Skip to content

Imaging Format Compatibility  #16

@tgd15

Description

@tgd15

Currently, the Topology Radiomics packages only supports nifty (.nii) images via nibabel.

Sometimes, the labs use the .mha or .mhd imaging formats. Could you please add SimpleITK and/or NumPy support in the compute_morphology_features function to expand imaging format compatibility?

SimpleITK example:

volume = sitk.ReadImage("/path/to/volume.mha") # vol type is SimpleITK.SimpleITK.Image
features = rad.compute_morphology_features(volume, config)

NumPy Array from SimpleITK example:

volume = sitk.ReadImage("/path/to/volume.mha")
volume_np = sitk.GetArrayFromImage(volume) # vol_np type is numpy.ndarray
features = rad.compute_morphology_features(volume_np, config)

To pass a NumPy array from SimpleITK into the compute_morphology_features function, I made the following change:

def compute_morphology_features(mri_mask_voxels: BinaryVoxelMask,
                                config: MorphologyConfig = MorphologyConfig()) -> MorphologyFeatures:
    #mask = mri_mask_voxels.mri_voxel_mask # commented this line out because NumPy array does not have this object
    mask = mri_mask_voxels

Metadata

Metadata

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