vtk

How to read a DICOM file of Dynamic DSA image

不羁岁月 提交于 2019-12-11 22:24:51
问题 I have a Dynamic DSA image of DICOM format, it consists of a header of patient information etc and a series of X-ray image data to show the bone motion in only one file. Is there any method in librarys like VTK, ITK or GDCM can read this data out? 回答1: To load a multiframe DICOM in VTK, simply use GDCM, in particular gdcmviewer: $ gdcmviewer input.dcm 来源: https://stackoverflow.com/questions/19318858/how-to-read-a-dicom-file-of-dynamic-dsa-image

How to set zoom factor in Mayavi

余生长醉 提交于 2019-12-11 20:39:40
问题 I am trying to set the zoom factor in Mayavi2, for example: from mayavi import mlab mlab.test_plot3d() mlab.show() f = mlab.gcf() cam = f.scene.camera cam.zoom(0.1) mlab.draw() but nothing happens. The zoom is the same as before; have I missed something? 回答1: It seems that you have just inverted 2 lines. mlab.show() and mlab.draw() ! Try this: from mayavi import mlab currfig = mlab.test_plot3d() mlab.draw() cam = currfig.scene.camera for ii in range(100): cam.zoom(0.99) mlab.draw() mlab.show(

I get “TypeError: a is undefined” when I try to load specific VTK file

痴心易碎 提交于 2019-12-11 18:55:24
问题 I try to load VTK file using three.js, I have changed only one line in example file: loader.load( "models/vtk/srtm.vtk" ); Here is my VTK file. There is TIN vector map, prepared in GRASS GIS, and converted using v.out.vtk command. I am very new in Three.js and 3D Graphics, I just want to check some possibilities of Three.js for further work. 来源: https://stackoverflow.com/questions/19941888/i-get-typeerror-a-is-undefined-when-i-try-to-load-specific-vtk-file

How to convert the coordinate between pixel and physical (vtkImageReslice)?

久未见 提交于 2019-12-11 15:51:28
问题 I reslice a 2D image from a 3D volume image by vtkImageReslice. Then, I convert the image (matrix) from vtkImageReslice.GetOutput(). My question is: for one pixel (x, y) in image, what's the coordinate in 3D volume? I have found a solution to convert the coordinate from vtkImageReslice to 3D volume: vtkImageReslice.GetResliceAxes().MultiplyPoint(). However, how to convert the coordinate from pixel to vtkImageReslice? The vtkImageReslice need two inputs: the axes and center point. However, I

Importing Excel Data for Isovolume Rendering Paraview

心已入冬 提交于 2019-12-11 10:37:42
问题 I am trying to visualize heat intensity data(0 to 1)based on xyz . I have the data in a excel file and also in a csv file. In csv, the format is as follows: x, y, z, scalar 0, 1, 1, 0.489324 1, 1, 1, 0.899 . . . Each unit on an axis represents one voxel. There are totally 12 voxels along each axis. I would like visualize something close to this -> https://www.youtube.com/watch?v=UMnIwdQhZE4. How do i import either an excel data or csv into paraview? Is there a way to copy paste values from

vtk data format error

泄露秘密 提交于 2019-12-11 06:56:47
问题 I'm trying to visualize some data I have stored on a regular grid using VTK (drawing a colored isosurface). I wrote some code to dump the data in the vtk legacy format which works for low resolution versions of the data. I can extract and view the expected isosurface with ParaView or the VTK library. When I increase the resolution by a factor of 10 in each dimension (nx goes from about 100 to 1000, same with ny, nz), paraview and a viewer I wrote using the VTK library are incorrect. They look

Reading .vtk file

天涯浪子 提交于 2019-12-11 06:27:55
问题 I'm working on VTK (Qt on ubuntu 10.04) . I'm trying to read a .vtk file having 3D image. As I could understand, this http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/GenericDataObjectReader makes it possible to read any vtk file. However, it does not work. All I get is : Starting /home/taha/Downloads/VTK/Examples/qtcreator-build/GenericDataObjectReader... Usage: /home/taha/Downloads/VTK/Examples/qtcreator-build/GenericDataObjectReader InputFilename /home/taha/Downloads/VTK/Examples/qtcreator

Linking VTK with ndk-build on NDK r17c results with 'undefined references' errors

ε祈祈猫儿з 提交于 2019-12-11 04:55:33
问题 I had built VTK on Linux with Android NDK r17c and the result was 54 static (.a) libraries of total 600+ MB. Now, I had imported these librarires to my AndroidStudio 3.3 project and I would like to use the built libraries in my native code. In Android Studio I am using the same version of the NDK (r17c). In AndroidStudio I had created new module for using the VTK and inside that module I am using ndk-build for building the library. The structure of the module is: ... |--jni/ |--|--include/ |-

Convert mayavi mlab.contour3d plot to vtkPolyData

强颜欢笑 提交于 2019-12-11 04:26:57
问题 I am trying to get the triangulated vtkPolyData from a mlab.contour3d plot. I am using mayavi because it seems to be the fastest way to get minimal surfaces triangulated properly. I need it as vtkPolyData because I want to save it as an .stl file. Here is a MWE of my code: import numpy as np from mayavi import mlab def fun(x, y, z): return np.cos(x) + np.cos(y) + np.cos(z) x, y, z = np.mgrid[-1:1:100j, -1:1:100j, -1:1:100j] contour = mlab.contour3d(x, y, z, fun) mlab.show() What I get then

vtkPythonAlgorithm Controlling pipeline execution

南笙酒味 提交于 2019-12-11 01:34:22
问题 I am trying to write a vtk filter in python ProjectDepthImage Doing the projection isn't the problem. It's controlling the execution of the vtk pipeline. Basically, I have a callback on 'UserEvent' (which is triggered when a user hits the key 'u' while the render window is active.) This calls the function: render_point_cloud() I have found that I need to call both dif.Modified() and pdi.Update() in this callback or I will get unexpected results. However, by doing this this RequestData() gets