AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.18k stars 497 forks source link

How to extract features from GLRLM using PyRadiomix library for a .jpg image #678

Closed sk-mohiuddin closed 2 years ago

sk-mohiuddin commented 3 years ago

I am unable to extract GLRLM features using the PyRadiomix library for a .jpg file. It has a mask input, which is not clear to me.

I have used below code

import SimpleITK as sitk from radiomics import glrlm from radiomics import featureextractor image = sitk.ReadImage('D:\Desert.jpg', sitk.sitkInt8) extractor = featureextractor.RadiomicsFeatureExtractor() extractor.disableAllFeatures() extractor.enableFeatureClassByName('glrlm') result = extractor.execute(image, ******)

What will be the 'maskFilepath' input at the last line as a second argument of the execute method?

yuandongbo123 commented 3 years ago

you can transpose the .jpg to nii.gz

JoostJM commented 2 years ago

Be aware that .jpg has no geometrical information (like pixel spacing). This may result in incorrect values for certain features (especially shape features).