vtk

Reading data from a raw VTK (.vtu) file

爷,独闯天下 提交于 2020-01-15 09:47:45
问题 I want to extract data arrays from a .vtu file using the Python VTK module. The file looks like this (the raw data at the end of the file is ommitted): <?xml version="1.0"?> <VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian"> <UnstructuredGrid> <Piece NumberOfPoints="10471" NumberOfCells="64892"> <PointData> <DataArray type="Float64" Name="potential" NumberOfComponents="1" format="appended" offset="0"/> <DataArray type="Float64" Name="electric field" NumberOfComponents=

Reading data from a raw VTK (.vtu) file

£可爱£侵袭症+ 提交于 2020-01-15 09:47:06
问题 I want to extract data arrays from a .vtu file using the Python VTK module. The file looks like this (the raw data at the end of the file is ommitted): <?xml version="1.0"?> <VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian"> <UnstructuredGrid> <Piece NumberOfPoints="10471" NumberOfCells="64892"> <PointData> <DataArray type="Float64" Name="potential" NumberOfComponents="1" format="appended" offset="0"/> <DataArray type="Float64" Name="electric field" NumberOfComponents=

VTK交叉编译报错

梦想的初衷 提交于 2020-01-15 00:48:08
一开始就可以报错! 找不到 x11 或者找不到 什么软件,其实我之前只是简单的手动的去找! 其实我应该不用手动的去找这些,而是根据它的报错,直接到相应的cmake中,找相应的路径去修改! cmake 主要是 头文件 .h文件 以及它的路径位置,还有一些库文件的路径的。 最终总结一下问题,就是多学学cmake 的一些功能,交叉编译就可以! 一般在findpackage 的应用上是 https://blog.csdn.net/chengde6896383/article/details/86497016 ; 可以到相应的nodule 下去找 相应的findxxx.cmake文件,来解决问题。 来源: CSDN 作者: 小邢~ 链接: https://blog.csdn.net/weixin_43384504/article/details/103976778

Correct display of DICOM images ITK-VTK (images too dark)

风格不统一 提交于 2020-01-14 10:45:08
问题 I read dicom images with ITK using itk::ImageSeriesReader and itk::GDCMImageIO after reading i flip the images with itk::FlipImageFilter (to get right orientation of the images) and convert the itkImageData to vtkImageData using itk::ImageToVTKImageFilter. I visualization images with VTK using vtkResliceImageViewer in QVTKWidget2. I set: (vtkResliceImageViewer)m_imageViewer[i]->SetColorWindow(windowWidthTAGvalue[0028|1051]); (vtkResliceImageViewer)m_imageViewer[i]->SetColorLevel

binary vtk for Rectilinear_grid from fortran code can not worked by paraview [duplicate]

穿精又带淫゛_ 提交于 2020-01-11 11:57:45
问题 This question already has an answer here : Binary VTK for RECTILINEAR_GRID from fortran code (1 answer) Closed 3 years ago . I used the code posted from stackoverflow and modified it as: program VTKBinary implicit none real*4 :: x(2) = (0., 1.) real*4 :: y(2) = (0., 1.) real*4 :: z(2) = (0., 1.) character :: buffer*80, lf*1, str1*8, str2*8, str3*8 integer :: ivtk = 9, int,i lf = char(10) ! line feed character !open(unit=ivtk,file='test_bin.vtk',form='binary',convert='BIG_ENDIAN') open(unit

VTK编译(VTK-8.2.0)

冷暖自知 提交于 2020-01-07 08:42:21
1.安装VS2019 2.安装QT5.12 3.下载CMake https://cmake.org/download/ https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-win64-x64.zip 4.下载VTK库 https://vtk.org https://vtk.org/files/release/8.2/VTK-8.2.0.zip 5. 将下载后的文件解压到如下目录 E:\osg\VTK\VTK-8.2.0 6.应用CMake 参数设置如下: BUILD_EXAMPLES 如果想学习官方示例程序,那么就勾选上 CMAKE_INSTALL_PREFIX 这个表示vtk最后生成的链接库的位置,将其修改为:E:/osg/VTK/VTK VTK_Group_Imaging 勾选上 VTK_Group_Qt 勾选上 VTK_RENDERING_BACKEND设置为OpenGL 点击Add Entry,添加CMAKE_DEBUG_POSTFIX,Value设置为_debug(用来区别debug和release版本) 设定QT5的路径: D:/GISSoft/Qt/Qt5.12.3/5.12.3/msvc2017_64/lib/cmake/Qt5 再次点击configure,如无error

Centering image in VTK window

六眼飞鱼酱① 提交于 2020-01-05 03:35:29
问题 I'm using vtkTexturedActor2D and vtkImageMapper to display a 2D image. I can use actor.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay(); actor.this.Actor.SetPosition(0.5, 0.9); to place the image in the center of the window, but it's not center-aligned. The corner of the image is placed in the center. How can I center-align the image so that the center of the image is at the center of the window? 回答1: I had this same problem. This seems to solve it: float height, width; this-

利用CMake管理QT5.5+VTK6.3+ITK4.8+Opencv3.0工程

爱⌒轻易说出口 提交于 2020-01-04 09:51:32
利用CMake管理QT5.5+VTK6.3+ITK4.8+Opencv3.0工程 2016年03月16日 19:16:42 RaymondLove~ 阅读数:1859 主要参考: opencv3.1.0的Tutorial:http://docs.opencv.org/3.1.0/db/df5/tutorial_linux_gcc_cmake.html QT Documentation:http://doc.qt.io/qt-5/cmake-manual.html Cmake手册:http://doc.qt.io/qt-5/cmake-manual.html ITK用户手册 博客:http://blog.csdn.net/luoru/article/details/49048353 VTK6.2&6.3+VS2013+QT5编译配置 前提: 系统环境:win64+VS2013+CMake3.3.1+ITK4.8+VTK6.3+Opencv3.0+QT5.5 1. 已经安装好:VS2013,QT和qt-vs-addin,并将QT与VS2013整合完毕。 2. 已经利用CMake对ITK,VTK和opencv进行编译,并配置好环境变量 注:由于我是64位系统,故在CMake编译过程中的编译器都选择的是64位的 利用CMake创建工程: 1. 新建文件夹:D:\test_ITK_VTK

“1>cl : Command line error D8021: invalid numeric argument '/Wno-deprecated'” Erro

可紊 提交于 2020-01-04 02:46:11
问题 This error: "1>cl : Command line error D8021: invalid numeric argument '/Wno-deprecated'" occurring while building VTK + Qt project by MSVC compiler. I think there is some issue with flag settings. following is my CMakeList.txt cmake_minimum_required(VERSION 2.8) PROJECT(QtImageViewer) IF(NOT VTK_BINARY_DIR) FIND_PACKAGE(VTK) INCLUDE(${VTK_USE_FILE}) ENDIF(NOT VTK_BINARY_DIR) SET(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "") SET(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE}

How do I get the bounding box of point data?

元气小坏坏 提交于 2020-01-03 17:51:07
问题 How do I get the range of the data set? Also known as the bounding box for the data. The data is read with the StructuredPointsReader . 回答1: Because vtkStructuredPoints (the type of GetOutput() on a vtkStructuredPointsReader) is a subclass of vtkDataSet, you can use the GetBounds(double[6]) function of vtkDataSet. Here is an example: double bounds[6]; structuredPointsReader->Update(); structuredPointsReader->GetOutput()->GetBounds(bounds); std::cout << "xmin: " << bounds[0] << " " << "xmax: "