vtkExtractVOI origin bug
The output of the vtkExtractVOI
doesn't properly set the origin of the output vtkImageData. For example:
import vtk
image = vtk.vtkUniformGrid()
image.SetOrigin(0,0,0)
image.SetDimensions(10,10,10)
alg = vtk.vtkExtractVOI()
alg.SetVOI((0,9, 5,5, 0,9))
alg.SetInputDataObject(image)
alg.Update()
output = alg.GetOutput()
print(output.GetOrigin(), output.GetBounds())
The origin of the output is (0.0, 0.0, 0.0)
while the bounds are (0.0, 9.0, 5.0, 5.0, 0.0, 9.0)
. these are inconsistent... since this is a "2D slice", the origin should be: (0, 5.0, 0)
to be consistent with the bounds