Closed selmanca closed 3 years ago
I just tried this with the MRHead sample data and a test segmentation and it worked fine on mac with the 2021-04-12 build. Is there anything unique about your data or workflow? Did it work before? Can you replicate the issue with sample data?
I am adding screenshots. These are segmentation volume nodes and T2 map images of knee.
It still raises the "ValueError: Error reading mask Filepath or SimpleITK object"
Edit: I tried it on Chest CT volumes and it works perfectly there. But it doesn't work here. I am adding volume and segmentation.
https://drive.google.com/file/d/1XJt_negn4WeNaqC8A9L-f8wdfXAXe87V/view?usp=sharing https://drive.google.com/file/d/1f6Bh-8xSFTGInF5EL7pGDcx74tmFlIvV/view?usp=sharing
Can you try to convert one to a label map and try again? I recently had some issue with reading a segmentation node in slicer to simpleitk.
The issue is that for some reason, the sitk readable path doesn't work for segmentation
Thank you! It works perfectly with segmentation label map.
Thanks for reporting and testing @selmanca 👍
@JoostJM do you know what's wrong with segmentations? Is it that SimpleITK doesn't understand .seg.nrrd and we need to do the conversion in SlicerRadiomics when the user picks a SegmentationNode?
I haven't had a chance to investigate, but in the past it was working with both segmentations and labelmaps. There was a related thread somewhere where Joost discussed some fixes he did, but I don't know where it was.
In #688 I talked about some fixes. However, they were a bit different what is described here.
I have to investigate further, but what I know for now is that sitkUtils.GetSlicerITKReadWriteAddress()
does not yield an address that is readable by SimpleITK for segmentation nodes, though it does for labelmap nodes.
sitkUtils.GetSlicerITKReadWriteAddress()
does not yield an address that is readable by SimpleITK for segmentation nodes, though it does for labelmap nodes
That could be due to the way segmentation nodes support overlapping segments. When that happens there are multiple labelmaps that aren't one-to-one with an sitk image. Best long-term if we want to support overlap would be to extract the segments one-by-one and run the radiomics on each exported label. For now we might just export the labelmap and warn the user is the segments overlap (should be able to ask the segmentation node).
I have to investigate why it's going wrong in the extension, as I recently made an update that only forwards labelmaps to the CLI of radiomics (i.e. extracts each individual segment as a labelmap, see #688 and the link provided).
Best long-term if we want to support overlap would be to extract the segments one-by-one and run the radiomics on each exported label.
I believe that's how I implemented it originally.
I believe that's how I implemented it originally.
True, though that implementation started failing, as it started to return the al segments coded with different labels instead of just the selected segment with label 1.
By the way, when Slicer stores a segmentation in .seg.nrrd, it is stored as a 4D volume, supporting overlap. SimpleITK can read that, and PyRadiomics can parse that.
Describe the bug In Slicer Radiomics after choosing input volume and segmentation and pushing "Apply" button. These errors are encountered:
PyRadiomics configuration Slicer Radiomics
Version (please complete the following information):
Thanks for the attention.