<div dir="ltr">It would be great if you could share your data as well so that I can check it with my installation. Thanks,<div>Dan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 4, 2015 at 11:31 AM Manjunath K E <<a href="mailto:ke.manjunath@gmail.com">ke.manjunath@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Dan Lipsa,<br><br></div><div></div><div>Thanks for the reply. The error is occurring during runtime. There was no error, when i ran it in interpreter. All the lines in the script executed smoothly. <br></div><div>I have tested the same code using vtk 6.0.0 there was no error. <br><br></div><div>Also, the output that i get is not proper. There is problem in the color map of the output produced. The scale bar is not displayed properly. <br></div><div>==========================================<br></div><div>#!/usr/bin/env python<br>from vtk import *<br><br>reader = vtkNetCDFCFReader()<br>reader.SetFileName("<a href="http://3d.nc" target="_blank">3d.nc</a>")<br>reader.SphericalCoordinatesOff()<br>reader.SetOutputType(6)<br>reader.SetReplaceFillValueWithNan(1)<br>reader.Update()<br>#Copy SAL Array to scalar value field of point data ..this makes point data to point to SAL array <br>reader.GetOutput().GetPointData().SetScalars(reader.GetOutput().GetPointData().GetArray("SAL"))<br>reader.UpdateMetaData()<br>reader.Update()<br>reader.UpdateInformation()<br>output = reader.GetOutput()<br><br>a,b = reader.GetOutput().GetPointData().GetScalars().GetRange()<br>lut = vtk.vtkColorTransferFunction()<br>lut.AddRGBPoint(a,         0.0, 0.0, 0.8)<br>lut.AddRGBPoint(a+(b-a)/4, 0.0, 0.5, 0.5)<br>lut.AddRGBPoint(a+(b-a)/2, 0.0, 1.0, 0.0)<br>lut.AddRGBPoint(b-(b-a)/4, 0.5, 0.5, 0.0)<br>lut.AddRGBPoint(b,         1.0, 0.0, 0.0)<br>lut.SetNanColor(0,0,1)<br><br># the mapper that will use the lookup table <br>mapper = vtkDataSetMapper()<br>mapper.SetInputData(reader.GetOutput())<br>mapper.SetScalarModeToUsePointData()<br>mapper.SetLookupTable(lut)<br>mapper.SetScalarRange(a,b)<br># the actor<br>gridActor = vtkActor()<br>gridActor.SetMapper( mapper )<br>scaleBarActor = vtkScalarBarActor()<br>scaleBarActor.SetLookupTable( mapper.GetLookupTable() )<br>scaleBarActor.SetTitle("Color Map for Point Data")<br>scaleBarActor.SetOrientationToHorizontal()<br>scaleBarActor.GetLabelTextProperty().SetColor(0,0,1)<br>scaleBarActor.GetTitleTextProperty().SetColor(0,0,1)<br><br># position it in window<br>coord = scaleBarActor.GetPositionCoordinate()<br>coord.SetCoordinateSystemToNormalizedViewport()<br>coord.SetValue(0.1,0.05)<br>scaleBarActor.SetWidth(.5)<br>scaleBarActor.SetHeight(.1)<br><br># renderer and render window <br>renderer = vtkRenderer()<br>renderer.SetBackground(1, 1, 1)<br>renderer.SetGradientBackground(1) # Set background to white<br>renWindow = vtk.vtkRenderWindow()<br>renWindow.SetSize(512, 512)<br>renWindow.AddRenderer( renderer )<br><br># render window interactor<br>renWinInteractor = vtkRenderWindowInteractor()<br>renWinInteractor.SetRenderWindow( renWindow )<br># add the actors to the renderer<br>renderer.AddActor( gridActor )<br>renderer.AddActor( scaleBarActor )<br><br>#show axes<br>axesActor = vtkAxesActor()<br>widget = vtkOrientationMarkerWidget()<br>widget.SetOrientationMarker( axesActor )<br>widget.SetInteractor( renWinInteractor )<br>widget.SetViewport( 0.0, 0.0, 0.4, 0.4 )<br>widget.SetEnabled( 1 )<br>widget.InteractiveOff()<br><br># render<br>renderer.ResetCamera();<br>renWindow.Render()<br># initialize and start the interactor<br>renWinInteractor.Initialize()<br>renWinInteractor.Start()<br>==================================================<br><br></div><div class="gmail_extra"></div></div><div dir="ltr"><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font color="#ff0000"> </font><font color="#ff6600">Thanks and Regards,</font></div><div><font color="#3366ff"><br></font></div><div><span style="color:rgb(51,102,255)"> Manjunath K E</span><font color="#3366ff"></font></div><div><font color="#3366ff"> <span style="color:rgb(241,194,50)">Help Ever Hurt Never</span><br></font></div><div><font color="#3366ff">  </font></div></div></div></div></div></div></div></div></div></div>
<br></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 4, 2015 at 12:31 AM, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Manjunath,<br></div>Can you share the script you are trying to run? This seems like a problem with the script rather than an installation issue.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 3, 2015 at 2:16 PM Manjunath K E <<a href="mailto:ke.manjunath@gmail.com" target="_blank">ke.manjunath@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Shawn,<br><br>I followed your instructions, now the vtk importing problem is solved. <br>But, following error is obtained</div></div><div dir="ltr"><div><br>ERROR: In /home/kitware/Desktop/vtkbuild/build/vtk/src/vtk/Rendering/OpenGL/vtkOpenGLTexture.cxx, line 200<br>vtkOpenGLTexture (0x2f2ac90): No scalar values found for texture input!<br><br></div></div><div dir="ltr"><div></div>The error is seen for every frame<br></div><div class="gmail_extra"></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font color="#ff0000"> </font><font color="#ff6600">Thanks and Regards,</font></div><div><font color="#3366ff"><br></font></div><div><span style="color:rgb(51,102,255)"> Manjunath K E</span><font color="#3366ff"></font></div><div><font color="#3366ff"> <span style="color:rgb(241,194,50)">Help Ever Hurt Never</span><br></font></div><div><font color="#3366ff">  </font></div></div></div></div></div></div></div></div></div></div>
<br></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 3, 2015 at 11:36 PM, Shawn Waldon <span dir="ltr"><<a href="mailto:shawn.waldon@kitware.com" target="_blank">shawn.waldon@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Manjunath,<br><br></div>Please keep discussions on the list so that others can benefit later.<br><br></div>I haven't used an install tree on Linux for a while but according to my notes you should need the following assuming it is installed to /usr/local:<br><br></div>export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/python2.7/site-packages/vtk:$LD_LIBRARY_PATH<br><br></div>export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH<br><br></div>HTH,<br></div>Shawn<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 3, 2015 at 1:59 PM, Manjunath K E <span dir="ltr"><<a href="mailto:ke.manjunath@gmail.com" target="_blank">ke.manjunath@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Shawn<br><br>Thanks for the reply.<br>My python script is set up to use the system's python not vtkpython.<br><br>I have set export PYTHONPATH="/usr/local/lib/python2.7/site-packages/vtk/:$PYTHONPATH".<br>export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH<br><br>I have installed vtk-6.2 to /usr/local.<br><br></div>Is the should i change the values of PYTHONPATH and LD_LIBRARY_PATH to something else.<br><div><div><div class="gmail_extra"><span><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font color="#ff0000"> </font><font color="#ff6600">Thanks and Regards,</font></div><div><font color="#3366ff"><br></font></div><div><span style="color:rgb(51,102,255)"> Manjunath K E</span><font color="#3366ff"></font></div><div><font color="#3366ff"> <span style="color:rgb(241,194,50)">Help Ever Hurt Never</span><br></font></div><div><font color="#3366ff">  </font></div></div></div></div></div></div></div></div></div></div>
<br></span><div><div><div class="gmail_quote">On Mon, Aug 3, 2015 at 11:17 PM, Shawn Waldon <span dir="ltr"><<a href="mailto:shawn.waldon@kitware.com" target="_blank">shawn.waldon@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Manjunath,<br><br></div>Is your python script set up to use vtkpython as the interpreter?  Or is it using the system's python?  If you are trying to import vtk from system python you have to set your LD_LIBRARY_PATH and PYTHONPATH environment variables.  If you want to change the script to use vtkpython then change the first like to #!/path/to/vtkpython<br><br></div>HTH,<br></div>Shawn<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 3, 2015 at 1:43 PM, Manjunath K E <span dir="ltr"><<a href="mailto:ke.manjunath@gmail.com" target="_blank">ke.manjunath@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi all<br><br></div>I have installed VTK 6.2 along with vtk 6.2 python  interface on ubuntu 14.04 manually.<br><br></div>When I run vtkpython in interpreter mode, the import of vtk is successful.<br></div>It doesn't have any problem  and the same is shown below.<br><div><br>===========================================================<br>manju@iiitb-gvcl-Z800:~/manju/academics/iiitb/project/codes/incois__laptp/src_vtk6$ vtkpython<br>vtk version 6.2.0<br>Python 2.7.2 (default, Feb 12 2015, 18:30:44) <br>[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> from vtk import *<br>>>> print vtk<br><module 'vtk' from '/usr/local/lib/python2.7/site-packages/vtk/__init__.pyc'><br>>>> <br>===========================================================<br><br></div><div>But, If i run a python script then an error is obtained for this line "from vtk import *". The error is as shown below.<br>===========================================================<br>manju@iiitb-gvcl-Z800:~/manju/academics/iiitb/project/codes/incois__laptp/src_vtk6$ ./demo1.py <br>Traceback (most recent call last):<br>  File "./demo1.py", line 6, in <module><br>    from vtk import *<br>ImportError: No module named vtk<br>===========================================================<br><br>Please help me in solving this issue. I appreciate your time and help.<br></div><div><br clear="all"><div><div><div><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font color="#ff0000"> </font><font color="#ff6600">Thanks and Regards,</font></div><div><font color="#3366ff"><br></font></div><div><span style="color:rgb(51,102,255)"> Manjunath K E</span><font color="#3366ff"></font></div><div><font color="#3366ff"> <span style="color:rgb(241,194,50)">Help Ever Hurt Never</span><br></font></div><div><font color="#3366ff">  </font></div></div></div></div></div></div></div></div></div></div>
</div></div></div></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>
</blockquote></div><br></div></div></blockquote></div>