vtk

VTK: Rotate actor programmatically while vtkRenderWindowInteractor is active

泄露秘密 提交于 2019-12-13 12:15:03
问题 I'm trying to rotate a vtkActor using vtkActor::RotateZ and then calling vtkRenderWindow::Render . It works fine (it rotates the actor) but I can't move, resize, or even focus the window. I suspected this was caused due to something not catching operating system events, so I added a vtkRenderWindowInteractor to the mix. Now I can move, resize and focus the window, but the actor is not rotating anymore. I've isolated the code in the snippet below, comment line 43 to see both effects:

Flip a DICOM Image over the x = y Line

情到浓时终转凉″ 提交于 2019-12-13 05:24:46
问题 I am working on displaying a DICOM image. But it requires me to flip the incoming DICOM image about the x = y line. In other words, I want to rotates the image about the x = y axis with 180 degree I have found setFlipOverOrigin() from vtkImageFlip. However, it seems not working. Could anyone suggest me a method or how to use setFlipOverOrigin() correctly if it helps. Thanks in advance. 回答1: Try using vtkTransform class, and apply a 180 degrees rotation around the axe (1, 1, 0) => x = y = 1 ;

Paraview Python — Reverse operation to servermanager.Fetch()?

老子叫甜甜 提交于 2019-12-13 04:42:38
问题 I am using Paraview with the Python Shell and I want to modify some coordinates. The considered data is opened using a reader, the new coordinates are saved just as txt. I obtain the grid from the reader by using the Fetch()-routine and then modify it -- but my question is: can I somehow "return" the now changed grid to the reader-object and then Show() it? Here is the code used so far: from paraview import simple from paraview.vtk import * import numpy as np reader=simple.LSDynaReader

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

半城伤御伤魂 提交于 2019-12-13 03:55:27
问题 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]: *** [CMakeFiles

Vtk charts break in QT, “no override found for 'vtkContextDevice2D”

落花浮王杯 提交于 2019-12-13 03:30:01
问题 I can't use any type of vtk 2D chart in QT without getting the error: "Generic Warning: In vtkContextDevice2D.cxx, line 31 Error: no override found for 'vtkContextDevice2D". There is limited discussion on this with almost all suggestions being to upgrade qt/vtk, but theses are year old and I am on the newest versions. This doesn't help either: include "vtkAutoInit.h" VTK_MODULE_INIT(vtkRenderingOpenGL2); // VTK was built with vtkRenderingOpenGL2 VTK_MODULE_INIT(vtkInteractionStyle); Info:

How to compile project using VTK library using Makefile?

回眸只為那壹抹淺笑 提交于 2019-12-13 03:18:30
问题 For this reason I downloaded the C++ library VTK and made a local build in the build subdirectory on a OSX environment. I would like to compile a project using this library (particularly I am using the class vtkSmartPointer ) with Makefile . Consider for example the following source code: #include<iostream> #include<vtkSmartPointer.h> #include<vtkCallbackCommand.h> int main() { vtkSmartPointer<vtkCallbackCommand> keypressCallback = vtkSmartPointer<vtkCallbackCommand>::New(); std::cout<<"hello

How to pause and restart an animation in VTK

☆樱花仙子☆ 提交于 2019-12-13 00:36:33
问题 I am trying to do an animation program in VTK, in which I could make the VTK objects animate but I failed to do pausing animation and restart animation, I came to know recently to stop the VTK timer but after if I click the animate button again to start then the program got crashed with following error, I have only one clue that the following line is crashing but this line will work at the first time of animation button click but fails on the second button click!!. The second function

Add and remove vtkChartXY/vtkContextView within a QVTKWidget renderer

二次信任 提交于 2019-12-12 23:50:57
问题 I currently have a Qt MainWindow , which holds a number of controls including a QVTKWidget . I can easily add a vtkChartXY object using a vtkContextView to the QVTKWidget : vtkSmartPointer<vtkContextView> m_2Dview = vtkSmartPointer<vtkContextView>::New(); m_2Dview->SetRenderWindow(this->QVTKWidget->GetRenderWindow()); However, once I have it in the QVTKWidget , I can not find a way to return to the 3d view. I tried using the vtkContextActor , but it led to interaction issues. However, I'm

Combining two solutions in one using cmake

耗尽温柔 提交于 2019-12-12 18:40:57
问题 I have two seperate Visual Studio 2013 solutions and I want to migrate them into one single solution since the first solution (using Qt) serves as the GUI for the second solution. At the end I would like to have a single solution with a structure like this: --Solution -------All Build -------Project 1 ----------------External Dependencies ----------------header files ----------------Source files -------Project 2 ----------------External Dependencies ----------------header files --------------

How to subclass vtkActor

不羁岁月 提交于 2019-12-12 14:46:10
问题 I wanted to be able to access my underlaying data structure when I pick a vtkActor . A class derived from vtkActor holding a ptr to my data structure seemed the easiest approach. I get the subclass to compile just fine but the actor does not seem to be added to the renderer. So, here's my class: //.h #include <vtkActor.h> #include <vtkObjectFactory.h> class Node; struct Actor : public vtkActor { static Actor* New(); vtkTypeMacro(Actor, vtkActor) Node* holding_node; }; //.cpp #include "actor.h