ITK/Examples/Utilities/JetColormapFunctor
From KitwarePublic
< ITK | Examples
Jump to navigationJump to search
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...")
JetColormapFunctor.cxx
<source lang="cpp">
- include "itkJetColormapFunctor.h"
- 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>