vtk

VTK install error cannot find libvtkCommonCore-6.3.so.1

蹲街弑〆低调 提交于 2019-12-06 08:39:30
I'm trying to install VTK but I'm getting the following error CMake Error at Common/Core/cmake_install.cmake:47 (file): file INSTALL cannot find "/home/VTK-6.3.0/VTKBuild/lib/libvtkCommonCore-6.3.so.1". Call Stack (most recent call first): cmake_install.cmake:100 (include) These are the steps I followed cd VTKBuild cmake ..\ -D"CMAKE_INSTALL_PREFIX:PATH=/home/VTK-6.3.0/VTKBuild" make make install Can anyone point me to what might be going wrong I had to turn off shared library option, these are the configuration I used to build VTK mkdir VTKBuild cd VTKBuild cmake ..\ -DCMAKE_INSTALL_PREFIX=

闲扯-VTK与QT整合开发中的问题

a 夏天 提交于 2019-12-06 08:02:15
通篇闲扯。但是发现还是有人在看,而且自己最近重新来过,这篇文章确实略微有用。争取找时间修改下。 之前曾质疑是否要一用QT来整合开发ITK、VTK,原来的想法是直接用VS2010,c++开发。后来发现自己总是配置出错,而且可以参考的资料不多。更重要的是,VTK更多的是支持用MFC进行开发,而本人很是反感使用MFC,总觉得MFC这个东西很过时,而且臃肿庞大,不到万不得已,打死不想用。 屈服于QT之后,就得重新去编译VTK(之前没有选择QT的支持VTK_USE_QT)。又浪费了很多时间,最终原因是缺失了MFCvtk.dll文件,解决方案是去网上搜索了一个dll,放在需要的位置。问题解决。 后来在 将QT与VTK整合的过程中又一次遇到了问题 。按照网络上提供的各种教程,应该讲QVTK和QVTKWidgetPlugin的dll和lib文件放入QT安装文件夹下plugin/designer下。好不容易从编译好的文件中凑齐了这四个文件放进去, QTDesigner直接不能启动了 。想想这四个文件的来源, QVTKWidgetPlugin.lib来自debug文件夹下。果断想到修改成release版本试试 。 重新编译了VTK.sln,发布release版本。手欠,整个项目都AllBuild了下。 其实只需要按需编译QVTK和QVTKWidget就行了 。 另外这里有一个疑问

How to render programmatically a vtk item in qml?

别等时光非礼了梦想. 提交于 2019-12-06 05:35:28
So far, I understand that we have two threads in QML, our main application thread, and our "scene graph" thread : http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html I've implemented my own vtkQmlItem with the help of this link : http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html and I've noticed that my vtkscene is only rendered when the afterrendering signal is emitted by the qml flow. So far, everything is ok and works perfectly, I can see my vtk scene and can even interract with it. But I would like to also programmatically render my vtk scene as well, since I want

GLIBCXX not found when compiling vtk example under mex

£可爱£侵袭症+ 提交于 2019-12-06 05:19:13
问题 I have been trying to follow this example for compiling vtk in MATLAB using mex, on an Ubuntu 11.10. The mex command I used is as follows: mex -I/usr/include/vtk-5.6 vtk_file.cpp -L/usr/lib/ -lvtkFiltering -lvtkRendering -lvtkCommon After compilation I have a .mexa64 file. However, when I try to run the file I end up with the following error: Invalid MEX-file '/home/bill/Documents/MATLAB/vtk/vtk_file.mexa64': /usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version

How to write ASCII and BINARY data to the same file at the same time

夙愿已清 提交于 2019-12-06 02:56:30
I work with a VTK data type for my outputs. Since my data is becoming larger and larger, it's taking considerable time to write it in ASCII and that's what I have been doing so far. I need to change that into binary format but the problem is the file has some headers (see http://www.vtk.org/VTK/img/file-formats.pdf ) that need to be written in ASCII even for binary files. Now I don't have enough experience with binary formats and my first try was to open two streams via ofstream asciiWriter(file_name.c_str()); ofstream binWriter(file_name.c_str(), ios::app | ios::binary); problem is the output

How to convert a 3D vtkDataSet into a numpy array?

烈酒焚心 提交于 2019-12-06 02:10:11
I am trying to read a series of DICOM files and render it into a 3D Model. I have accomplished this. However I also want to be able to remove certain slices before rendering. This is where I am lost. I am unable to find a way to access each file loaded and remove the ones I want. I have read that I could convert the the dataset to a numpy array. However I am uncertain as to how I could do that. reader = vtkDICOMImageReader() reader.SetDirectoryName('loads a directory of DICOM files') reader.Update() imageDataGeometryFilter = vtkImageDataGeometryFilter() imageDataGeometryFilter

Python DLL import error when importing vtk

痴心易碎 提交于 2019-12-05 23:27:22
I need to use the VTK library (with version 5.10 because I am working on an existing code) in python on my Windows 10 machine but I can not manage to import it without DLLImport error: Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import vtk Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\vtk\__init__.py", line 139, in <module> __helper.refine_import_err('qvtk', 'vtkQtPython', exc) File "C:\Python27\lib\site

Save data to VTK using Python and tvtk with more than one vector field

自闭症网瘾萝莉.ら 提交于 2019-12-05 18:06:24
I'm trying to save three sets of vector quantities corresponding to the same structured grid (velocity, turbulence intensity and standard deviation of velocity fluctuations). Ideally, I'd like them to be a part of the same vtk file but so far I have only been able to get one of them into the file like so: sg = tvtk.StructuredGrid(dimensions=x.shape, points=pts) sg.point_data.vectors = U sg.point_data.vectors.name = 'U' write_data(sg, 'vtktestWake.vtk') I've spent past few hours searching for an example of how to add more then one vector or scalar field but failed and so thought I'd ask here.

How to visualize 3D delaunay triangulation in Python?

蹲街弑〆低调 提交于 2019-12-05 16:22:25
I have a set of 3D points which I've used scipy.spatial.Delaunay to do the triangulation / tetrahedralization. I now have a set of unique faces of all of the tetrahedra, and would like to visualize these in 3D. Are there any Python libraries (or libraries with a Python wrapper) that can do this? nullas Try mayavi.mlab.triangular_mesh() import numpy as np from mayavi import mlab vertices = np.array([[0, 1, 0, 0],[0, 0, 1, 0],[0, 0, 0, 1]]) faces = np.array([[0, 1, 0, 0],[1, 2, 1, 2],[2, 3, 3, 3]]) mlab.triangular_mesh(vertices[0,:], vertices[1,:], vertices[2,:], faces.T) mlab.show() It can also

Copy vtkImageData to cv::Mat

£可爱£侵袭症+ 提交于 2019-12-05 16:05:30
I am trying to copy a vtkImageData* class to a cv::Mat structure [my goal is to read an MHD file into OpenCV].. The file is essentially a 3D Matrix so I want to get a vector containing all the slices of the volume. So far, I have come up with this code, reader->SetFileName(INPUT_DATA_1.c_str()); reader->Update(); imageData_1 = reader->GetOutput(); extractVOI->SetInput(imageData_1); int dims[3]; imageData_1->GetDimensions(dims); extractVOI->SetVOI(0, dims[0], 0, dims[1], 75, 75); // Set it to z=75 extractVOI->GetOutput()->SetScalarTypeToSignedChar(); imageExport->SetInputConnection(extractVOI-