ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkPolylineMask2DImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkPolylineMask2DImageFilter_h
19 #define itkPolylineMask2DImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
47 template< typename TInputImage, typename TPolyline,
48  typename TOutputImage >
49 class PolylineMask2DImageFilter:public ImageToImageFilter< TInputImage, TOutputImage >
50 {
51 public:
57 
59  itkNewMacro(Self);
60 
63 
65  itkStaticConstMacro(NDimensions, unsigned int,
66  TInputImage::ImageDimension);
67  itkStaticConstMacro(NOutputDimensions, unsigned int,
68  TOutputImage::ImageDimension);
70 
72  typedef TInputImage InputImageType;
73  typedef typename InputImageType::ConstPointer InputImageConstPointer;
74  typedef typename InputImageType::Pointer InputImagePointer;
75  typedef typename InputImageType::RegionType InputImageRegionType;
76  typedef typename InputImageType::PixelType InputImagePixelType;
77 
78  /* typedef for the polyline type */
79  typedef TPolyline PolylineType;
80 
81  /* typedef for the output image */
82  typedef TOutputImage OutputImageType;
83  typedef typename OutputImageType::Pointer OutputImagePointer;
84  typedef typename OutputImageType::RegionType OutputImageRegionType;
85  typedef typename OutputImageType::PixelType OutputImagePixelType;
86 
88  void SetInput1(const InputImageType *image);
89 
90  void SetInput2(const PolylineType *polyline);
91 
92 #ifdef ITK_USE_CONCEPT_CHECKING
93  // Begin concept checking
94  itkConceptMacro( SameDimensionCheck,
96  itkConceptMacro( IntConvertibleOutputCheck,
98  itkConceptMacro( OutputEqualityComparableCheck,
100  itkConceptMacro( InputConvertibleToOutputCheck,
102  // End concept checking
103 #endif
104 
105 protected:
108 
109  virtual void GenerateData() ITK_OVERRIDE;
110 
111 private:
112  PolylineMask2DImageFilter(const Self &) ITK_DELETE_FUNCTION;
113  void operator=(const Self &) ITK_DELETE_FUNCTION;
114 };
115 } // end namespace itk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "itkPolylineMask2DImageFilter.hxx"
119 #endif
120 
121 #endif
virtual void GenerateData() override
OutputImageType::PixelType OutputImagePixelType
void SetInput1(const InputImageType *image)
ImageToImageFilter< TInputImage, TOutputImage > Superclass
void SetInput2(const PolylineType *polyline)
Base class for all process objects that output image data.
InputImageType::PixelType InputImagePixelType
InputImageType::ConstPointer InputImageConstPointer
InputImageType::RegionType InputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Base class for filters that take an image as input and produce an image as output.
static const unsigned int NOutputDimensions
#define itkConceptMacro(name, concept)
Implements 2D image masking operation constrained by a contour.