⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itkcontourextractor2dimagefiltertest.cxx

📁 DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.
💻 CXX
📖 第 1 页 / 共 2 页
字号:
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: itkContourExtractor2DImageFilterTest.cxx,v $
  Language:  C++
  Date:      $Date: 2007-01-22 16:18:03 $
  Version:   $Revision: 1.10 $

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/

#include "itkImageFileReader.h"
#include "itkContourExtractor2DImageFilter.h"

namespace itkContourExtractor2DImageFilterTestNamespace
{
const unsigned int Dimension = 2;
typedef unsigned char                                   PixelType;
typedef itk::Image<PixelType, Dimension>                ImageType;
typedef itk::ImageFileReader<ImageType>                 ReaderType;
typedef itk::ContourExtractor2DImageFilter<ImageType>   ExtractorType;
typedef ExtractorType::VertexType                       VertexType;
typedef std::pair<double, double>                       MyVertexType;
typedef std::vector<MyVertexType>                       MyVertexListType;
typedef std::vector<MyVertexListType>                   MyVertexListList;
const float FLOAT_EPSILON = 0.0001;
}

/* ----------------------------------------------------------------------- */
itkContourExtractor2DImageFilterTestNamespace::MyVertexType _bottom_right[] = 
   {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 8),
    itkContourExtractor2DImageFilterTestNamespace::MyVertexType(12, 7.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType
                                bottom_right(_bottom_right, _bottom_right + 2);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType
    _rev_bottom_right[] = 
   {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(12, 7.5), 
    itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 8)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
                    rev_bottom_right(_rev_bottom_right, _rev_bottom_right + 2);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _bottom_left[] = 
  {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0, 7.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0.5, 8)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType
                    bottom_left(_bottom_left, _bottom_left + 2);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType 
   _rev_bottom_left[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0.5, 8),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0, 7.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
                   rev_bottom_left(_rev_bottom_left, _rev_bottom_left + 2);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _row2_col4[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 6.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 6.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9.5, 6), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10.5, 5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 4.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 6), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 6.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
                            row2_col4(_row2_col4, _row2_col4 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _rev_row2_col4[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 6.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 4.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10.5, 5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9.5, 6), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 6.5),
 itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 6.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
                   rev_row2_col4(_rev_row2_col4, _rev_row2_col4 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _row2_col3[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8, 6.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 6.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 6), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 4.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8.5, 6),
 itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8, 6.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
                            row2_col3(_row2_col3, _row2_col3 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _rev_row2_col3[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8, 6.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7.5, 5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 4.5),  
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 6.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8, 6.5),};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
               rev_row2_col3(_rev_row2_col3, _rev_row2_col3 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _row2_col2[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 6.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4.5, 6), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(3.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 4.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 4.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 6.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
              row2_col2(_row2_col2, _row2_col2 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _rev_row2_col2[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 6.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5.5, 5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 4.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 4.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(3.5, 5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 6.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
              rev_row2_col2(_rev_row2_col2, _rev_row2_col2 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _row2_col1[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1, 6.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1, 4.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 4.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1.5, 6),
 itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1, 6.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
             row2_col1(_row2_col1, _row2_col1 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _rev_row2_col1[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1, 6.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 5.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 4.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1, 4.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0.5, 5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(0.5, 6),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1, 6.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
             rev_row2_col1(_rev_row2_col1, _rev_row2_col1 + 9);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType 
     _row1_col4_middle[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10.5, 3),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
                   row1_col4_middle(_row1_col4_middle, _row1_col4_middle + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType 
   _rev_row1_col4_middle[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10.5, 3),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9.5, 3),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
    rev_row1_col4_middle(_rev_row1_col4_middle, _rev_row1_col4_middle + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _row1_col2[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 3.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(3.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 2.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
              row1_col2(_row1_col2, _row1_col2 + 7);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _rev_row1_col2[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5.5, 3),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 2.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(3.5, 3),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(4, 3.5),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(5, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
             rev_row1_col2(_rev_row1_col2, _rev_row1_col2 + 7);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _row1_col1[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1.5, 3),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
                     row1_col1(_row1_col1, _row1_col1 + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _rev_row1_col1[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2.5, 3),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(1.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(2, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
            rev_row1_col1(_rev_row1_col1, _rev_row1_col1 + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType 
  _row1_col4_right[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 1.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 2.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
               row1_col4_right(_row1_col4_right, _row1_col4_right + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType 
   _rev_row1_col4_right[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 1.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(10.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11, 2.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
      rev_row1_col4_right(_rev_row1_col4_right, _rev_row1_col4_right + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType 
   _row1_col4_left[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9, 1.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9, 2.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
     row1_col4_left(_row1_col4_left, _row1_col4_left + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType 
   _rev_row1_col4_left[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9, 2.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9, 1.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(8.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(9, 2.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
      rev_row1_col4_left(_rev_row1_col4_left, _rev_row1_col4_left + 5);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _row1_col3[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 1.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
       row1_col3(_row1_col3, _row1_col3 + 7);

itkContourExtractor2DImageFilterTestNamespace::MyVertexType _rev_row1_col3[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 3.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7.5, 2),
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 1.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 2), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(6.5, 3), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(7, 3.5)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 
    rev_row1_col3(_rev_row1_col3, _rev_row1_col3 + 7);


itkContourExtractor2DImageFilterTestNamespace::MyVertexType _top_right[] = 
 {itkContourExtractor2DImageFilterTestNamespace::MyVertexType(12, 0.5), 
  itkContourExtractor2DImageFilterTestNamespace::MyVertexType(11.5, 0)};
itkContourExtractor2DImageFilterTestNamespace::MyVertexListType 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -