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.17k stars 497 forks source link

EMERGENCY QUESTION! What is the difference between "The labels that come from Connected Component Analysis" in radiomics, AND the regions that come from skimage.measure.regionprops #607

Closed mozdag closed 4 years ago

mozdag commented 4 years ago

I extract my labels using Connected Component Analysis from the mask image for Radiomics features; let's say it extracts 281 cells in an image. However, those regions can be generated by skimage.measure.regionprops. So, are they going to be the same regions and same number of cells?

mozdag commented 4 years ago

skimage.measure.regionprops finds 480 cells in the image, however sitk.connected_components finds 353! Can we use regionprops for Radiomics features??

fedorov commented 4 years ago

You could experiment with FullyConnectedOn/Off (see https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1ConnectedComponentImageFilter.html#abb619f7dc1f9769582104f6deba0f776) - perhaps the difference is due to how default connectivity is defined in skimage and SITK.

mozdag commented 4 years ago

You could experiment with FullyConnectedOn/Off (see https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1ConnectedComponentImageFilter.html#abb619f7dc1f9769582104f6deba0f776) - perhaps the difference is due to how default connectivity is defined in skimage and SITK.

Yes, I have tried that FullyConnectedOn/Off but still same 353 cells. I have also tried different numbers from 5 to 125 for settings['binWidth'] and settings['minimumROISize'] but each time 353 cells. I don't know how? please help. Does RADIOMICS allow us to use skimage.regionprops for labeling instead of sitk.ConnectedComponents?

fedorov commented 4 years ago

I do not have any experience with skimage. SITK or skimage forums are probably the right place to ask about the differences.

pyradiomics requires the input to be an SITK image, since SITK image contains geometry information that is critical for meaningful calculation of radiomics features from clinical data. It is probably easy to go from skimage to SITK image, since in your case image geometry is not important (it is probably uniform resolution, and hopefully you know what that resolution is). You may want to check SITK documentation for how images can be imported from alternative representations.