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
2D-feature extraction #242
Comments
@HIN0209 it should "just work" automatically. When your input is a 2d image, it should be read as a 3d image with the 3rd dimension size 1. |
Thank you for the reply. So far, it did not work. Here are how I did. Is this error anything to do with 2D mask or an incorrect nrdd file created by slicer? |
@HIN0209, @fedorov, I think that if you load a .jpg of a .tiff image with @fedorov, do you know of a SimpleITK Image filter to expand dims? Otherwise it would be possible through the numpy array:
However, note that with .jpg, no information is present on voxel spacing, direction, origin, etc. Therefore, no shape descriptors should be calculated. |
@HIN0209, what does the "pyradiomics --help" show as output? specifically the "usage" part. It appears to be a problem in the argument parsing. Some possible causes:
|
Thanks. |
Does the script work when using in combination with a testcase and mask (contained in the "data" directory)? |
It works completely fine with the combination of brain1_image and brain1_label in the provided data folder. |
@HIN0209 try enclosing the path in quotes |
Yes, I put my own files separated from where pyradiomics was located. Then, I moved my own image and mask files to the pyradiomics/data folder, the following was shown. C:\Users\NAME>pyradiomics C:\pyradiomics\data\10_1.nrrd C:\pyradiomics\data\10_1_mask.nrrd |
@JoostJM I found the answer!
|
I checked the dimension of the test image and was (580,420,120), different from (580,420,1) in the mask. It could be due to slicer, so I try the image3d option and see how it works. |
@HIN0209 if you generate your mask in Slicer, why don't you try using SlicerRadiomics extension? It should help take care of this kind of issues. Have you tried it? How did you create and save mask in Slicer? |
Thank you both for great advises! With Slicer, I loaded a (580,420) tif file. |
Thank you! I did not notice the Slicer option. It worked just fine. Installation of SlicerRadiomics extension is a little bit too much, with so many processes to build from source, such that I can stick with the above two options. |
Very soon we will integrate SlcierRadiomics as a packaged extension, so you will be able to install it without having to build anything. Stay tuned! |
Hi Joost and Andrey, Thanks, |
I think if your image has just one slice, it should be the same, but I can't tell for sure. To force 2D extraction, you can use Does this answer your question? |
I think so. Thanks Andrey! |
@durgeshkdwivedi, there are some marked differences in the formulas. most notably the sphericity etc, in 3D, it is compared to a sphere, in 2D to a circle. For example, if you have a ROI of a perfect sphere in 2D, the shape 2D will reflect is as being most compact. In 3D, the ROI is interpreted as a sort of flat disc, which is less compact than a sphere. |
Hello I am trying to use Py radiomics library to compute GLSZM features on 2D images of rocks. I am facing problem to extract features using 2D images. It always gives an error attached below: Thanks ~\anaconda3\envs\py35\lib\site-packages\radiomics\shape.py in init(self, inputImage, inputMask, **kwargs) AssertionError: Shape features are only available in 3D. If 2D, use shape2D instead |
In FAQs/"What modalities does PyRadiomics support?", 2D-feature extraction was explained as follows:
3D or slice: Although PyRadiomics supports single slice (2D) feature extraction, the input is still required to have 3 dimensions (where in case of 2D, a dimension may be of size 1).
http://pyradiomics.readthedocs.io/en/latest/faq.html
Could someone describe more clearly what needs to be done? I plan to extract texture features from a single ultrasound image and its mask (directly from jpg or tiff format).
The text was updated successfully, but these errors were encountered: