ITK/Examples/Images/ImageRegion: Difference between revisions

From KitwarePublic
< ITK‎ | Examples
Jump to navigationJump to search
(Created page with "==ImageRegion.cxx== <source lang="cpp"> #include "itkImageRegion.h" #include "itkIndex.h" #include "itkSize.h" int main(int, char *[]) { itk::Size<2> size; size.Fill(3); ...")
 
mNo edit summary
Line 1: Line 1:
This class holds an itkIndex (the "bottom left" corner of a region) and a itkSize (the size of the region). These two items together completely describe a region.
==ImageRegion.cxx==
==ImageRegion.cxx==
<source lang="cpp">
<source lang="cpp">

Revision as of 13:53, 18 November 2010

This class holds an itkIndex (the "bottom left" corner of a region) and a itkSize (the size of the region). These two items together completely describe a region.

ImageRegion.cxx

<source lang="cpp">

  1. include "itkImageRegion.h"
  2. include "itkIndex.h"
  3. include "itkSize.h"

int main(int, char *[]) {

 itk::Size<2> size;
 size.Fill(3);
 itk::Index<2> index;
 index.Fill(1);
 
 typedef itk::ImageRegion<2> RegionType;
 RegionType region(index,size);
 std::cout << region << std::endl;
 return EXIT_SUCCESS;

}

</source>

CMakeLists.txt

<source lang="cmake"> cmake_minimum_required(VERSION 2.6)

PROJECT(ImageRegion)

FIND_PACKAGE(ITK REQUIRED) INCLUDE(${ITK_USE_FILE})

ADD_EXECUTABLE(ImageRegion ImageRegion.cxx) TARGET_LINK_LIBRARIES(ImageRegion ITKIO)

</source>