问题标签 [vtk]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
582 浏览

.net - 线程冻结应用程序

我正在设计一个应用程序,它读取DICOM数据集并使用VTK库使用体积渲染技术将它们可视化。无论如何,我要处理的问题是体积渲染实际上是受 CPU 限制的过程。如果我在单线程进程中处理体积渲染,应用程序 (GUI) 会冻结并进入“无响应”状态。我已经为体积渲染过程编写了另一个线程。但是 GUI 仍然冻结,这里是代码。

threeDPictureBox 是一个 PictureBox 组件,我将它发送到 dicom 对象的 volumeRender 方法。vrSettings 是体积渲染参数的结构。
当单击音量渲染按钮并触发单击事件处理程序时,即使我将其优先级设置为最低,volumeRenderThread 也会启动并冻结应用程序!我也尝试过评论的行。它们都不起作用。我错过了什么?感谢您从现在开始的答案!

0 投票
2 回答
896 浏览

c++ - 如何使用 vtk 实时可视化在另一个线程中运行的计算

我想用可视化工具包实时可视化另一个线程中正在运行的计算。计算会产生一组新的值以在每次迭代时可视化,并且图形线程必须知道这一点并加载新值。

一种方法是让主线程轮询计算的状态。理想情况下,我不想进行任何民意调查,但如果没有其他方法,那么我会的。

我能想到的最好方法是让计算线程在计算的每次迭代中将一个事件推送到主线程的事件队列中,然后由 GUI 处理。我不确定如何去做,或者是否可以以线程安全的方式完成。

我正在使用 pthreads 在 linux 上的 gcc/C++ 中使用 vtk。

0 投票
3 回答
4588 浏览

opengl - 如何在 vtk 中绘制图元(点、线等)?

我需要在 vtkActor 上绘制原语,但我不知道如何。也许我可以为此使用opengl函数?在此示例http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/Diagram中它正在工作,但我需要以交互方式绘制它。感谢您的回答。

0 投票
1 回答
810 浏览

c++ - 某些 VTK 库文件是否包含错误?

我设法在我的 ubuntu 上安装了 vtk。我使用 code::Blocks 作为编译器,在 c++ 中工作。我还编译并运行了 vtk 示例网页中给出的一些示例。但是在某些示例中,例如当涉及 vtkChart.h 时,我的编译器会给出引用文件内容的错误。

这些头文件是自动生成的,应该没有错误。您可以查看下面的图片。可能有什么问题?是编译器造成的吗?

谢谢大家。

在此处输入图像描述

对于看不到图片的人,代码如下:

仅对于显示的代码段,会出现以下错误。

