Closed jinkoo2 closed 1 year ago
Changing the first code block to the following made my code start working... code repo not updated at github... donno how...
From
def add_refd_frame_of_ref_sequence(ds: FileDataset, series_data):
refd_frame_of_ref = Dataset()
refd_frame_of_ref.FrameOfReferenceUID = generate_uid() # TODO Find out if random generation is ok
refd_frame_of_ref.RTReferencedStudySequence = create_frame_of_ref_study_sequence(series_data)
...
To
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.RTReferencedStudySequence = create_frame_of_ref_study_sequence(series_data)
...
Hi Jinkoo, when we first created this library, we made the assumption that any ROI's added would be contained within a new FrameOfReferenceUID, not an existing one. I'm thinking as a fix, we could add another parameter to the RTStruct builder in order for users to input a their own frame of reference uid. Otherwise, it would just create a new one. What do you think?
An ROI created based on an image would normally share the same FOR of the base image. I modified the code already for my application, so I am good. I am not quite familiar with Git, so I didn't publish it, but I believe I made a post re: what & where I modified. Thank you.
On Wed, Aug 25, 2021 at 11:03 PM Asim Shrestha @.***> wrote:
Hi Jinkoo, when we first created this library, we made the assumption that any ROI's added would be contained within a new FrameOfReferenceUID, not an existing one. I'm thinking as a fix, we could add another parameter to the RTStruct builder in order for users to input a their own frame of reference uid. Otherwise, it would just create a new one. What do you think?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qurit/rt-utils/issues/29#issuecomment-906054646, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJP72GKZBBUP2QETBOJOSDT6WVHXANCNFSM5COQCGIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
I'm writing to second the opinion of the OP. In our experience, when an RTSTRUCT is created it needs to be associated with a "parent" DICOM image set. It is customary, and multiple image viewing platforms rely on the convention, that the RTSTRUCT will have the same FrameOfReferenceUID as the parent DICOM series the contours are to be displayed over.
This commit solved my problem, too. Please merge it into main. Is there any reason to use a random FrameOfReferenceUID instead of the real referenced one?
I agree with @locastre and @jinkoo2 , this is how CTs and structure sets are usually linked in DICOM. Most treatment planning systems will complain if those 2 tags don't match.
Thanks for the input folks! Will ensure this gets pushed in later today
It sounds like a good alternative... Or, by default use the FOR of the base image for the new ROI unless provided. Either way should be okay. Thank you!
On Wed, Aug 25, 2021 at 11:03 PM Asim Shrestha @.***> wrote:
Hi Jinkoo, when we first created this library, we made the assumption that any ROI's added would be contained within a new FrameOfReferenceUID, not an existing one. I'm thinking as a fix, we could add another parameter to the RTStruct builder in order for users to input a their own frame of reference uid. Otherwise, it would just create a new one. What do you think?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qurit/rt-utils/issues/29#issuecomment-906054646, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJP72GKZBBUP2QETBOJOSDT6WVHXANCNFSM5COQCGIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
Hi my code is simple, like below. It runs fine, but I see the FrameOfRefernceUID in the output file (RS.new.dcm) is difference from the FrameOfRefceUID of the reference CT dicom series. So, I cannot import the RS file to my application. Is this a bug?... any suggestion would be greatly appreciated. Thanks! Jay.