00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2009-05-13 18:06:46 +0200 (Mi, 13 Mai 2009) $ 00006 Version: $Revision: 17258 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED 00020 #define MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED 00021 00022 #include "mitkCommon.h" 00023 #include "mitkImageToImageFilter.h" 00024 #include "mitkImageTimeSelector.h" 00025 00026 namespace itk { 00027 template <class TPixel, unsigned int VImageDimension> class ITK_EXPORT Image; 00028 } 00029 00030 namespace mitk { 00031 00032 //##Documentation 00033 //## @brief 00034 //## @ingroup Process 00035 class MITK_CORE_EXPORT RGBToRGBACastImageFilter : public ImageToImageFilter 00036 { 00037 public: 00038 mitkClassMacro(RGBToRGBACastImageFilter, ImageToImageFilter); 00039 00040 itkNewMacro(Self); 00041 00042 00048 static bool IsRGBImage( const mitk::Image *image ); 00049 00050 00051 protected: 00052 // Typedefs for supported RGB pixel types 00053 typedef itk::RGBPixel< unsigned char > UCRGBPixelType; 00054 typedef itk::RGBPixel< unsigned short > USRGBPixelType; 00055 typedef itk::RGBPixel< float > FloatRGBPixelType; 00056 typedef itk::RGBPixel< double > DoubleRGBPixelType; 00057 00058 00059 RGBToRGBACastImageFilter(); 00060 00061 ~RGBToRGBACastImageFilter(); 00062 00063 virtual void GenerateInputRequestedRegion(); 00064 00065 virtual void GenerateOutputInformation(); 00066 00067 virtual void GenerateData(); 00068 00069 template < typename TPixel, unsigned int VImageDimension > 00070 void InternalCast( itk::Image< TPixel, VImageDimension > *itkImage, 00071 mitk::RGBToRGBACastImageFilter *addComponentFilter, 00072 typename TPixel::ComponentType defaultAlpha ); 00073 00074 mitk::ImageTimeSelector::Pointer m_InputTimeSelector; 00075 mitk::ImageTimeSelector::Pointer m_OutputTimeSelector; 00076 00077 //##Description 00078 //## @brief Time when Header was last initialized 00079 itk::TimeStamp m_TimeOfHeaderInitialization; 00080 }; 00081 00082 } // namespace mitk 00083 00084 #endif /* MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED */ 00085 00086