ITK/Examples/QuickViewDemo

From KitwarePublic
< ITK‎ | Examples
Revision as of 22:15, 15 November 2010 by Lorensen (talk | contribs) (Moving QuickView to ItkVtkGlue)
Jump to navigationJump to search

QuickViewDemo.cxx

<source lang="cpp">

  1. include "itkImage.h"
  2. include "itkImageFileReader.h"
  3. include "itkRescaleIntensityImageFilter.h"
  1. include "QuickView.h"

int main(int argc, char *argv[]) {

 if(argc < 2)
   {
   std::cerr << "Required: filename" << std::endl;
   return EXIT_FAILURE;
   }
 typedef itk::Image<unsigned char, 2>  ImageType;
 typedef itk::ImageFileReader<ImageType> ReaderType;
 ReaderType::Pointer reader = ReaderType::New();
 reader->SetFileName(argv[1]);
 typedef itk::RescaleIntensityImageFilter< ImageType, ImageType > RescaleFilterType;
 RescaleFilterType::Pointer rescaleFilter = RescaleFilterType::New();
 rescaleFilter->SetInput(reader->GetOutput());
 rescaleFilter->SetOutputMinimum(0);
 rescaleFilter->SetOutputMaximum(255);
 QuickView viewer;
 viewer.AddImage(reader->GetOutput());
 viewer.AddImage(rescaleFilter->GetOutput());
 viewer.Visualize();
 return EXIT_SUCCESS;

} </source>

CMakeLists.txt

<source lang="cmake">

</source>