ITK/Examples/Images/Index

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

Index.cxx

<source lang="cpp">

  1. include "itkIndex.h"

int main(int, char *[]) {

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

}

</source>

CMakeLists.txt

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

PROJECT(Index)

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

ADD_EXECUTABLE(Index Index.cxx) TARGET_LINK_LIBRARIES(Index ITKIO)

</source>