ITK/Examples/Utilities/RandomPermutation: Difference between revisions

From KitwarePublic
< ITK‎ | Examples
Jump to navigationJump to search
(deprecated content that is moved to sphinx)
 
Line 1: Line 1:
==RandomPermutation.cxx==
{{warning|1=The media wiki content on this page is no longer maintained. The examples presented on the https://itk.org/Wiki/* pages likely require ITK version 4.13 or earlier releasesIn many cases, the examples on this page no longer conform to the best practices for modern ITK versions.}}
<source lang="cpp">
#include <itkImageRandomNonRepeatingConstIteratorWithIndex.h>
 
int main(int, char*[])
{
  itk::RandomPermutation rp(5);
#if !defined(ITK_LEGACY_REMOVE)
  std::cout << "Dump..." << std::endl;
  rp.Dump();
#endif
 
  std::cout << std::endl;
 
   for(unsigned int i = 0; i < 5; i++)
    {
    std::cout << rp[i] << " ";
    }
  std::cout << std::endl << std::endl;
 
  rp.Shuffle();
#if !defined(ITK_LEGACY_REMOVE)
  std::cout << "Dump..." << std::endl;
  rp.Dump();
#endif 
  std::cout << "After shuffle" << std::endl;
  for(unsigned int i = 0; i < 5; i++)
    {
    std::cout << rp[i] << " ";
    }
  std::cout << std::endl;
 
 
  return EXIT_SUCCESS;
}
 
</source>
 
{{ITKCMakeLists|{{SUBPAGENAME}}}}

Latest revision as of 20:48, 6 June 2019

Warning: The media wiki content on this page is no longer maintained. The examples presented on the https://itk.org/Wiki/* pages likely require ITK version 4.13 or earlier releases. In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.