vtk

VTK Render into C#

纵饮孤独 提交于 2019-12-30 11:22:09
问题 I have a c++ application that uses VTK, I want to have vtkRenderWindow and put it into C# WPF project without using C# wrapper. 回答1: The main idea of this is to set the HWND as parent of the vtkRenderWindow Here is how to do that: C++ class: class MyRender { //attributes .... MyRender(HWND parent) { renderer = vtkSmartPointer<vtkRenderer>::New(); _render = vtkSmartPointer<vtkRenderWindow>::New(); _render->AddRenderer(renderer); interactor = vtkSmartPointer<vtkRenderWindowInteractor>::New();

CMake: Run-time error (dyld: Library not loaded) for dynamically linked resources on MacOS

拜拜、爱过 提交于 2019-12-30 10:04:44
问题 Problem On MacOS, I get linking problems at runtime for a CMake project that depends on dynamically linked resources – but only after installing the project! The problem does not occur when I only build the binary without installing it. $ ./testapp Hello world! $ $INSTALLDIR/testapp dyld: Library not loaded: @rpath/libvtkDomainsChemistryOpenGL2-7.1.1.dylib Referenced from: /Users/normanius/workspace/installdir/testapp Reason: image not found [1] 76964 trace trap /Users/normanius/workspace

ImportError: No module named vtkCommonPython

自古美人都是妖i 提交于 2019-12-28 06:29:51
问题 I am trying to install Python with VTK on my computer, but when I want to import VTK, I get an error: import vtk Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\vtk\Wrapping\Python\vtk\__init__.py", line 41, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython I already checked my paths and I have the file 'vtkCommonPython.pyd' in the bin folder. Can anyone help me with this problem? 回答1: I ran into a very similar problem, and

vtk学习记录(二)——新建vtk工程及Qt配置vtk

妖精的绣舞 提交于 2019-12-26 07:12:49
前言 前面 vtk学习记录(一)——vtk工程配置与生成 我们已经生成了vtk的类库,下面就是新建自己的工程来实现业务功能了。 配置Qt 下载安装Qt的过程就不赘述了,只是一个安装过程。 在我们之前生成的类库目录下复制 QVTKWidgetPlugin.dll ,目录如果没有问题基本上就是 \plugins\designer 。 把这个dll文件复制到qt的designer下,我的版本是5,目录可以参考 \Qt5.9.1\5.9.1\msvc2015_64\plugins\designer 。 新建Qt工程 打开vs,新建 Qt GUI Application 。 一个Next之后,勾选自己需要的模块。 之后选择基类。 至于这三个选哪个,看自己需要了。 QWidget: 是所有用户交互界面的基类,也就说其它两个是它的子类。 需要嵌入其他窗体的可以用这个。 QMainWindow: 常规的winform操作,菜单栏,工具栏,状态栏什么的一大堆集成的一个窗体程序。 主窗口直接选这个 QDialog: 顾名思义,对话框嘛,如果只是给用户一个类似于表单之类的或者类似confirm的话,当然都是些简单的操作,确定取消什么的可以用这个。 顶级对话框选这个 之后点击Finish我们就创建了个qt的工程了。 配置 首先我们需要一个扩展工具,在vs中 工具->扩展和更新 ,安装 Qt Visual

Apply an image on cube faces - VTK

醉酒当歌 提交于 2019-12-25 08:54:10
问题 I use VTK on visual studio 2010, I would like apply an image on the cube faces. Code to read my image : // Read JPG image vtkSmartPointer<vtkJPEGReader> JPEGReader = vtkSmartPointer<vtkJPEGReader>::New(); JPEGReader->SetFileName(argv[1]); JPEGReader->Update(); // Image actor vtkSmartPointer<vtkImageActor> imageActor = vtkSmartPointer<vtkImageActor>::New(); imageActor->GetMapper()->SetInputData(JPEGReader->GetOutput()); Setup cube code : // Setup cube vtkSmartPointer<vtkCubeSource> cubeSource

How does paraview read a vtk file?

北慕城南 提交于 2019-12-25 08:47:26
问题 I have a general question as to how paraview reads a ASCII UNSTRUCTURED_GRID. Does it sort through the cells and then points? or points then cells? 回答1: Paraview is built on the VTK library and both of them are open source, so if you are a programmer, you should be able to get all your answers by reading the code. What I assume (but I can be wrong, check sources of paraview to be sure) paraview uses for reading ASCII unstructured grids is vtkUnstructuredGridReader, source code of which you

why is “candidate function(s) not accessible” although declared public

自作多情 提交于 2019-12-25 08:25:13
问题 I am getting compile error candidate function(s) not accessible when calling certain members, although I declared them as public . I only get the error when some class from vtk is involved (as return type or as argument) and when the class to be called is not in the same VS-project as the calling code. I also tried other vtk types with no luck :( Here is some test code: // A.h, in a seperate class library #include <vtkActor.h> public ref class A { public: A(void); void test1(vtkActor* actor);

Thread freezing the application

夙愿已清 提交于 2019-12-25 04:43:15
问题 I'm designing an application which reads DICOM data sets and visualizes them with volume rendering techniques by using VTK library. Anyway, the problem I'm dealing is volume rendering is really CPU-bounded process. If I handle the volume rendering in a single threaded process, application (GUI) freezes and passes to "not responding" state. I have written another thread for volume rendering process. However GUI still freezes, here are the codes. private: System::Void volumeRenderButton_Click

How to set Window Width/Window Centers with vtkImageActor (or vtkActor)?

依然范特西╮ 提交于 2019-12-25 03:49:25
问题 I want to set Windows Width/ Windows Center value when use vtkImageActor/vtkActor. But I could not find the way to solve it. (If I use vtkActor2d, it's okay, but I don't want to use it) 回答1: Attach a vtkWindowLevelLookupTable to your mapper. Basic Example: vtkSmartPointer<vtkWindowLevelLookupTable> myLookupTable = vtkSmartPointer<vtkWindowLevelLookupTable>::New(); double WindowWidth = myImageReader->GetOutput()->GetScalarRange()[1] - myImageReader->GetOutput()->GetScalarRange()[0]; double

Install VTK 6.2.0 with Qt 5.4 using CMake-GUI 3.2.2

徘徊边缘 提交于 2019-12-25 03:34:39
问题 This is the first time I try to use Vtk libraries but I can not find a tutorial that can help me with the qt integration. I tried several tutorials but when I try to write some code, qt can not find vtk libraries. I followed this post but something doesn't work correctly: Combining Qt 5.4.1 with vtk 6.2.0 (using CMake GUI 3.2.1) on windows Can someone explain me the correct procedure? I'm using Windows 7 64 bit, VTK 6.2.0, QT 5.4 and CMake-GUI 3.2.2. Thanks to all who respond! 回答1: Did you