VTK乳房X光检查的体积渲染

VTK volume rendering of mammography

本文关键字:检查 乳房 VTK      更新时间:2023-10-16

我正在研究乳房X光检查的vtk体积渲染。我在文件夹中有一个 50 个 DICOM 切片来构建卷。在这里,我需要提供vtkColorTransferFunctionvtkPiecewiseFunction来设置 RGB 颜色和标量不透明度。

我没有获得关于乳房图像(乳房图像(的颜色和不透明度的确切值。我需要与乳房 X 射线图像相关的颜色和不透明度值。

任何建议都会有所帮助。

vtkGPUVolumeRayCastMapper *volumeGPUmapper = 
vtkGPUVolumeRayCastMapper::New();
volumeGPUmapper->SetInputConnection(clip->GetOutputPort());
// RGB and alpha funcions
double skinOnBlueMap[28][5] =
{
      {0,     0.987853825092316, 1.0,               1.0,               0.9},
      {10000, 0.987853825092316, 1.0,               1.0,               0.9},
      {20000, 0.987853825092316, 1.0,               1.0,               1.0},
      {30000, 0.987853825092316, 1.0,               1.0,               1.0},
      {40000, 0.0,               0.0,               0.0,               1.0},
      {50000, 1.0,               0.0,               0.0,               1.0},
      {60000, 1.0,               0.999206542968750, 0.0,               1.0},
      {70000, 1.0,               1.0,               1.0,               1.0}
};
vtkSmartPointer<vtkPiecewiseFunction> alphaChannelFunc = vtkSmartPointer<vtkPiecewiseFunction>::New();
vtkSmartPointer<vtkColorTransferFunction> colorFunc = vtkSmartPointer<vtkColorTransferFunction>::New();
for(int i = 0; i < sizeof(skinOnBlueMap)/(5*sizeof(double)); i++)
{
    colorFunc->AddRGBPoint(skinOnBlueMap[i][0], skinOnBlueMap[i][1], skinOnBlueMap[i][2], skinOnBlueMap[i][3]);
    alphaChannelFunc->AddPoint(skinOnBlueMap[i][0], skinOnBlueMap[i][4]);
}
vtkSmartPointer<vtkVolumeProperty> volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();
volumeProperty->SetColor(colorFunc);
volumeProperty->SetInterpolationTypeToLinear();
volumeProperty->SetScalarOpacity(alphaChannelFunc);
vtkSmartPointer<vtkVolume> VTKvolume = vtkSmartPointer<vtkVolume>::New();
VTKvolume->SetMapper(volumeGPUmapper);
VTKvolume->SetProperty(volumeProperty);

这些标量值对我来说似乎很奇怪。这可能是您的结果看起来不正确的原因。但为了确保我们需要图像堆栈和渲染结果。

标量值甚至不在通常用于体素的无符号短类型范围内。