vtk

CMake error when configuring itkvtkglue

人走茶凉 提交于 2019-12-08 04:07:40
问题 My question is similar to Emre's question. I am trying to build the itkImageToVTKImageFilter example from the wiki. I hope to use it for a Gaussian low pass filter that I plan to apply to an image. After I download the itkvtkglue, extract it to a folder, and then press configure in Cmake, I receive the following error message: Check for working C compiler using: Visual Studio 9 2008 Check for working C compiler using: Visual Studio 9 2008 -- works Detecting C compiler ABI info Detecting C

python example app hangs on close

为君一笑 提交于 2019-12-08 03:23:49
问题 I am relatively new to python and completely new to vtk, so I started with the Camera.py example program from the vtk.org website. Running Enthought Canopy 1.4.1.1975 on Mac OSX 10.9.4 the example program runs but hangs the python interpreter on close with the following error. The kernel (user Python environment) has terminated with error code -11. This may be due to a bug in your code or in the kernel itself. I simplified the example program down to the following and still observe the same

vtk value at x,y,z point

强颜欢笑 提交于 2019-12-08 03:07:59
问题 I have a vtk file which maps temperature in 3 dimensions. I would like to determine the temperature at a given x, y, z point. I will use the following code in order to load the vtk file (Reading .vtk file): int main(int argc, char *argv[]) { // simply set filename here (oh static joy) std::string inputFilename = "setYourPathToVtkFileHere"; // Get all data from the file vtkSmartPointer<vtkGenericDataObjectReader> reader = vtkSmartPointer<vtkGenericDataObjectReader>::New(); reader->SetFileName

How to render programmatically a vtk item in qml?

会有一股神秘感。 提交于 2019-12-08 02:09:40
问题 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

How to create a CMakeLists.txt for a project containing CGAL and VTK libraries

混江龙づ霸主 提交于 2019-12-08 00:25:28
问题 I've written a small programm for evaluating sientific data (3D surface mesh). I do all the geometric calculations with functions provided by the vtk library. The vtkBooleanOperationPolyDataFilter is no robust and crashes randomly. So i decided to performe the boolean operations with functions of the cgal library (tested with some sample data -> no stability problems). Now I want to merge this two projects together. The vtk project CMakeLists.txt: cmake_minimum_required(VERSION 2.8) PROJECT

How to read a multiple frames DICOM file by c++ library?

风格不统一 提交于 2019-12-07 17:31:36
问题 How do you read a multiple frame DICOM file that is a single file contains many 2D XA images (for example, barre.nom.fr/medical/samples). I know the software (dicom2), java library (dcm4che2) and matlab method( dicomread ) can do this, but is there any method in c++ libraries like VTK, ITK or GDCM can read this type of data out? 回答1: If you want to use GDCM, simply check out the Examples/Cxx directory, in particurar the HelloVizWorld dummy example. 回答2: Please use dcmtk . Its a open source c+

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

荒凉一梦 提交于 2019-12-07 16:15:14
问题 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

No override found for vtkRenderer/ vtkRenderWindow

六眼飞鱼酱① 提交于 2019-12-07 14:32:02
问题 I'm new to vtk and when I was running a small example, it generates two errors, No override found for vtkRenderer No override found for vtkRenderWindow I googled this problem and couldn't find a proper solution. 回答1: I had such a problem when I was trying to make a VTK project without CMake, the solution was to use those two lines: #include <vtkAutoInit.h> VTK_MODULE_INIT(vtkRenderingOpenGL2) So if you are using CMake, then you probably have skipped some step while building your VTK

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

冷暖自知 提交于 2019-12-07 12:05:00
问题 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

using vtkTimerCallback with QVTKRenderWindowInteractor not working

送分小仙女□ 提交于 2019-12-07 07:18:28
Ive got a problem with vtk (8.1), pyqt5 (5.10.1). If I use the vtkCallBackTimer with the "original" vtk.vtkRenderWindowInteractor() its all working fine. But if I use the vtk.qt.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor() the callback function is executed successively with no pause. Here is the example: import sys from PyQt5 import QtWidgets import vtk from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor from mainwindow import Ui_MainWindow class vtkTimerCallback(): def __init__(self): self.timer_count = 0 def execute(self, obj, event): print(self.timer_count)