[Paraview] View size and writing an image

the lily the.1.lily at hotmail.com
Wed Feb 13 03:51:00 EST 2013


Dear all 

I'm extracting the depth map and the png image from paraview and I want both of them to be the same size which is 1600*1600

any way I did something like this

file_load = XDMFReader( FileName= ...... )

Applied some filters then 

RenderView = GetRenderView()



# to get the dpeth map I did the following 

view = GetActiveView().GetRenderWindow()
view.SetSize(1600,1600)
w2i = vtkWindowToImageFilter()
w2i.SetInputBufferTypeToZBuffer ()
w2i.SetInput(view)
w2i.Update()
out = w2i.GetOutput()
p =out.GetPointData()
a = p.GetArray(0)
final_a = vtk_to_numpy(a)   

so final_a is my depth map and it is 1600*1600 but when I try to save the image using this command 

RenderView.WriteImage("data.png","vtkPNGWriter",1)


it gives me an image with the size of 1600*1359

the command was woking fine until I used view.SetSize(1600,1600)

so is there a way to fix that ?
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130213/c1cadf29/attachment.htm>


More information about the ParaView mailing list