I want to implement the segmentation of bladder from pelvic floor MRI images and then implement 3D reconstruction of the organ in a python scripted module.
I currently created a model which can predict by each pixel of the MRI image. The model returns a (227,227,30) matrix of value 0 and 1. (the MRI image has 30 images with 227*227 pixels). In the matrix, 1 indicates this pixel is a part of bladder and 0 is not. This model tells the position of the segmented organ in the image.
For the 3D Modeling part, I think the Show 3D and Fill between slices of the Segment Editor module will do it. But how can I segment the organ by the matrix predicted by my model? Does anyone have any idea how to implement this?
The data you call model we call binary labelmap. Please load is to Slicer as a labelmap (choose labelmap in the options of the load window, or convert it to labelmap after loading in the Volumes module), then import it as a segmentation (right-click labelmap in Data module and choose import labelmap to segmentation).
Hi, thanks so much for your help.
Your idea seems practical but Iām sorry I didnāt completely understand. I load MRI images in the format .gz to Slicer, and the model is a .h5 file which is made of a convolutional neural network. My model can predict the MRI images to a (227,227,30) matrix. What should I load to Slicer? Iām new to Slicer so sorry for lack of knowledge.
@ZiyunLiang, what you call the āmatrixā (output of your neural network āmodelā) is what we call a labelmap, so if you load that into Slicer, you can make it into a what Slicer calls a āmodelā which is a triangulated surface.
Hi, really appreciate your help and explanation, I have figured out a way to implement this now. However, I still got a problem when Iām trying to write it in my scripted python module.
When Iām trying to convert my volume to labelmap by using Volumes module, Volume information section, and Convert to label map
I used the code
Hi, thanks for the quick response and the tip, Iāll keep that in mind. I tried this but I think Iām still implementing this function wrong. What should the vtkMRMLScene be?