ITK/Examples/SimpleOperations/RandomImageSource: Difference between revisions

From KitwarePublic
< ITK‎ | Examples
Jump to navigationJump to search
No edit summary
(Deprecated content that is moved to sphinx)
 
Line 1: Line 1:
<div class="floatcenter">[[File:ITK_Examples_Baseline_SimpleOperations_TestRandomImageSource.png]]</div>
{{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 releases.  In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.
This example produces an image with random pixel values.
}}


==RandomImageSource.cxx==
[https://itk.org/ITKExamples[ITK Sphinx Examples]]
<source lang="cpp">
#include "itkImage.h"
#include "itkRandomImageSource.h"
 
#include "QuickView.h"
 
int main(int, char *[])
{
  typedef itk::Image< unsigned char, 2 >  ImageType;
 
  itk::Size<2> size;
  size.Fill(10);
 
  itk::RandomImageSource<ImageType>::Pointer randomImageSource =
    itk::RandomImageSource<ImageType>::New();
  randomImageSource->SetNumberOfThreads(1); // to produce non-random results
  randomImageSource->SetSize(size);
  randomImageSource->Update();
 
  QuickView viewer;
  viewer.AddImage(randomImageSource->GetOutput());
  viewer.Visualize();
 
  return EXIT_SUCCESS;
}
</source>
 
{{ITKVTKCMakeLists|{{SUBPAGENAME}}}}

Latest revision as of 20:17, 30 May 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.

[ITK Sphinx Examples]