ImagingDataCommons / highdicom

High-level DICOM abstractions for the Python programming language
https://highdicom.readthedocs.io
MIT License
172 stars 37 forks source link

get_plane_positions_of_image returns list of pydicom.Sequence instead of highdicom.PlanePositionSequence #231

Closed thomas-albrecht closed 1 year ago

thomas-albrecht commented 1 year ago

The function get_plane_positions_of_image specifies that it should return a List[PlanePositionSequence]. Instead, the call item.PlanePositionSequence causes the return of a List[pydicom.Sequence].

That sequence has the name PlanePositionSequence but it is no instance of the class highdicom.PlanePositionSequence, which later can cause the error "Can only compare instances of PlanePositionSequence" when comparing plane positions in the seg/sop.py file.

I am planning to submit a merge request to fix this by using the function highdicom.PlanePositionSequence.from_sequence to convert the pydicom.Sequence to a highdicom.PlanePositionSequence.

CPBridge commented 1 year ago

Thanks @thomas-albrecht I look forward to receiving your PR

thomas-albrecht commented 1 year ago

Hi @CPBridge, the PR is in #232. Sorry for creating two issues for this.

I messed up the rebase of #232 so the new pull request is #240