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

ImportError: cannot import name 'clean_pixel_data' from 'deid.dicom.pixels' #233

Closed
NirutaDhimal opened this issue Oct 8, 2022 · 9 comments

Comments

@NirutaDhimal
Copy link

NirutaDhimal commented Oct 8, 2022

I am trying to import clean_pixel_data from deid.dicom.pixels but I got the importError.
And a quick question, Is it better to use DicomCleaner or clean_pixel_data while implementing multithreading?
eer1
eer2

@vsoch
Copy link
Member

vsoch commented Oct 8, 2022

What exactly is the error? I cannot reproduce.

@NirutaDhimal
Copy link
Author

Its an ImportError: cannot import name 'clean_pixel_data' from 'deid.dicom.pixels'

@vsoch
Copy link
Member

vsoch commented Oct 8, 2022

okay - so look in the content of deid/dicom/pixels/__init__.py what is there?

@vsoch
Copy link
Member

vsoch commented Oct 8, 2022

I'm wondering if it's about your install or environment, because here is the import for me:

image

@NirutaDhimal
Copy link
Author

This is the content of init.py. It doesn't have clean_pixel_data.
eer3

@vsoch
Copy link
Member

vsoch commented Oct 8, 2022

Why is the function deleted? Look at the master branch it should be there.

https://github.com/pydicom/deid/blob/master/deid/dicom/pixels/__init__.py

@NirutaDhimal
Copy link
Author

I don't know why it is deleted. I haven't touched it. I installed deid 0.2.33 version using pip. I added the clean_pixel_data in the init file.
err4
But I got another error
err5
I think clean_pixel_data function is not present in clean.py file
I will try to run it again after I reinstall the module.

@NirutaDhimal
Copy link
Author

Hi @vsoch Its working after I installed deid module of version 0.2.37. Thanks for helping me again. I really appreciated it :)

@vsoch
Copy link
Member

vsoch commented Oct 8, 2022

Sure thing! If you get an error like this in the future, a good way to debug is to sanity check things - e.g., if it's telling you that you can't import something, look there to see if the function name exists (as we did). And then compare your version against the latest in version control, or if it were something else (e.g, let's say you were running things with multiprocessing) you could try the same commands in a more vanilla environment. Glad to help!

@vsoch vsoch closed this as completed Oct 8, 2022
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

2 participants