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

Error during implementation #95

Closed
pavi1303 opened this issue Dec 9, 2020 · 5 comments
Closed

Error during implementation #95

pavi1303 opened this issue Dec 9, 2020 · 5 comments
Labels
support Request for developer support in getting collageradiomics to run.

Comments

@pavi1303
Copy link

pavi1303 commented Dec 9, 2020

Hi,
I am running this in the Pycharm IDE. I created a collage object and then initialized an empty haralick image to then extract features from both angles using the calculate_haralick_textures function. But I'm not getting an ''Object has no attribute error" when initialising an empty variable. Then I had to proceed to get the statistics measure like mean, variance, skewness and kurtosis from these features. My image and mask files were in .mat (MATLAB) format and thus I imported them using the scipy.io library. Here is my code snippet,

import collageradiomics as crd
import numpy as np

Creating a collage object

collage = crd.Collage(vol_full, TI_mask)
collage.is_3D = True

Creating a haralick image variable

haralick_image = np.empty(collage.dominant_angles.shape + (13,))

Calculating features from both orientations

for angle in range(2):
haralick_image[:, :, :, angle, :] = collage.calculate_haralick_textures(collage.dominant_angles[:, :, :, angle])

It is showing me this error,
AttributeError: 'Collage' object has no attribute 'dominant_angles'

Where am I going wrong here? Any help would be highly appreciated.

@nathanhillyer
Copy link
Contributor

@pavi1303 That method isn't intended to be used publicly. We will push out an update that prefixes the method with an underscore for clarity.

What are you trying to accomplish? If you just want to calculate the haralick textures, I'd suggest using the mahotas library: https://github.com/luispedro/mahotas

@satishev
Copy link
Contributor

He’s trying to calculate COLLAGE feature for his image/ROI. @pavi1303 never checked — are you able to run the Jupyter notebook? The syntax should be in there (sample code to extract features from an image).

@nathanhillyer
Copy link
Contributor

Here is a link to that notebook: https://github.com/radxtools/collageradiomics/blob/master/jupyter/examples/example.ipynb

In order to calculate the COLLAGE feature for the image, you can do this:

collage = crd.Collage(vol_full, TI_mask)
collage.execute()

We'll be able to detect whether or not it is 3D internally, so no need to set that.

@pavi1303
Copy link
Author

I did check the sample jupyter notebook but did not implement it as a jupyter notebook, I did it in PyCharm. I'll check that out. Thanks.

@nathanhillyer
Copy link
Contributor

You're welcome. If you experience any further difficulties, please reopen this ticket. We're happy to help.

@nathanhillyer nathanhillyer added the support Request for developer support in getting collageradiomics to run. label Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Request for developer support in getting collageradiomics to run.
Projects
None yet
Development

No branches or pull requests

3 participants