Open tgd15 opened 3 years ago
Tagging @neshdev and @robtoth to incorporate.
@tgd15 - I just looked over the code and realized that we wanted to make the package bare bones. We planned to only support numpy arrays. Loading of other MRI images would be done by some external functions and packages written by the user of the package. For example, the code you have above can convert to numpy arrays from SimpleITK formats.
However, looking at the code above, it looks like you are using the function incorrectly
It could be something like this:
import topology_radiomics as rad
sitk_volume = sitk.ReadImage("/path/to/volume.mha")
volume = sitk.GetArrayFromImage(volume)
sanitized_voxels = rad.convert_volume_into_mask(
volume, merge_labels=[])
features_data = rad.compute_morphology_features(sanitized_voxels)
or something like this:
import topology_radiomics as rad
sitk_volume = sitk.ReadImage("/path/to/volume.mha")
volume = sitk.GetArrayFromImage(volume)
sanitized_voxels = rad.BinaryVoxelMask(volume)
features_data = rad.compute_morphology_features(sanitized_voxels)
We have some references for loading data and using other packages in the tutorial notebooks: NiBabel: https://github.com/radxtools/topology-radiomics/blob/master/notebooks/Tutorial%20-%20Getting%20started%20with%20topoplogy_radiomics.ipynb
If you want, we can add another notebook for SimpleITK.
Hello, i am trying to use this for extracting topology features from a CT scan. but i am getting an error "AttributeError: 'numpy.ndarray' object has no attribute 'mri_voxel_mask'" when i pass numpy array, so i wanted to ask if this is only for MRI scans or can i use this for CT Scans too.
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:
NumPy Array from SimpleITK example:
To pass a NumPy array from SimpleITK into the
compute_morphology_features
function, I made the following change: