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

[BUG] dicom_seg_writer_operator.py -> process_images(...) does not accept numpy array #510

Closed
kavmar opened this issue Jan 3, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@kavmar
Copy link

kavmar commented Jan 3, 2025

Hi,

I would like to result my app a DICOM SEG and I am trying to use dicom_seg_writer for it. This is how I emit the data from my segmentation operator:

emit_data = data[0]["pred"].cpu().numpy()
emit_data = np.squeeze(emit_data, 0)
emit_data = emit_data.T.astype(np.uint16)

op_output.emit(emit_data, self.output_name_seg)

I checked that the data is a numpy array in debugger. However, according to dicom_seg_writer_operator.py lines 291 a 292:

elif not isinstance(image, np.ndarray):
raise ValueError("'image' is not a numpy array, Image object, or supported image file.")

While lines before are trying to convert image to numpy the 291 will not pass even if the image is numpy.

Am I missing something?

@CPBridge as discussed in highdicom, you contributed this operator, could you please doublecheck?

Thanks

@CPBridge
Copy link
Collaborator

Hi @kavmar sorry it has taken me a while to get around to looking at this. I think somehow this got broken since I originally wrote it.

Can you see whether #515 fixes your problem?

@kavmar
Copy link
Author

kavmar commented Jan 15, 2025

Hi @CPBridge. Thanks a lot. Yes this is what I also did earlier on my local environment and it fixed the problem.

@kavmar kavmar closed this as completed Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants