There are no filters in the ParaView that could create “Depth Map” directly. (I think so, but may be i wrong.)
But I hope that this can be achieved using “Python Shell”. If this is really possible, then please tell me how to create a “Depth map”. And what needs to be done for this in detail and step by step.
I tried this script, but it didn’t run in my “ParaView”.
I think that the reason is that there is no “VTK” in my “ParaView”. May be I wrong?
Although, if I enter a single string “import vtk”, it does not produce any errors.
One more question:
Where can I find detailed and step-by-step instructions on how to (properly) install the “VTK” for my “ParaView”?
I’m run this script.
I changed only one line.
instead: writer.SetFileName('/tmp/capture.vti')
I put: writer.SetFileName('C:/first.avi')
After that, the file (filename.avi) appeared in the specified directory (‘C:’). But this file isn’t opened by any video player.
Also, after run this script, appears that “error message”:
ERROR: In C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\XML\vtkXMLWriter.cxx, line 928
vtkXMLImageDataWriter (0000000012AED660): Error opening output file "C:irst.avi"
ERROR: In C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\XML\vtkXMLWriter.cxx, line 931
vtkXMLImageDataWriter (0000000012AED660): Error code "Invalid argument"
ERROR: In C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\Common\ExecutionModel\vtkExecutive.cxx, line 784
vtkCompositeDataPipeline (0000000012DA1F00): Algorithm vtkXMLImageDataWriter(0000000012AED660) returned failure for request: vtkInformation (0000000012DD4340)
Debug: Off
Modified Time: 344927
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: -1
Besides that I tried to run this script on another machine (Windows).
Look at the screen of my error message below.
This is a code without any corrections:
And there is no “error messages” when I changed line in code like in first example: writer.SetFileName('C:/first.avi')
And also the file (first.avi) appeared now in the specified directory (‘C:’). But this file isn’t opened by any video player.
The same thing happens when I try to replace it with: writer.SetFileName('D:/first.jpg')
More important for me is getting a “video file” as a result. Because I work in ParaView with “Animation View”.
But also I need for obtain an image (for eg, jpeg), but this is not so important like get a video.
I tried to get an image. I change script as you said and used: vtkJPEGWriter instead of vtkXMLImageDataWriter
But my “ParaView” gives an error. May be I did somethong wrong?
Warning: In C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\Image\vtkJPEGWriter.cxx, line 243
vtkJPEGWriter (0000000016306410): JPEGWriter only supports unsigned char input
Is it possible to create a “depth map” for “video file” (from “Animation View”)?
Hope for your support.
Kind regards.
1) The image, which is obtained as a result of the script - have “inversed colors”.
I’ll explain.
For “depth map”, it is important that the nearest parts of the object are white, and the farthest parts are black. But result of the execution of this script - the colors are the opposite (the nearest is black, and the farthest is white).
Question:
How to invert colors (using Python code)?
2) More important for me is getting a “video file” as a result. Because I work in ParaView with “Animation View”.
Question:
Is it possible to export а video (animation) from ParaView using a “Python shell”?
(For example, in *.avi or any other video format.)