Dear All,
I want that the image_3d be saved as MET_UCHAR_ARRAY and the code below saves in MET_UCHAR with only one component instead of three. How can be instructed the saving be done the right way?
Thanks,
Luís Gonçalves
self.image_3d = vtk.vtkImageData()
self.image_3d.SetDimensions(dim5)
self.image_3d.SetSpacing(scale5)
self.image_3d.AllocateScalars(vtk.VTK_UNSIGNED_CHAR, 3)
points = self.image_3d.GetPointData()
points.SetScalars(numpy_support.numpy_to_vtk(
np.zeros((dim5[0]*dim5[1]*dim5[2]*3), dtype=np.uint8)))
w = vtk.vtkMetaImageWriter()
w.SetFileName(path1+file6+".mhd")
w.SetInputData(self.image_3d)
w.SetCompression(False)
w.Write()