[vtkusers] Problem with Texture of vtkImagePlaneWidget
Glauco
glauco.silva at cenpra.gov.br
Mon May 22 14:25:44 EDT 2006
I´m trying to paste a Texture of vtkImagePlaneWidget to vtkActor. But the texture seems to be not interpolated like it is in vtkImagePlaneWidget. What´s happening?
I tryed paste to vtkImagePlaneWidget a imageData and a reslice.GetOutput(). How can i get successful interpolation ?
extent of ImageData = (0,255,0,255,1,107)
spacing of ImageData = (0.95,0.95,1.5)
Part of my code:
sp = min(spacing)
extentInrterpolate = list(extent)
extentInrterpolate[1] = int(extent[1]*(spacing[0]/sp))
extentInrterpolate[3] = int(extent[3]*(spacing[1]/sp))
extentInrterpolate[5] = int(extent[5]*(spacing[2]/sp))
extentInrterpolate = tuple(extentInrterpolate)
reslice = vtkImageReslice()
reslice.SetInput(imageData)
reslice.InterpolateOn()
reslice.SetInterpolationModeToLinear()
reslice.SetOutputSpacing(sp,sp,sp)
reslice.SetOutputExtent(self.extent)
planeWidgetX = vtk.vtkImagePlaneWidget()
planeWidgetX.DisplayTextOn()
planeWidgetX.SetInput(self.reslice.GetOutput()) # or imageData
planeWidgetX.SetPlaneOrientationToXAxes()
planeWidgetX.SetSliceIndex(0)
planeWidgetX.SetPicker(picker)
planeWidgetX.SetKeyPressActivationValue("x")
planeWidgetX.TextureInterpolateOn()
planeWidgetX.RestrictPlaneToVolumeOff()
planeWidgetX.TextureVisibilityOff()
prop1 = planeWidgetX.GetPlaneProperty()
prop1.SetColor(1, 0, 0)
planeSourceX = vtk.vtkPlaneSource()
planeSourceX.SetOrigin(planeWidgetX.GetOrigin())
planeSourceX.SetPoint1(planeWidgetX.GetPoint1())
planeSourceX.SetPoint2(planeWidgetX.GetPoint2())
planeSourceX.SetNormal(planeWidgetX.GetNormal())
planeMapperX = vtk.vtkPolyDataMapper()
planeMapperX.SetInput(self.planeSourceX.GetOutput())
planeActorX = vtk.vtkActor()
planeActorX.SetMapper(planeMapperX)
planeActorX.VisibilityOff()
planeActorX.SetTexture(planeWidgetX.GetTexture())
planeActorX.SetProperty(planeWidgetX.GetTexturePlaneProperty())
renVolume = vtk.vtkRenderer()
renVolume.SetBackground(0,0,0) #0.2,0.4,0.6)
renVolume.InteractiveOn()
renVolume.AddActor(outlineActor)
renVolume.AddActor(self.planeActorX)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060522/4ea5b30a/attachment.htm>
More information about the vtkusers
mailing list