ITK/Examples/Utilities/RandomPermutation

From KitwarePublic
< ITK‎ | Examples
Revision as of 12:24, 26 February 2011 by Daviddoria (talk | contribs) (Created page with "==RandomPermutation.cxx== <source lang="cpp"> #include <itkImageRandomNonRepeatingConstIteratorWithIndex.h> int main(int, char*[]) { itk::RandomPermutation rp(5); rp.Dump();...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

RandomPermutation.cxx

<source lang="cpp">

  1. include <itkImageRandomNonRepeatingConstIteratorWithIndex.h>

int main(int, char*[]) {

 itk::RandomPermutation rp(5);
 rp.Dump();
 std::cout << std::endl;
 for(unsigned int i = 0; i < 5; i++)
   {
   std::cout << rp[i] << " ";
   }
 std::cout << std::endl << std::endl;
 
 rp.Shuffle();
 rp.Dump();
 
 
 return EXIT_SUCCESS;

}

</source>

CMakeLists.txt

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

PROJECT(RandomPermutation)

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

ADD_EXECUTABLE(RandomPermutation RandomPermutation.cxx) TARGET_LINK_LIBRARIES(RandomPermutation ITKCommon)


</source>