Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkExtractChannelFromRgbaImageFilter.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef __itkExtractChannelFromRgbaImageFilter_h__
17 #define __itkExtractChannelFromRgbaImageFilter_h__
18 
19 #include <itkImageToImageFilter.h>
20 #include <itkImage.h>
21 #include <itkRGBAPixel.h>
22 #include <itkVectorImage.h>
23 
24 namespace itk{
25 
26 template< class ReferenceImageType, class OutputImageType >
27 class ExtractChannelFromRgbaImageFilter : public ImageToImageFilter< itk::Image<itk::RGBAPixel<unsigned char>,3>, OutputImageType >
28 {
29 
30 public:
31 
32  enum Channel {
33  RED,
37  };
38 
40  typedef ProcessObject Superclass;
43 
44  typedef itk::Image<itk::RGBAPixel<unsigned char>,3> InputImageType;
47 
48  itkFactorylessNewMacro(Self)
49  itkCloneMacro(Self)
50  itkTypeMacro( ExtractChannelFromRgbaImageFilter, ImageSource );
51 
54  void GenerateData();
55 
56  itkSetMacro(Channel, Channel)
57  itkSetMacro(ReferenceImage, typename ReferenceImageType::Pointer)
58 
59 protected:
60 
61  ExtractChannelFromRgbaImageFilter();
62  virtual ~ExtractChannelFromRgbaImageFilter();
63  Channel m_Channel;
64  typename ReferenceImageType::Pointer m_ReferenceImage;
65 };
66 
67 }
68 
69 #ifndef ITK_MANUAL_INSTANTIATION
71 #endif
72 
73 #endif // __itkExtractChannelFromRgbaImageFilter_h__
itk::Image< itk::RGBAPixel< unsigned char >, 3 > InputImageType
unsigned short PixelType