资源简介
<>医学图像分割,是由Yuri Y. Boykov和Marie-Pierre Jolly在IEEE发表的。
代码片段和文件信息
/*
Copyright (C) 2012 David Doria daviddoria@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation either version 3 of the License or
(at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not see .
*/
#include “ImageGraphCut.h“
// Submodules
#include “Mask/ITKHelpers/Helpers/Helpers.h“
#include “Mask/ITKHelpers/ITKHelpers.h“
#include “itkImage.h“
#include “itkImageFileReader.h“
#include “itkImageFileWriter.h“
#include “itkImageRegionConstIteratorWithIndex.h“
#include “itkVectorImage.h“
int main(int argc char*argv[])
{
// Verify arguments
if(argc != 5)
{
std::cerr << “Required: image.png foregroundMask.png backgroundMask.png output.png“ << std::endl;
return EXIT_FAILURE;
}
// Parse arguments
std::string imageFilename = argv[1];
// This image should have white pixels indicating foreground pixels and be black elsewhere.
std::string foregroundFilename = argv[2];
// This image should have white pixels indicating background pixels and be black elsewhere.
std::string backgroundFilename = argv[3];
std::string outputFilename = argv[4]; // Foreground/background segment mask
// Output arguments
std::cout << “imageFilename: “ << imageFilename << std::endl
<< “foregroundFilename: “ << foregroundFilename << std::endl
<< “backgroundFilename: “ << backgroundFilename << std::endl
<< “outputFilename: “ << outputFilename << std::endl;
// The type of the image to segment
typedef itk::VectorImage ImageType;
// Read the image
typedef itk::ImageFileReader ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(imageFilename);
reader->Update();
// Read the foreground and background stroke images
Mask::Pointer foregroundMask = Mask::New();
foregroundMask->ReadFromImage(foregroundFilename);
Mask::Pointer backgroundMask = Mask::New();
backgroundMask->ReadFromImage(backgroundFilename);
// Perform the cut
ImageGraphCut GraphCut;
GraphCut.SetImage(reader->GetOutput());
GraphCut.SetNumberOfHistogramBins(20);
GraphCut.SetLambda(.01);
std::vector > foregroundPixels = ITKHelpers::GetNonZeroPixels(foregroundMask.GetPointer());
std::vector > backgroundPixels = ITKHelpers::GetNonZeroPixels(backgroundMask.GetPointer());
GraphCut.SetSources(foregroundPixels);
GraphCut.SetSinks(backgroundPixels);
GraphCut.PerformSegmentation();
//
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-06-12 15:19 ImageGraphCutSegmentation\
文件 79 2016-06-12 10:44 ImageGraphCutSegmentation\.gitmodules
文件 2428 2016-06-12 10:45 ImageGraphCutSegmentation\CMakeLists.txt
目录 0 2016-06-12 15:17 ImageGraphCutSegmentation\data\
文件 1407 2016-06-12 10:40 ImageGraphCutSegmentation\data\background.png
文件 900 2016-06-12 10:41 ImageGraphCutSegmentation\data\foreground.png
文件 328509 2016-06-12 10:41 ImageGraphCutSegmentation\data\soldier.png
文件 2158 2016-06-12 10:41 ImageGraphCutSegmentation\data\soldier_ba
目录 0 2016-06-12 15:17 ImageGraphCutSegmentation\Examples\
文件 182 2016-06-12 10:23 ImageGraphCutSegmentation\Examples\CMakeLists.txt
文件 3125 2016-06-12 10:24 ImageGraphCutSegmentation\Examples\ImageGraphCutSegmentationExample.cpp
文件 4551 2016-06-12 10:45 ImageGraphCutSegmentation\ImageGraphCut.h
文件 17292 2016-06-12 10:46 ImageGraphCutSegmentation\ImageGraphCut.hpp
文件 2505274 2016-06-12 10:13 ImageGraphCutSegmentation\InteractiveImageGraphCutSegmentation.pdf
目录 0 2016-06-12 15:17 ImageGraphCutSegmentation\Kolmogorov\
文件 8622 2016-06-12 10:31 ImageGraphCutSegmentation\Kolmogorov\block.h
文件 89 2016-06-12 10:29 ImageGraphCutSegmentation\Kolmogorov\CMakeLists.txt
文件 2594 2016-06-12 10:31 ImageGraphCutSegmentation\Kolmogorov\graph.cpp
文件 6215 2016-06-12 10:32 ImageGraphCutSegmentation\Kolmogorov\graph.h
文件 11602 2016-06-12 10:34 ImageGraphCutSegmentation\Kolmogorov\maxflow.cpp
目录 0 2016-06-12 15:17 ImageGraphCutSegmentation\Kolmogorov\Tests\
文件 265 2016-06-12 10:27 ImageGraphCutSegmentation\Kolmogorov\Tests\CMakeLists.txt
文件 789 2016-06-12 10:28 ImageGraphCutSegmentation\Kolmogorov\Tests\MaxflowTest.cpp
目录 0 2016-06-12 15:17 ImageGraphCutSegmentation\Mask-8a8f2b7\
文件 6 2012-11-12 23:24 ImageGraphCutSegmentation\Mask-8a8f2b7\.gitignore
文件 96 2012-11-12 23:24 ImageGraphCutSegmentation\Mask-8a8f2b7\.gitmodules
文件 2840 2012-11-12 23:24 ImageGraphCutSegmentation\Mask-8a8f2b7\CMakeLists.txt
目录 0 2016-06-12 15:17 ImageGraphCutSegmentation\Mask-8a8f2b7\ITKHelpers @ d852923\
文件 31 2012-11-10 05:50 ImageGraphCutSegmentation\Mask-8a8f2b7\ITKHelpers @ d852923\.gitignore
文件 87 2012-11-10 05:50 ImageGraphCutSegmentation\Mask-8a8f2b7\ITKHelpers @ d852923\.gitmodules
文件 2374 2012-11-10 05:50 ImageGraphCutSegmentation\Mask-8a8f2b7\ITKHelpers @ d852923\CMakeLists.txt
............此处省略56个文件信息
- 上一篇:稳健的自适应波束形成
- 下一篇:ITK入门中文教程1
相关资源
- 基于PCNN的彩色图像自动分割毕业论文
- CUDA的图像分割并行算法的设计与实现
- 马尔科夫随机场图像分割ICM代码
- 纹理图像分割算法
- 基于Tsallis熵的图像分割方法
- Spiking神经网络的研究及其在图像分割
- 图像分割常用算法优缺点探析
- FCN全卷积网络源代码
- 基于模糊聚类的彩色图像分割方法的
- 医学图像分割配准ITK初步分册1、2
- 基于视觉显著性的图像分割PPT
- 章毓晋的《图像分割》电子书
- K-Means图像分割算法实现
- 图像分割 高斯混合模型 马尔科夫 i
- 基于改进型粒子群算法的多重阈值图
- unet 论文,pdf
- 收集的图像分割源码(一个模型有多
- 血管图像分割
- 用于图像理解分割的数据库
- 基于SLIC的超像素图像分割
- 医学图像分割及配准
- 一篇图像分割的外文论文,可供大家
- 信息熵在图像处理中的应用
- 医学影像处理与分析1~8章 田捷
- Grabcut 原文PPt
- 图像分割的相关论文
- u-net 实现(keras)
- 眼底图像分割
- DRIVE数据集,用于视网膜图像分割
- 常见图像分割算法实现源代码
评论
共有 条评论