ITK/Examples/Utilities/JetColormapFunctor

From KitwarePublic
< ITK‎ | Examples
Revision as of 23:30, 2 February 2011 by Daviddoria (talk | contribs) (Created page with "==JetColormapFunctor.cxx== <source lang="cpp"> #include "itkJetColormapFunctor.h" #include "itkRGBPixel.h" int main( int argc, char *argv[]) { typedef itk::RGBPixel<unsigned c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

JetColormapFunctor.cxx

<source lang="cpp">

  1. include "itkJetColormapFunctor.h"
  2. include "itkRGBPixel.h"

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

 typedef itk::RGBPixel<unsigned char> PixelType;
 typedef itk::Functor::JetColormapFunctor<float, PixelType> ColorMapType;
 ColorMapType::Pointer colormap = ColorMapType::New();
 
 colormap->SetMinimumInputValue(0.0);
 colormap->SetMaximumInputValue(1.0);
 std::cout << "0: " << colormap->operator()(0.0f) << std::endl;
 std::cout << "0.5: " << colormap->operator()(0.5f) << std::endl;
 std::cout << "1: " << colormap->operator()(1.0f) << std::endl;
 return EXIT_SUCCESS;

}

</source>

CMakeLists.txt

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

PROJECT(JetColormapFunctor)

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

ADD_EXECUTABLE(JetColormapFunctor JetColormapFunctor.cxx) TARGET_LINK_LIBRARIES(JetColormapFunctor ITKIO)

</source>