ITK/Examples/Images/ImageRegion

From KitwarePublic

Jump to: navigation, search

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

#include "itkImageRegion.h"
#include "itkIndex.h"
#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;
}

CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
 
project(ImageRegion)
 
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
 
add_executable(ImageRegion ImageRegion.cxx)
 
if( "${ITK_VERSION_MAJOR}" LESS 4 )
  target_link_libraries(ImageRegion ITKReview ${ITK_LIBRARIES})
else( "${ITK_VERSION_MAJOR}" LESS 4 )
  target_link_libraries(ImageRegion ${ITK_LIBRARIES})
endif( "${ITK_VERSION_MAJOR}" LESS 4 )
Personal tools