首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用区域增长算法来定义感兴趣的区域?

如何使用区域增长算法来定义感兴趣的区域?
EN

Stack Overflow用户
提问于 2017-08-18 09:47:50
回答 2查看 1.4K关注 0票数 0

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

让我们假设这些器官具有特定的亮度,因此我可以使用区域生长算法(下面的代码)自动识别它们。为了做到这一点,我以前根据属于器官的体素的均值和标准差值计算了一些阈值。

,我怎么能用ITK/VTK特性来保持主动脉在我的图像中呢?,我想我要找的是一个过滤器,它可以做与ITK掩模图像滤波器完全相反的事情。

请查找与下面的器官隔离对应的(伪)代码。我根据区域生长的结果计算了5个体素扩张,以确保包括器官的所有体素,并在种植后的器官周围有足够的边缘。

代码语言:javascript
复制
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? 

欢迎任何帮助或评论。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-08-23 10:12:28

为了记录在案,我使用ITK掩模负滤波器解决了我的问题,它反过来直接回答了这个问题。

票数 0
EN

Stack Overflow用户

发布于 2017-08-18 13:45:00

掩模滤波器本身可以做与通常相反的事情。默认情况下,掩蔽值为0,外部值也是。这意味着图像中对应于掩码非零部分的部分被保留,其余部分被归零。如果这不是您想要的,您可以通过设置不同的掩蔽值和外部值来轻松地反转逻辑。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45753621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档