../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|38|错误:“{”标记之前的预期类名|

../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:'vtkContextItem'没有命名类型|

../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:'vtkContextItem'尚未声明|

../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:从类型“vtkObjectBase*”到类型“vtkChart*”的静态转换无效|

../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual vtkObjectBase* vtkChart::NewInstanceInternal() const':|

../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:'新'不是'vtkChart'的成员|

继续..

0 投票
1 回答
477 浏览

qt - QVTKWidget + vtkRectilinearWipeWidget = 可视化问题

你好,

我试图在我的 Qt 应用程序中使用 vtkRectilinearWipeWidget。

当我创建一个新的 vtkRenderWindowInteractor 时,一切正常,我在一个单独的窗口中获得了一个完全工作的小部件。但我希望小部件位于我的应用程序中,我在其中创建了一个 qvtkwidget。

问题是,当我运行我的应用程序时,会出现 vtkRectilinearWipe,但缺少所有小部件功能(例如移动拆分的滑块)。

相反,我可以用鼠标旋转 2D 图像。

下面我粘贴了我的代码(或者Pastebin),如果有人可以看一下它并找出我做错了什么,我将非常感激。

http://pastebin.com/ufayPzv

0 投票
1 回答
2319 浏览

vtk - 彩色图像的亮度和对比度

有谁知道,我如何改变彩色图像的亮度和对比度。我知道vtkImageMapToWindowLevel,但是在这个类中设置图像的级别或窗口后,彩色图像变为灰度。

感谢您的回答;

0 投票
1 回答
732 浏览

c++ - vtkCharts 库不适用于 Visual Studio 和 GCC 编译器 - 为什么?

我是 vtk 的新手,我想使用 vtkCharts 库。在 Linux 和 Windows 中,我编译了 vtk 并设法使用了大多数示例。

唯一麻烦的例子是那些包括图表库的例子,比如链接中的那个:

线图示例

当我编译时,在 Visual Studio 中它会给出一些链接错误。下面有一段。我没有忘记包含 vtkCharts 库。

1>vtkCharts.lib(vtkContextView.obj):错误 LNK2019:未解析的外部符号“受保护:虚拟 __thiscall vtkRenderView::~vtkRenderView(void)”(??1vtkRenderView@@MAE@XZ) 在函数“受保护:虚拟 __thiscall vtkContextView”中引用::~vtkContextView(void)" (??1vtkContextView@@MAE@XZ) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2019: unresolved external symbol "public: virtual void __thiscall vtkRenderView::SetDisplayHoverText(bool)" ( ?SetDisplayHoverText@vtkRenderView@@UAEX_N@Z) 在函数“受保护:__thiscall vtkContextView::vtkContextView(void)”(??0vtkContextView@@IAE@XZ) 1>vtkCharts.lib(vtkContextView.obj) 中引用:错误 LNK2019:未解决外部符号“受保护:__thiscall vtkRenderView::vtkRenderView(void)”(??0vtkRenderView@@IAE@XZ) 函数“受保护:__thiscall vtkContextView::vtkContextView(void)”(??0vtkContextView@@IAE@XZ) 1>vtkCharts.lib(vtkContextView.obj) 中引用:错误 LNK2001:未解决外部符号“public:virtual void __thiscall vtkView::Update(void)”(?Update@vtkView@@UAEXXZ) 1>vtkCharts.lib(vtkContextView.obj):错误 LNK2001:未解析的外部符号“public:virtual void __thiscall vtkRenderView: :ApplyViewTheme(class vtkViewTheme *)" (?ApplyViewTheme@vtkRenderView@@UAEXPAVvtkViewTheme@@@Z) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2001: unresolved external symbol "protected: virtual void __thiscall vtkRenderView::ProcessEvents(class vtkObject *,unsigned long,void *)" (?ProcessEvents@vtkRenderView@@MAEXPAVvtkObject@@KPAX@Z)(?ProcessEvents@vtkRenderView@@MAEXPAVvtkObject@@KPAX@Z)

在 Code::Blocks 中,使用 GCC,它会给出如下错误:

./VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|38|错误:“{”标记前的预期类名| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:'vtkContextItem'没有命名类型| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:'vtkContextItem'尚未声明| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:从类型“vtkObjectBase*”到类型“vtkChart*”的静态转换无效| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual vtkObjectBase* vtkChart::NewInstanceInternal() const':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|错误:'新'不是'vtkChart'的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual vtkAnnotationLink* vtkChart::GetAnnotationLink()':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|错误:“类 vtkChart”没有名为“GetDebug”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual void vtkChart::SetGeometry(int, int)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|错误:“类 vtkChart”没有名为“GetDebug”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|错误:'class vtkChart'没有名为'Modified'的成员| .. /VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual int* vtkChart::GetGeometry()':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:'class vtkChart'没有名为'GetDebug'的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual void vtkChart::GetGeometry(int&, int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:'class vtkChart'没有名为'GetDebug'的成员| “类 vtkChart”没有名为“GetDebug”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual void vtkChart::GetGeometry(int&, int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:'class vtkChart'没有名为'GetDebug'的成员| “类 vtkChart”没有名为“GetDebug”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:“类 vtkChart”没有名为“GetClassName”的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在成员函数'virtual void vtkChart::GetGeometry(int&, int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:'class vtkChart'没有名为'GetDebug'的成员| GetGeometry(int&, int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:'class vtkChart'没有名为'GetDebug'的成员| GetGeometry(int&, int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|错误:'class vtkChart'没有名为'GetDebug'的成员|

我在两个平台上都使用 vtk 5-6。我想知道为什么会出现这个错误。

谢谢你。

0 投票
3 回答
3234 浏览

c++ - 如何在不关闭 VTK 渲染窗口的情况下使代码流畅?

我正在使用 Visual Studio 2010、VTK 5.6 并在不使用 CMake 的情况下配置我的项目。

我正在处理数值计算,并希望在运行时使用 VTK 生成多个图。从 VTK 网页中给出的线图示例开始,我设法生成了我想要的图。问题是代码在不关闭绘图窗口的情况下无法继续。

从我的“main.cpp”文件中,我将命令发送到一个头文件,在该头文件中启动 VTK 过程。

“residualPlotter”是生成绘图的函数。下面给出:

所以,我希望代码继续运行而无需关闭窗口。我应该如何修改代码?

谢谢你们。

0 投票
1 回答
267 浏览

opengl - OpenGL中的vtkaxesactor类型轴

我需要在 OpenGL 的 VTK(vtkaxesactor 类)中显示 xyz 轴,它位于场景的左下方。

我正在寻找前景中的 3(x,y,z) 彩色轴,它在旋转时会产生方向感,但与缩放无关。

是否有执行此操作的 GLUT 类?如果不是,如何实现这一点?

编辑以下 datenwolf 的评论:

我跟踪 x、y、z 平移和平移的范围。(我使用 pyopengl)

这可以完成工作,但是我怀疑这是否是最好的方法。

0 投票
1 回答
2235 浏览

visual-studio-2008 - 如何通过 VTK 安装、构建和使用 GDCM?

我在开始使用 GDCM(Grassroots Dicom)时遇到问题。虽然我实际上可以毫无问题地运行 VTK 示例,但当我尝试使用 GDCM 时,我总是遇到以下错误:

当我构建 GDCM 时,它做得很好。我已逐步按照 GDCM 网页中的指南进行操作,但仍然无法成功运行程序。那么,任何人都可以向我发布指南或给我一些建议吗?

我在 Windows7 中并在 Visual Studio 2008 中工作并使用 CMake。