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 an empty segmentation #32

Open
vsaase opened this issue Mar 18, 2021 · 3 comments
Open

Creating an empty segmentation #32

vsaase opened this issue Mar 18, 2021 · 3 comments

Comments

@vsaase
Copy link

vsaase commented Mar 18, 2021

Hi,

I would like to create an empty DICOM-SEG from a json file as created with http://qiicr.org/dcmqi/#/seg to then use it as a template for users to fill in the segments. The segmentation dicom file only has to reference the series it applies to, so only a single dicom file from the series would be needed.
I tried to use a zero filled NRRD as input to MultiClassWriter, but that raises an error that no segments where found.
Just asking before putting effort into an implementation, maybe there is a shortcut in pydicom-seg?

Victor

@vsaase
Copy link
Author

vsaase commented Mar 19, 2021

Maybe something like this: https://github.com/vsaase/pydicom-seg/tree/empty_seg
This usecase is maybe not in the spirit of DICOM (immutability) however, so I understand if you are sceptical.

Not having a segment defined in the DICOM metadata should be treated as conceptually different from not seeing it in the source image and not assigning pixels to it. So I think it should be possible to have empty segments.

@razorx89
Copy link
Owner

Sorry for the long delay!

I think this is a valid use case and should work out of the box. Especially in automated workflows this would be required where results are generated by a software and allow for non-existing segmentations. If in this case the DICOM can not be created the user/radiologist might think the entire software process has failed.

Two things I am currently concerned about:

  1. Is this still legal DICOM? The standard says Number Of Frames should have a value greater than zero.
  2. I am currently a bit unsure how the reading functionality would be affected. The origin, and extent are derived from information in the PerFrameFunctionalGroupsSequence.

@bashkanov
Copy link

Hi, I'm also interested in creating an empty DICOM-SEG, which is essential in many application cases. This functionality still seems to be not provided out of the box after three years since this issue was opened. JSON schema still requires more than one element in segmentAttributes and unique_labels should contain at least one label.
@razorx89, your concerns are valid, but maybe you have a working example or suggestions for creating an empty DICOM-SEG while using the current version of pydicom-seg?

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

No branches or pull requests

3 participants