Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pyradiomics for shape feature extraction? #349

Closed
stevenagl12 opened this issue Feb 28, 2018 · 9 comments
Closed

Using pyradiomics for shape feature extraction? #349

stevenagl12 opened this issue Feb 28, 2018 · 9 comments

Comments

@stevenagl12
Copy link

I have a bunch of meshes that I would like to extract all of the shape features through pyradiomics from. I do not have image data however. I am wonder how to use the shape.py to extract features from these meshes.

@fedorov
Copy link
Collaborator

fedorov commented Feb 28, 2018

pyradiomics will only operate on image+voxel label. You can discretize your surface mesh and use the result both as a label and as the input image. Would this be an option for you?

@stevenagl12
Copy link
Author

stevenagl12 commented Feb 28, 2018 via email

@fedorov
Copy link
Collaborator

fedorov commented Feb 28, 2018

You can use 3D Slicer to import the mesh (is it a volumetric or surface mesh?) as a "segment", and then convert segment into labelmap representation.

It may actually be even simpler - you can install Radiomics extension in Slicer, and then it can take the Segment directly as the definition of the label. You still would need to have some image as input, but it can be any image as long as it overlaps with the surface, since you are only interested in the shape features.

image

@stevenagl12
Copy link
Author

stevenagl12 commented Feb 28, 2018 via email

@stevenagl12
Copy link
Author

stevenagl12 commented Feb 28, 2018 via email

@fedorov
Copy link
Collaborator

fedorov commented Feb 28, 2018

I am sure there are other packages, but I would script using Slicer functionality. I can't recommend any specific other package.

If you want to use Slicer for this conversion, you can look into this function that does conversion for a segment into labelmap representation: https://github.com/Radiomics/SlicerRadiomics/blob/master/SlicerRadiomics/SlicerRadiomics.py#L509. You can write a python script to be invoked via Slicer --python-script, and it will have access to all of the Slicer logic.

Few more resources:

Let us know about your progress

@stevenagl12
Copy link
Author

stevenagl12 commented Feb 28, 2018 via email

@fedorov
Copy link
Collaborator

fedorov commented Feb 28, 2018

Yes, you can script import, conversion and export, but there is a learning curve, definitely.

How about you start looking over the resources I mentioned above, and also this one: https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#Where_can_I_find_example_scripts.3F (referenced from the python scripting FAQ), and see how that goes?

If I were you, I would also just do the conversion and run pyradiomics for a couple of cases using Slicer GUI, just to get a sense if you get what you expect, before investing the effort into scripting and conversion of 1000 meshes.

@pieper
Copy link
Contributor

pieper commented Feb 28, 2018

@stevenagl12 I'll second Andrey's suggestion: if you are new to python programming you will be much better off starting with the GUI to implement the end-to-end analysis on a few cases. Once you can write down the exact steps that give you useful data it will be (mostly) trivial to write a script to implement it for your 1000 cases. Plus Slicer's user interface will provide a convenient way to do visual debugging and quality assurance as you develop your script.

@JoostJM JoostJM closed this as completed Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants