vtk

How to convert a vtkDoubleArray to an Eigen::matrix

ぐ巨炮叔叔 提交于 2019-12-25 02:32:13
问题 I've found the Eigen::Map class for converting a raw array to an Eigen class (and some useful snippets here https://stackoverflow.com/a/12007784/1136458 ) Is there any Eigen or vtk class to convert a vtk array to an Eigen class (and back)? What I am trying right now is: convert vtkDoubleArray to std::vector of std::vector (as in How to get the the values of a vtkDoubleArray in a std::vector ) using map to have a matrixxd Eigen::MatrixXd eig_arr; eig_arr = Eigen::Map<Eigen::MatrixXd> (cpp

Compare vtk data types and basic data types

空扰寡人 提交于 2019-12-25 01:16:56
问题 VTK has typedefs for basic types (float, int, double, etc.), and it assigns an integer per type. They are specified here. The function GetDataType() , for example in vtkDataArray returns an integer that corresponds to one of the types. I would like to compare that integer with the basic data types (float, int, double). Is there a way of doing so, easily ? The usage I have of this is a template class which parameter T is a scalar. I want to check if the scalar point data of a dataset has the

VTK - Migrating from 6.1 to 8.2

心已入冬 提交于 2019-12-24 20:14:11
问题 I have a VTK/MFC project which use VTK 6.1 / VS2008. I intend to migrate this project to VTK 8.2 / VS2010, and I encounter a problem: at stdafx.h, VTK 6.1 I have: #define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle, vtkRenderingFreeType, vtkRenderingFreeTypeOpenGL, vtkRenderingOpenGL) #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL) These inits doesn't work on VTK 8.2, I get a link error: error LNK2001: unresolved external symbol "void __cdecl vtkRenderingFreeTypeOpenGL

VTK: update data points in renderWindow at every simulation timestep

核能气质少年 提交于 2019-12-24 16:37:44
问题 There is a simulation application which outputs some vtk point data every timestep and I would like to render this data at every timestep and also keep it interactive. I have created a pipeline which takes simulation points ( points->SetInputData(data) ) as an input and applies a set of filters to it. For the sake of testing I've created a simple timer and added an observer reacting on the timer event: renderWindowInteractor->AddObserver(vtkCommand::TimerEvent, cb); int timerId =

How to use itkvtkglue to use ITK with VTK?

两盒软妹~` 提交于 2019-12-24 12:23:12
问题 I wanted to make the example which combines ITK with VTK called IO/ImageFileReader from wiki examples. I downloaded itkvtkglue, extracted to a folder, configured with cmake and built with visual studio 2010. but i can't use it when i try to configure the example given. Even though cmake finds the ItkVtkGlue_DIR by itself, it gives the error that he couldn't include the necessary files. Fails to include(${ItkVtkGlue_USE_FILE}) Should I somehow change the folders CMake looks for my ItkVtkGlue

gdcmimg to convert stack of DICOM images into a vti file?

痞子三分冷 提交于 2019-12-24 06:54:24
问题 I've compiled GDCM using CMake (using VS2012). However, I can't find gdcm2vtk.exe in my bin/Debug folder. I was able to find gdcmimg.exe , would that one work to convert a stack of images into 3D? I've read somewhere that if I'm able to generate a vti file from the stack of images then I'll be able to show it using ActiViz. Is there any known reason why I'm not seeing the file gdcm2vtk.exe? It is in the source code (I can find the gdcm2vtk.cxx source code). 回答1: The GDCM applications are not

gdcmimg to convert stack of DICOM images into a vti file?

限于喜欢 提交于 2019-12-24 06:54:11
问题 I've compiled GDCM using CMake (using VS2012). However, I can't find gdcm2vtk.exe in my bin/Debug folder. I was able to find gdcmimg.exe , would that one work to convert a stack of images into 3D? I've read somewhere that if I'm able to generate a vti file from the stack of images then I'll be able to show it using ActiViz. Is there any known reason why I'm not seeing the file gdcm2vtk.exe? It is in the source code (I can find the gdcm2vtk.cxx source code). 回答1: The GDCM applications are not

gdcmimg to convert stack of DICOM images into a vti file?

心不动则不痛 提交于 2019-12-24 06:54:07
问题 I've compiled GDCM using CMake (using VS2012). However, I can't find gdcm2vtk.exe in my bin/Debug folder. I was able to find gdcmimg.exe , would that one work to convert a stack of images into 3D? I've read somewhere that if I'm able to generate a vti file from the stack of images then I'll be able to show it using ActiViz. Is there any known reason why I'm not seeing the file gdcm2vtk.exe? It is in the source code (I can find the gdcm2vtk.cxx source code). 回答1: The GDCM applications are not

Python/vtk - set each point size individually in a vtkPolyData object?

泪湿孤枕 提交于 2019-12-24 03:16:28
问题 I am using the following code to populate a point cloud: How to display point cloud in vtk in different colors? The points are the long, lat and depth of the quakes in New Zealand right now. I want to change the point size, an scale it by a fourth value - mag - this is the magnitude data for each quake in the swarm. I'm really not familiar with the vtk wrapper, and wondered if anyone could point out at which point I can address the actor, and change each point size: Code: import vtk import

Convert bmp image into DICOM

﹥>﹥吖頭↗ 提交于 2019-12-24 00:58:17
问题 I have 800 images in BMP format and I would like to convert them into DICOM. I have started like this, but it is not working for some reason. My experience with VTK is limited: file_in = 'C:/programfile/image.bmp' file_out = 'test1.dcm' vtkGDCMImageReader() 回答1: Here it is in python: r = vtkBMPReader() r.SetFileName( 'test1.bmp' ) w = vtkGDCMImageWriter() w.SetInput( r.GetOutput() ) w.SetFileName( 'test1.dcm' ) w.Write() If your input BMP uses lookup table, you can simply pass it: r =