Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rt_utils/ds_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def add_study_and_series_information(ds: FileDataset, series_data):
ds.StudyDescription = getattr(reference_ds, "StudyDescription", "")
ds.SeriesDescription = getattr(reference_ds, "SeriesDescription", "")
ds.StudyInstanceUID = reference_ds.StudyInstanceUID
ds.SeriesInstanceUID = generate_uid() # TODO: find out if random generation is ok
ds.SeriesInstanceUID = reference_ds.SeriesInstanceUID

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe your solution here is correct. The new images should be part of the previous study.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hjmjohnson Thanks for having a look at this! Would you mind reviewing this so it can be merged in a later release?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change would violate the DICOM standard, see https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.8.html#sect_C.8.8.1.1

since RTstruct "Modality" tag is "RTSTRUCT", compared to the reference dataset which has "CT" modality, and it is not allowed to mix two modalities in the same series-instance-uid.

@code-lukas if this is the case, could you report this bug to RayStation? They usually reply quickly to bug reports.

fyi @lassoan

ds.StudyID = reference_ds.StudyID
ds.SeriesNumber = "1" # TODO: find out if we can just use 1 (Should be fine since its a new series)

Expand All @@ -98,7 +98,7 @@ def add_patient_information(ds: FileDataset, series_data):

def add_refd_frame_of_ref_sequence(ds: FileDataset, series_data):
refd_frame_of_ref = Dataset()
refd_frame_of_ref.FrameOfReferenceUID = getattr(series_data[0], 'FrameOfReferenceUID', generate_uid())
refd_frame_of_ref.FrameOfReferenceUID = getattr(series_data[0], 'FrameOfReferenceUID', generate_uid())
refd_frame_of_ref.RTReferencedStudySequence = create_frame_of_ref_study_sequence(series_data)

# Add to sequence
Expand Down