vtk中用到的函数总结,待续

本文介绍了如何使用SetValue函数设置等高线值,并详细解释了其参数含义与使用方法。此外,还提供了将quarter中的raw格式图像转换为适用于vtkVolume16Reader类的mha格式的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SetValue

 

Generate numContours equally spaced contour values between specified range. Contour values will

include min/max range values.


No worries! It’s not very clear in the docs.
So for instance, lets say you want to generate 1 contour with a value of 100.
The call would  look like this:
    contour->SetValue(0, 100);

If you wanted to change the value of this contour to 200 your call would be like this:
    contour->SetValue(0, 200);

Now if you wanted to generate another contour at 50 and keep the contour at 200 (thus totaling 2

contours) , after making the previous call you would add this:
 
   contour->SetValue(1,50);

So in summary, if you just want one contour the contour number is always 0. If you want more than one

value the contour number is assigned by you and is <= total number of contours.
 Gerrick

 

 

quarter里的数据是raw格式的,为了适应vtkVolume16Reader这个类的方法,把这些raw格式的图像都写成后缀为1,2,3...你可以写一个头文件,格式为mhd或者mha的,内容如下:

NDims = 2
DimSize = 64 64 1
ElementType = MET_USHORT
ElementSpacing = 1.0 1.0 1.0
ElementByteOrderMSB = False
ElementDataFile = 1.raw

这上面的内容复制到记事本里,然后保存了1.mha.
接着在quarter里把quarter.1重命名为"1.raw",把"1.mha"和"1.raw"放在同一个目录下,然后可以用itk自带的ImageViewer打开1.mha,就能看到这个图像长什么样子了。其他的quarter下的图像也是一样。

可以参考vtkMetaImageReader这个类。

用itkSnap也能打开,itkSnap下载地址:http://www.itksnap.org/pmwiki/pmwiki.php

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值