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