[vtkusers] Fwd: Origin not passed to vtkExtractVOI through Pipeline (bug?)
Paul
massivemonkeymayhem at gmail.com
Thu Nov 13 10:26:36 EST 2008
Actually - I was running 1.46. That's the one tagged for 5.2. I
upgraded to v1.47 of the file from CVS, and that did indeed fix the
problem.
Million thanks.
Paul
On Thu, Nov 13, 2008 at 11:41 AM, David E DeMarle
<dave.demarle at kitware.com> wrote:
> On 11/13/08, Paul <massivemonkeymayhem at gmail.com> wrote:
>> Information does not appear to be getting properly passed through from
>> the parent data set to a vtkExtractVOI object (particularly, the
>> object's origin). It was fine in 5.0 but broke in 5.2. I'll let the
>> short code snippet do the talking. Has this perhaps been fixed in CVS?
>>
>> ---------------------------
>>
>> import vtk
>>
>> data = vtk.vtkFloatArray()
>>
>> for i in range(9):
>> data.InsertNextValue(i)
>>
>> image = vtk.vtkImageData()
>>
>> image.GetPointData().SetScalars(data)
>> image.SetOrigin(1,1,1)
>> image.Update()
>>
>> roi = vtk.vtkExtractVOI()
>> roi.SetInput(image)
>> roi.Update()
>> roi.GetOutput().GetOrigin()
>>
>> >>> Out: (1.0, 1.0, 1.0)
>>
>> # Everything is copacetic
>>
>> reader = vtk.vtkXMLImageDataReader()
>> reader.SetFileName('/path/to/some/file.vti')
>>
>> reader.Update()
>> reader.GetOutput().GetOrigin()
>>
>> >>> Out: (0.0, 0.0, 9.0)
>>
>> roi2 = vtk.vtkExtractVOI()
>> roi2.SetInputConnection(reader.GetOutputPort())
>> roi2.Update()
>> roi2.UpdateWholeExtent()
>> roi2.GetOutput().GetOrigin()
>>
>> >>> Out: (0.0, 0.0, 0.0)
>>
>> # Should be (0.0, 0.0, 9.0) !
>> # That makes me a saaaaad panda :(
>>
>> # NB: roi2.GetOutput().GetSpacing() is just fine.
>>
>> ---------------------------
>>
>> The really screwball thing is that I can't even set the Origin
>> manually. When I call Render() on the render window, the Origin value
>> for roi2 reverts back to (0.0, 0.0, 0.0).
>>
>>
>> Paul
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
> Hi Paul,
>
> Would you mind reverting VTK/Imaging/vtkExtractVOI.cxx to revision
> 1.46, trying your code, and letting us know the result? I suspect rev
> 1.47 broke it.
>
> thanks,
>
> --
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 28 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-371-3971 x109
>
More information about the vtkusers
mailing list