Skip to content

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

@kavmar

Description

@kavmar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions