-
Notifications
You must be signed in to change notification settings - Fork 42
KeyError
and OperationalErrors
when loading SEG file from NBIA
#344
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
Comments
The specific SEG from the NSCLC-Radiogenomics seem to be created using probably the first ever iteration of the DICOM SEG writer in 3D Slicer, it could be that those objects have issues. I would need to look into more detail. ISPY2 segmentations are known to be invalid - the creator incorrectly implemented the conversion, and utilized individual bits within a byte to encode different segments. I think if you want to parse those out you would need to write some custom code. I don't know if the conventions used are documented. For your reference, all of the public DICOM collections from TCIA are also available in IDC, and you can download any collection/patient/study/series files using idc download 1.3.6.1.4.1.14519.5.2.1.4334.1501.208304249098874719086628767652 |
Thanks @fedorov for this very useful background information. If the ISPY2 images are as incorrect as you describe, then I think that it's probably a non-starter for highdicom to try and support reading them and I'm afraid you are on your own @jjjermiah, sorry. For the NSCLC dataset, I can try to take a look soon. @fedorov I'm assuming that the copy of these files in the IDC matches the ones on TCIA that seem to be causing problems here? Or did we fix them somehow before ingesting them into the IDC? |
I agree, I would not expect highdicom to handle it out of the box. But I think highdicom could still be useful to decypher those perhaps. I should go back into notes and post on IDC forum what are the exact issues we identified with that dataset.
Yes, what we have in IDC should be the same. No, we did not fix anything before ingesting. If we decide to fix those, they should be resubmitted to TCIA and get into IDC when we re-fetch the updated content from TCIA. |
Hi @jjjermiah I believe #345 should resolve your issue with the NSCLC dataset. I have only tested on one case though, perhaps you would be willing to test the rest of the dataset and let us know if you come across other problems before we merge? I think the files are perfectly valid, but are "unusual" in the sense that one of the attributes used as a Dimension Index is found in the SharedFunctionalGroupsSequence rather than the per frame functional groups sequence. Generally this would not be expected because it is unusual to index along a dimension that doesn't change. But from reviewing the relevant part of the standard, I think it is an entirely valid thing to do, and it's a simple fix. |
@CPBridge thanks a bunch for addressing this. I will test on the rest of the dataset and let you know what I find |
@jjjermiah Hello, I am also working on the ISPY2 dataset. I am full of confusion about the mask analysis file they provide. How do I get the annotation of the tumor region. Hope to get your help. |
@AlexNmSED given that it doesnt follow the standard, we've also chosen not to support its unique approach storing segmentation data. |
Hello,
Thank you very much for your reply.
For my purposes, it would be sufficient to simply identify which slices contain the tumor—I don’t necessarily need to extract the exact tumor regions. Do you have any suggestions on how to obtain the slice indices where the tumor appears, or perhaps any sample code that could help with this?
I really appreciate your help!
Xinyu
uppsala university
…---Original---
From: "Jermiah ***@***.***>
Date: Fri, May 9, 2025 18:46 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [ImagingDataCommons/highdicom] `KeyError` and `OperationalErrors`when loading SEG file from NBIA (Issue #344)
jjjermiah left a comment (ImagingDataCommons/highdicom#344)
@AlexNmSED given that it doesnt follow the standard, we've also chosen not to support its unique approach storing segmentation data.
Without looking deeply into it, I would probably just find which region has a segment label with the tumor and then disregard everything else, but Im unsure if thats even correct either.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Oh if thats the case then the mask values are encoded by values of |
Thank you for your help. |
@jjjermiah Hello. Do you know how to obtain the DCE-MRI data from the I-SPY2 study at each different time point, specifically the pre-contrast images and the images from each contrast-enhanced phase? |
Thanks for this great package!
Im trying to use the
Segmentation
class to processDICOM-SEG
files published on the NBIA, and running into two distinct issues for theISPY2
andNSCLC-Radiogenomics
collections:NSCLC-Radiogenomics
This file has pixel data, and the instantiation itself fails immediately.
ISPY2
The instantiation here works, but attempting to access the volume fails.
Is this expected behaviour?
My main goal is to read in these SEG files, align to their reference CT/MR files, and do some processing in python.
some of the access methods that I'd like to use are:
Supplementary Data
dcm dumps:
NSCLC_Radiogenomics__SEG_Series28767652__00000001.dcmdump.txt
ISPY2-111038__SEG_Series20496892__00000001.dcmdump.txt
Please let me know how I can help with this as well.
The text was updated successfully, but these errors were encountered: