昨晚发现用geomagic抽出的面模型有个很大的问题——刚好反转过来的!!也就是说。。。肝跑到左边去了。。。胃在右边。。。。这让我百思不得其解
还好google给我搜对关键词了,原来是vtk和itk的坐标系不一样的问题,下面是引用
VTK uses the computer graphics standard of having the origin
at the upper left of a screen
ITK uses the mathematical standard of having the origin on
the lower left.
Note however that all this is irrelevant since ITK does
provide any visualization functionalities. At the end
what matters is how all the elements map to physical space.
VTK是左上角 ITK是左下角。。。 这就是问题的来源了
This is a common problem. VTK and ITK use different conventions. ITK
uses image convention where the first pixel in memory if shown in the
upper left of the displayed image. VTK uses computer graphics
convention where the first pixel in memory is shown in the lower left
of the displayed image.
The ITK convention conforms to radiology convention.
You can use vtkImageFlip to flip the vtk images about the y axis.
There are other differences. VTK images do not honor the orientation
of DICOM images while ITK images do.
如何解决呢,使用vtkImageFlip这个类,把整个volume按Y轴反转就行了。。。。如此简单啊
vtkSmartPointer <vtkImageFlip> imageflip =vtkSmartPointer<vtkImageFlip>::New();
imageflip->SetInput(image);
imageflip->SetFilteredAxes(1);//Y轴
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步