-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Segment Misplacement #2833
Comments
It may help if you provide the link to the highdicom code you use to do the conversion. It is not clear if this is a problem with OHIF Viewer, highdicom, or the conversion code you wrote that uses highdicom. It would also be highly desirable if you could share a sample image series and the accompanying segmentation that allow reproduction of the issue. You can make for any public dataset if you are concerned about sharing your own data. |
I will try to provide some examples. I could already locate the problem:
This is the highdicom class for converting a mask (given a source image) to a segmentation dicom file. The default behaviour is to drop all empty slices. The structure of the segmentation can be reconstructed by the tag PerFrameFunctionalGroupsSequence, which holds the SOP for the correlating slice in the source image.
As long as a SourceImageSequence is provided along the segmentation it won't look up the correct position, buy place the segment planes along the first n planes of the stack. n would be the sum of all segment planes. A quick fix would be to never omit empty slices. |
dmcjs logic for parsing segmentation is the following:
|
empty slices should not be an issue, but my guess is that for your data dcmjs is using the logic (1A) and although empty slices are allowed, the frameNumber has to be built on the full images stack indexes |
Hi all, I am a highdicom developer who has worked extensively on the segmentation code. I have actually encountered this behaviour myself before also. Though unfortunately we never had time to dig into the root cause to get far enough to file an issue. It would be great if we could work together to figure out where the problem lies, and I'm happy to help out as I can. We believe that the segmentations that we are producing are correct, although of course we are open minded there being a mistake in highdicom. A few things to note:
@PHonest would it be quick for you to confirm that this occurs if and only if there are discontinuities within a single segment for your application? |
Does the issue only occur when there are multiple segments? |
No, I also saw this behavior when I visualized cases with a single segment |
FYI this method contains the logic that highdicom uses to reconstruct the segmentation mask for a list of source images when allowing for empty frames and multiple segments. It seems to be working for us so far. Might be worth checking that this gives the expected result for your case @PHonest . Then at least we'd know that highdicom is internally consistent, though it wouldn't rule out an incorrect (but internally consistent) implementation of the standard. I'm afraid I have no javascript experience so I'm finding it difficult to figure out what exactly the dcmjs code is doing differently |
if you think it is a bug at dcmjs level, it would be great if you can share public available data. we have few cases similar to yours in IDC, but the dcmjs logic works for those. However, it is true that dcmjs parses the indexes in 3 different ways (1A, 1B and 2 #2833 (comment)) and we may have never tested one of those with empty segmentation frames. |
Yes, we need a sample. Most of the segmentations in IDC were generated using dcmqi. We absolutely must make sure highdicom segmentations are valid, and if they are valid (which I do expect that are!) - that they work with OHIF. If we confirm this is an issue with OHIF/dcmjs, I am all for labeling this issue as a priority for IDC, and we can prioritize resources to fix it. |
I have the very same issue with OHIF viewer and want to add that Slicer3d with the QuantitativeReporting plugin renders the segmentation from |
That is good to know, thank you for adding this note @mlaves! QuantitativeReporting is using dcmqi for loading DICOM segmentations. |
This is a v2 legacy issue, no? |
Can you try again in the latest master branch? There are has been a lot of improvements in Segmentation handling Try viewer-dev.ohif.org instead of viewer.ohif.org |
Please re-open the issue when you have the data for us to test |
Hello,
I am trying to enable the visualization of segmentations. So far everything went smoothly.
I am converting segment masks with highdicom in a dicom segmentation format. When I visualized those segmentations in the viewer, I noticed that the segmentations are displayed in the wrong plane. Nonetheless, the inplane position seems to be correct.
Additionaly I am only noticing this behaviour on the first segment of each segmentation. The first one gets placed upfront on the first plane. The second one seems to be in the right plane.
Please let me know if more information is needed.
Thanks in advance,
Paul
The text was updated successfully, but these errors were encountered: