我正在研究DICOM图像(CT扫描)&想要分离出我图片中感兴趣的一些结构,比如人体器官(比如主动脉,以及所附的图像)。在ITK和VTK的帮助下,我正在C++中编码。

让我们假设这些器官具有特定的亮度,因此我可以使用区域生长算法(下面的代码)自动识别它们。为了做到这一点,我以前根据属于器官的体素的均值和标准差值计算了一些阈值。
,我怎么能用ITK/VTK特性来保持主动脉在我的图像中呢?,我想我要找的是一个过滤器,它可以做与ITK掩模图像滤波器完全相反的事情。
请查找与下面的器官隔离对应的(伪)代码。我根据区域生长的结果计算了5个体素扩张,以确保包括器官的所有体素,并在种植后的器官周围有足够的边缘。
typedef short InputPixelType;
typedef unsigned char OutputPixelType;
const int Dimension = 3;
typedef itk::Image< InputPixelType, Dimension > InputImageType;
typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
// Region growing
typedef itk::ConnectedThresholdImageFilter< InputImagetype,
OutputImagetype > ConnectedFilterType;
ConnectedFilterType::Pointer connectedThreshold = ConnectedFilterType::New();
connectedThreshold->SetInput(input);
connectedThreshold->SetUpper(upperThreshold);
connectedThreshold->SetLower(lowerThreshold);
//Initializing seed
InternalImagetype::IndexType index;
index[0] = seed_x;
index[1] = seed_y;
connectedThreshold->SetSeed(index);
// Dilate the resulting region-growing of 5 voxels for safety
typedef itk::BinaryBallStructuringElement< OutputImageType,
Dimension > StructuringElementType;
typedef itk::BinaryDilateImageFilter< OutputImageType,
OutputImageType, StruturingElementType > DilateFilterType;
StructuringElementType structuringElement;
structuringElement.SetRadius(5);
structuringElement.CreateStructuringElement();
DilateFilterType::Pointer dilateFilter = DilateFilterType::New();
dilateFilter->SetInput(connectedThreshold->GetOutput());
dilatefilter->SetKernel(structuringElement);
// Saving the results of the RG+dilation
typedef itk::ImageFileWriter< OutputImageType > WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetInput(dilateFilter->GetOutput());
writer->SetFileName("organ-segmented-with-dilation.mhd");
try {
writer->Update();
} catch(itk::ExceptionObject& err) {
std::cerr << "Exception caught! " << err.what() << std::endl;
return EXIT_FAILURE;
}
// What to do next to crop the input image with this region-growing? 欢迎任何帮助或评论。
https://stackoverflow.com/questions/45753621
复制相似问题