ITK/Examples/Images/Size

From KitwarePublic
< ITK‎ | Examples
Revision as of 13:38, 2 November 2010 by Daviddoria (talk | contribs) (Created page with "==Size.cxx== <source lang="cpp"> #include "itkSize.h" int main(int, char *[]) { itk::Size<2> size; // Method 1 size.Fill(0); /* // Method 2 size[0] = 1; size[1] ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Size.cxx

<source lang="cpp">

  1. include "itkSize.h"

int main(int, char *[]) {

 itk::Size<2> size;
 // Method 1
 size.Fill(0);
 /*
 // Method 2
 size[0] = 1;
 size[1] = 2;
 */
 std::cout << size << std::endl;
 return EXIT_SUCCESS;

}

</source>

CMakeLists.txt

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

PROJECT(Size)

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

ADD_EXECUTABLE(Size Size.cxx) TARGET_LINK_LIBRARIES(Size ITKIO)

</source>