[vtkusers] vtkImageViewer2 Bug?

David Doria daviddoria+vtk at gmail.com
Thu Dec 17 09:49:47 EST 2009


On Thu, Dec 17, 2009 at 9:46 AM, KS Jothybasu <jothybasu at gmail.com> wrote:
> Hi David,
>
> Here it is!
>
> use the function to create imagesets with different dims.
>
> def Create_Phantom(XDim,YDim,ZDim):
>     Phantom=vtk.vtkImageData()
>     Phantom.SetDimensions(XDim,YDim,ZDim)
>     Phantom.SetOrigin(0,0,0)
>     Phantom.SetSpacing(1,1,1)
>     Phantom.SetScalarTypeToFloat()
>     Phantom.AllocateScalars()
>     for z in range(0,ZDim,1):
>         for y in range(0,YDim,1):
>             for x in range(0,XDim,1):
>                 Phantom.SetScalarComponentFromFloat(x,y,z,0,0)
>     return Phantom
>
> self.ImageSet=Create_Phantom(256,256,64)
>
>
>         .SagittalView=vtk.vtkImageViewer2()
>          SagittalView.SetInput(self.ImageSet)
>          SagittalView.SetSlice(10)
>          SagittalView.SetSliceOrientationToYZ()
>         Ren_WinS=vtk.vtktRenderWindow()
>         SagittalView.SetRenderWindow(Ren_WinS)
>        Ren_WinS.Render(
>
> SagittalView.SetupInteractor(self.frameS.GetRenderWindow().GetInteractor())
>       SagittalView.GetRenderer().ResetCamera()
>
> some time this displays the image 90 rotated!
>
> Thanks
>
> Jothy
>

Let's keep this discussion on the list. I am not a vtkImageViewer2
expert nor a SagittalView expert so we'll have to wait for the experts
response!

What do you mean "some times" the image is rotated?

Thanks,

David



More information about the vtkusers mailing list