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

Creating contour sequences with SOPInstanceUID instead of using the MediaStorageSOPInstanceUID #34

Closed
smichi23 opened this issue Jan 2, 2022 · 1 comment · Fixed by #37

Comments

@smichi23
Copy link
Contributor

smichi23 commented Jan 2, 2022

Hi,

First of all, you did an impressive work on this package!

I simply wanted to ask if there was a specific reason behind building the contour sequence around the MediaStorageSOPInstanceUID.

If not, adding an optional argument in order to switch between MediaStorageSOPInstanceUID and SOPInstanceUID could maybe be useful for users.

To give you additional context, here is small change I had to do in order to be able to add a new contour to an existing RTSTRUCT file with respect to the original structure.

In ds_helper.py

def create_contour_image_sequence(series_data) -> Sequence:
contour_image_sequence = Sequence()

# Add each referenced image
for series in series_data:
    contour_image = Dataset()
    contour_image.ReferencedSOPClassUID = series.file_meta.MediaStorageSOPClassUID
    contour_image.ReferencedSOPInstanceUID = series.file_meta.MediaStorageSOPInstanceUID
    contour_image_sequence.append(contour_image)
return contour_image_sequence

became

def create_contour_image_sequence(series_data) -> Sequence:
contour_image_sequence = Sequence()

# Add each referenced image
for series in series_data:
    contour_image = Dataset()
    contour_image.ReferencedSOPClassUID = series.SOPClassUID
    contour_image.ReferencedSOPInstanceUID = series.SOPInstanceUID
    contour_image_sequence.append(contour_image)
return contour_image_sequence

Thank you again for this amazing work!

@asim-shrestha
Copy link
Contributor

asim-shrestha commented Jan 5, 2022

Hi @smichi23 thank you for your kind words and for going ahead and making a pull request! I will take a deeper look at it all by Friday and hopefully get it pushed in :)

Lets carry this conversation there as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants