Segmentation Using SimpleITK

Hello, I wanted to know whether it is possible to create a mask for an image using simpleitk and use that mask to show the segmented region in slicer jupyter kernel.
thank you.

This easily doable in two steps:

  • push/pull volume node to/from SimpleITK using sitkUtils (see example)
  • convert the volume node to/from segmentation node (see example)

There are several Segment Editor effects that use SimpleITK, which can serve as a complete example (that even show how to implement interactive segmentation tools, which require some user input):

Thank you for your reply. However, I have another problem. I am using a UNET neural network to segment a series of CT images and save the segmented image as a different file. When I use matplotlib to show the segmented image, the regions of interest are clearly visible with a distinct color, however when I import the image into the slicer and display it is nothing like the segmented one. I have attached the plots from matplotlib and slicer. Can you help me to be able to display the segmented image in the slicer, too?

slicer

Can you send this saved image (upload somewhere and post the link)?

How do you do this exactly?