ITK/Examples/Utilities/RandomPermutation
From KitwarePublic
< ITK | Examples
Jump to navigationJump to search
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();...")
RandomPermutation.cxx
<source lang="cpp">
- 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>