FAQ Database Discussion Community


VTK installation Python : Canopy

python,vtk,canopy
I have installed VTK on Canopy but when I try to run a VTK Python program, it throws me Error: import vtkpython ImportError: No module named 'vtkpython Can Someone tell me Why I am getting this error....

Access vtkActor construction object and append new data

c++,vtk
I am working with VTK-6.1 and I want to create a single vtkActor using multiple vtkUnstructuredGrid. First I create the actor from a grid... vtkSmartPointer<vtkActor> create_actor() { vtkSmartPointer<vtkUnstructuredGrid> grid = create_grid_a(); auto mapper = vtkSmartPointer<vtkDataSetMapper>::New(); mapper->SetInputData(grid); auto actor = vtkSmartPointer<vtkActor>::New(); actor->SetMapper(mapper); actor->GetProperty()->SetColor(0.5, 0.5, 0.5); actor->GetProperty()->SetEdgeVisibility(1); return...

what is the difference in .SetInputConnection() and .SetInput()

python,vtk
I was learning vtk on http://www.uppmax.uu.se/docs/w/index.php/How_to_Read_vtk_Files with this example. I found there is no difference when using arrowGlyph.SetInput(reader.GetOutput()) or arrowGlyph.SetInputConnection(reader.GetOutputPort()) I know that Getoutput() gives you a vtkPolyData and GetOutputPort() gives you a vtkAlgorithmOuPut. But I don't know what is going on under the hood. Can they be used interchangeably?...

Building vtk with QT5 windows 8

windows,cmake,qt5,vtk
I'm facing a rather weird error. I can see on the wiki that we can build vtk with support for qt5. However, when trying to do so and first configuring with cmake I get the following output: CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindQt4.cmake:1326 (message): Found unsuitable Qt version "5.4.2" from...

Convert world to normalized viewport

3d,vtk
Is there a way to convert a world point into normalized viewport position ? How can I do that ? I saw how to convert world position to viewport, but not normalized viewport ... can you help me ? Thank you.

vtk build mac os x 10.10 , no rule to make target '…libpython2.7.dylib'

python,cmake,osx-yosemite,vtk
I am trying to build this code on Mac OS X 10.10 with vtk-6.1.1. After "cmake" I run "make" and it delivers me the following error: Scanning dependencies of target ReadDICOMSeries [100%] Building CXX object CMakeFiles/ReadDICOMSeries.dir /ReadDICOMSeries.cxx.o make[2]: *** No rule to make target `/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib', needed by `ReadDICOMSeries.app/Contents/MacOS/ReadDICOMSeries'. Stop. make[1]:...

GetMousePosition return always 0

vtk
I have a simple question: why the following code: int p[2] = {0, 0}; vtkRenderWindow->GetInteractor()->GetMousePosition(&p[0], &p[1]); TRACE("Mouse position: %d.%d\n", p[0], p[1]); gave me always Mouse position: 0.0 ? It means a lot for me if I solve this problem !!! Could you help me a little bit, please ?...

Loading Legacy vs. XML VTK Files with Three.js

xml,three.js,vtk,legacy
I don't quite understand the difference between the two types of VTK files. I know that there is a simple legacy format and an XML format, but how can you tell the difference between the two? This helps and I think it gives me a good understanding of the legacy...

Cmake could not find the VTKConfig.cmake

c++,qt,boost,vtk,cmake-gui
I'm trying to compile a program in CMake but I'm getting this error. By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "VTK", but CMake did not find one. Could not find a package configuration file provided by "VTK" (requested...

VTK OpenGL objects (3D texture) access from CUDA‏

opengl,cuda,vtk
Is there any proper way to access the low level OpenGL objects of VTK in order to modify them from a CUDA/OpenCL kernel using the openGL-CUDA/OpenCL interoperability feature? Specifically, I would want to get the GLuint (or unsigned int) member from vtkOpenGLGPUVolumeRayCastMapper that points to the Opengl 3D Texture object...

How to define Bounds of a 3D grid (x,y,z - range) in a netCDF file

vtk,netcdf,paraview
I am trying to create a netCDF file based on a VTK file with .vti extension.The metadata or the header information for the VTK file looks like this: <?xml version="1.0"?> <VTKFile type="ImageData" version="0.1" byte_order="LittleEndian"> <ImageData WholeExtent="0 256 0 192 0 128" Origin="0 0 0" Spacing=" 4.000000 4.000000 1.000000 "> <Piece...

How to install vtk with gl2ps enabled using conda

python,compilation,vtk,anaconda,conda
I am using anaconda, and I've built vtk with conda using conda install vtk The default build of vtk is without gl2ps, and I want to know how can I build (or rather rebuild) vtk with gl2ps enabled using conda. I am actually tring to execture this example code: from...

How can I use CMake to link vtk library to multiple source file?

c++,cmake,vtk
Here is a typical Cmakelist file with only one source file: cmake_minimum_required(VERSION 2.8) PROJECT(test) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(test MACOSX_BUNDLE test) if(VTK_LIBRARIES) target_link_libraries(test ${VTK_LIBRARIES}) else() target_link_libraries(test vtkHybrid vtkWidgets) endif() The above example is if I have test.cxx and CMakeLists.txt only. What do I do if I also have a test2.cxx source...

Missing DLL even though the directory containing it is in the path

windows,visual-studio-2012,dll,vtk
I'm currently trying to build and run some of the example of the VTK. Building goes just fine, however when trying to run the examples I have some missing DLLs errors. I am using windows 8.1, Visual Studio 2012. My path actually include the directory where all the dlls are...

how to delete an actor in vtk?

python,vtk
For example, if i have a cube (this part of code is from the vtk python example) import vtk # create a rendering window and renderer ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) # create a renderwindowinteractor iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # create cube cube = vtk.vtkCubeSource() # mapper cubeMapper...

Unable to find VTK 6.1 libraries when building QT5.4 project

qt,qt5,vtk,qvtkwidget
I have installed VTK 6.1 on Ubuntu 14.04. The header files can be found at : /usr/local/include/vtk-6.1 and the libraries can be found at : /usr/local/lib. However, when I try to include VTK into my QT5.4 project .pro file with: INCLUDEPATH += /usr/local/include/vtk-6.1 LIBS += -L/usr/local/lib -lvtkCommon It gives me...

Refreshing a QWidget

python,qt,python-2.7,pyqt,vtk
I've been having this issue a lot of times. When I modify some properties of a QWidget after the widget.show(), the widget won't update. Most of the time, a mouse click or when the mouse leaves or enters the widget, the widget will be updated. However, if I leave the...

vtk build succeeds but python says module doesn't exist?

python,vtk
I'm building vtk on Cent OS. I would like to install the python wrappers, and I've followed the build directions to do so. I've installed under prefix ~/local. Things appear to have gone successfully: vtk, vtkpython, and other vtk executables appear in my ~/local/bin/ directory. vtk libraries appear in ~/local/lib....

Cmake compile all c++ files in directory with VTK dependency

c++,compilation,cmake,make,vtk
I have a main file and two classes in C++, all of which use VTK libraries. I know how to compile one file, how should my CMakeLists look like to compile them all? Example of the code: Main: #include <vtkImageData.h> #include <vtkMetaImageReader.h> #include <vtkSmartPointer.h> #include "ClassA.h" #include "ClassB.h" ClassA.cpp: #include...

VTK Render into C#

c#,c++,wpf,vtk
I have a c++ application that uses VTK, I want to have vtkRenderWindow and put it into C# WPF project without using C# wrapper.

How to rotate and place points on VTK object

vtk,qvtkwidget
I have seen how I can place points on a VTK object using seed widget from : http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/vtkSeedWidget I have also seen how I can rotate an object from : http://www.cmake.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindows I am wondering how I can combine this so I can rotate the object when I drag, and place...

Render a simple image using vtkDataImage

c++,3d,vtk
I want to render a simple image using vtkImageData in C++. I know that vtkImageDataGeometryFilter can do the job, but I'm asking if there is an other way to get the same result without using PolyData ? Here is my code, but I have an access violation reading while rendering,...

Native Code: cannot use typeid with -fno-rtti

c++,osx,gcc,android-ndk,vtk
I'm trying to build native code on android because I want to use VTK for my android tablet. However, I am facing some issues when it comes to building one of the vtk examples. I know this problem has been covered here for an objective c issue but I guess...