Segmentation orientation export issue

Issue #17 resolved
Jacob Peoples created an issue

I’ve uploaded some images and segmentations using the roiuploadassistant. After importing the uploaded segmentation to OHIF (which displays with the correct orientation), I made some edits, and exported the segmentation.

If I then go back to the OHIF viewer, and import either of these segmentations, the results are correct. However, if I download the DICOM data for the subject, and view the segmentations in Slicer, the edited segmentation has the wrong orientation (it looks like a flip along the inferior/superior axis). Here’s a coronal view of the two segmentations in 3DSlicer:

I tried to do some digging, which led me to this OHIF issue, which led me to this dcmjs PR. This PR apparently appears in version 0.16.5 of dcmjs. However, it appears that the cornerstoneTools used for this plugin is using 0.16.3. I’m not sure if this is the problem, but it seems like it could be a promising lead.

Versions: XNAT 1.8.2, ohif-viewer-XNAT-plugin 3.0.1 (via the jar in Downloads)

I’ll keep investigating, but I thought I’d bring it to your attention.

Best,

-Jacob

Comments (3)

  1. Jacob Peoples reporter

    I’ve gotten back to looking at this, and I thought I’d report some more details about what’s (likely) happening here.

    Inside the DICOM Segmentation IOD, for each segment, and each slice, there is, on one hand, a position (“Image Position (Patient)”) attribute, and on the other, a reference to the image object that the slice is segmenting.

    In the segmentations saved out of this plugin, I found that if I inspect the DICOM from the original CT, and the segmentations, that the Image Position of the referenced CT slice for a given segmentation slice doesn’t match the Image Position directly encoded for the segment slice. After patching the segmentation DICOM with the Image Position (Patient) attribute looked up in the referenced CT, the segmentations now load correctly in Slicer.

    My best guess as to how this discrepancy could show up in Slicer but not this plugin is that:

    • tools like Slicer use the Image Position (Patient) attribute for the segmentation slices to insert the slices into a volume that represents the segmentation
    • this plugin matches image slices and segmentation slices based on the references to the segmented images

  2. Mo Alsad

    Hi Jacob,

    This issue has been fixed in v3.1.0 RC-1. I ran few tests of exporting segmentations using the plugin and then importing in Slicer and the orientation shows correctly. This is a release candidate build, so I would recommend installing it for testing but not in production.

    Many thanks,

    Mo

  3. Log in to comment