vtk

Failure installing VTK from PyPI on x86_64

最后都变了- 提交于 2019-12-12 10:04:42
问题 I know that VTK is now available as a wheel in PyPI (https://pypi.python.org/pypi/vtk/8.1.0) but I am not able to install it. Is there a way around this? When I try this is what I get: $ pip install vtk Collecting vtk Could not find a version that satisfies the requirement vtk (from versions: ) No matching distribution found for vtk I have tried pointing to the wheel's URL but still the same problem. $ pip install https://pypi.python.org/packages/13/7f

c++ conflicting versions when loading package

好久不见. 提交于 2019-12-12 05:20:12
问题 I know nothing from c++ . I installed two versions of some package called ITK . For some reason, the 4.8 version has its .cmake file in /usr/local/lib/cmake/ITK-4.8/UseITK.cmake and the 3.16 file /usr/local/itk/lib/InsightToolkit/UseITK.cmake . So now, I am trying to build some project that requires 3.16 version that has in its CMakeLists.txt this : find_package(ITK) ... include( ${ITK_USE_FILE} ) but ${ITK_USE_FILE} is /usr/local/lib/cmake/ITK-4.8/UseITK.cmake . (what I understand is that

How to use numpy in the Programmable Filter in ParaView

China☆狼群 提交于 2019-12-12 04:38:18
问题 Assume, I have a ProgrammableFilter in paraview, which gets two inputs: mesh1 with data and mesh2 without. Furthermore, I know the permutation of the points from mesh1 to mesh2. Inside the filter, I can access the point values through data0=inputs[0].GetPointData().GetArray('data')` and obtain a part of the array using subData=data0[0:6] for example. But how could I add this subData to the output without a python loop? To experiment with the code, I created a (not so small) working example: #

VTK - How to use vtkNetCDFCFReader to read an array or variable array at specific time frame

半城伤御伤魂 提交于 2019-12-12 04:33:38
问题 Im trying to load an array at a specific time frame (for example if it has 50 frames or time units then get an array corresponding to the 2nd time frame) from netCDF files (.nc). Im currently using vtkNetCDFCFReader and getting the data array "vwnd" from the 1st time frame like this: vtkSmartPointer<vtkNetCDFCFReader> reader = vtkSmartPointer<vtkNetCDFCFReader>::New(); reader->SetFileName(path.c_str()); reader->UpdateMetaData(); vtkSmartPointer<vtkStructuredGridGeometryFilter> geometryFilter

VTK how to Import 3D image data via imageImport on c++ for Volume Rendering

元气小坏坏 提交于 2019-12-12 04:29:20
问题 Through VTK Python API, we can import/make 3d image data and Volume Rendering as follow: And the Python code is: # coding=utf-8 import vtk from numpy import * import random num = 74 # We begin by creating the data we want to render. # For this tutorial, we create a 3D-image containing three overlapping cubes. # This data can of course easily be replaced by data from a medical CT-scan or anything else three dimensional. # The only limit is that the data must be reduced to unsigned 8 bit or 16

VTK - How to read Tensors/Matrix per cell from a NIFTI Image?

﹥>﹥吖頭↗ 提交于 2019-12-12 03:46:47
问题 I'm trying to implement a MRT-DTI real-time fibertracking visualization tool based on VTK . Therefore we need to read the DTI tensors /matrices per cell stored in a NIFTI Image (.nii) and I really can't figure out how to do this. It's not a problem to retrieve a single scalar value from the NIFTI file, but I don't know how to get the tensor (3x3/4x4 matrix). We would really appreciate any help ! Since the NIFTIImageReader is supposed to read a tensor NIFTI image as a multi-component vtkImage

Non-virtual version of vtkDataArrayTemplate

随声附和 提交于 2019-12-12 02:53:10
问题 I have a template class myClass<T> , where T can be a scalar (float, int, double, etc.) I would like to create a vtkFloatArray , vtkIntArray , or vtkDoubleArray , depending on the type T. I thought that vtkDataArrayTemplate<T> would be a good solution. Unfortunately, it is a virtual class, so I can't write this : vtkSmartPointer< vtkDataArrayTemplate<T> > array = vtkSmartPointer<vtkDataArrayTemplate<T> >::New(); because when I try to instantiate a myClass, I get the error : error: invalid

Convert mouse position

眉间皱痕 提交于 2019-12-12 01:48:03
问题 I have following code: int p[2]; m_pRenderWindow->GetInteractor()->GetEventPosition(p); vtkRenderer* pFoundRenderer = m_pRenderWindow->GetInteractor()->FindPokedRenderer(p[0], p[1]); if(m_pRenderer2 == pFoundRenderer) { // do something } On the m_ pRenderWindow I have 4 renderers ... when the m_ pRenderWindow is restored, ( is not spread on entire screen for instance ), p[0] and p[1] are NOT correct ( when the mouse is over a renderer3 the code says that the mouse is over renderer2, or

xtk volume rendering with .vtk file created from matlab

99封情书 提交于 2019-12-12 00:34:48
问题 I am beginning with XTK. I would like to load a .vtk file in order to make volume rendering into XTK. This .vtk file has been created with a matlab function which saves a 3D data array (voxel) into vtk format : function savevtk(array, filename) % savevtk Save a 3-D scalar array in VTK format. % savevtk(array, filename) saves a 3-D array of any size to % filename in VTK format. [nx, ny, nz] = size(array); fid = fopen(filename, 'wt'); fprintf(fid, '# vtk DataFile Version 2.0\n'); fprintf(fid,

Qt 4.7 + VTK 5.6.1 on Mac OS X 10.6: errors linking projects

拟墨画扇 提交于 2019-12-11 23:48:48
问题 I'm UNSUCCESSFULLY trying to build the Qt + VTK examples included in VTK's 5.6.1 distribution (.../VTK/Examples/GUI/Qt/). Here's what I'm using: - VTK distribution: 5.6.1 - Qt IDE: Qt creator 2.7.1 (based on Qt 4.7.0) - Mac OS X version: 10.6.6 Also in the .pro project file on Qt I've included my vtk headers and lib directories: INCLUDEPATH += /Users/catamigue/Documents/Migue/Developer/bin/vtk561/include/vtk-5.6 LIBS += -L/Users/catamigue/Documents/Migue/Developer/bin/vtk561Dyn/lib/vtk-5.6