Closed danieledsc closed 1 year ago
I am not sure if I get your question.
Essentially, you want to get a "2D/3D numpy array" in float32 format, instead of a NIFTI file for the segmentation mask?
Yes, yes I would like to receive an object of type vtkMRMLScalarVolumeNode instead of vtkMRMLSegmentationNode, Thanks
How do you plan to use this float volume? As a fractional segmentation (increased bit depth is for smoother boundary) or a probability map (values specify a continuous color overlay)?
You can store fractional labelmap (8-bit signed value for each segment) in a segmentation node, so you can still keep using segmentation nodes (and have nice 2D/3D visualization and other useful segmentation features). If getting a fractional volume from the client is implemented then I can help with hooking that up with the segmentation.
If the result is a probability map then it is essentially image filtering and so Segment Editor may not be the best place to launch it from.
I would like to create a fractional segmentation based on the probability map. I could make a CURL call directly to the AIAA server, retrieve the vtkMRMLScalarVolumeNode and pass it to the segmentation editor using the code . However, selecting the output type directly from the segmentation tool may be useful.
You can edit the Slicer plugin (it is just a Python script) to create fractional labelmap from the received volume node. Something like this should work:
fractionalLabelmap = ... # vtkOrientedImageData retrieved from vtkMRMLScalarVolumeNode
segmentationNode = ...
newSegment = slicer.vtkSegment()
newSegment.SetName("mysegment")
newSegment.SetColor(1,0,0)
newSegment.AddRepresentation(slicer.vtkSegmentationConverter.GetSegmentationFractionalLabelmapRepresentationName(), fractionalLabelmap)
segmentationNode.GetSegmentation().AddSegment(newSegment)
Closing this issue. Please use MONAILabel instead... feel free to raise any issue or start discussion over MONAILabel repo
MONAI Label repo: https://github.com/Project-MONAI/MONAILabel
Is it possible to receive a float32 volume instead of a segmentation mask as the output of an auto-segmentation custom model?