I am a newbie. I am trying to develop a segmentation module using python. The main function takes as input a vtkMRMLLabelMapVolumeNode and a vtkMRMLScalarVolumeNode as well as an ‘outputVolumeNode’ which is a newly created (in slicer gui) vtkMRMLLabelMapVolumeNode. The algorithm produces a new label map volume (a numpy array) based on the input volume and labelmap and is trying to push the new label map volume into the output node as so:
numpyArray does not specify image geometry (origin, spacing, axis directions). You have to call outim.CopyInformation(some_reference_image) or set the image geometry some other way.
What is empty? Does not show up in slice viewer? If you go to Volumes module, what do you see in Volume Information section? If you open the Histogram at the bottom of the module GUI, do you see a histogram there?
Thanks for the update. Yes, numpy arrays cannot store image geometry, so you have to define the image geometry by setting origin, spacing, and axis directions in your SimpleITK image or Slicer volume node.