-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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
Reactions are currently unavailable