ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkPolylineMask2DImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkPolylineMask2DImageFilter_h
00019 #define __itkPolylineMask2DImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkImageRegionIteratorWithIndex.h"
00023 
00024 namespace itk
00025 {
00047 template< class TInputImage, class TPolyline,
00048           class TOutputImage >
00049 class ITK_EXPORT PolylineMask2DImageFilter:public ImageToImageFilter< TInputImage, TOutputImage >
00050 {
00051 public:
00053   typedef PolylineMask2DImageFilter                       Self;
00054   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00055   typedef SmartPointer< Self >                            Pointer;
00056   typedef SmartPointer< const Self >                      ConstPointer;
00057 
00059   itkNewMacro(Self);
00060 
00062   itkTypeMacro(PolylineMask2DImageFilter, ImageToImageFilter);
00063 
00065   itkStaticConstMacro(NDimensions, unsigned int,
00066                       TInputImage::ImageDimension);
00067   itkStaticConstMacro(NOutputDimensions, unsigned int,
00068                       TOutputImage::ImageDimension);
00070 
00072   typedef TInputImage                           InputImageType;
00073   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00074   typedef typename InputImageType::Pointer      InputImagePointer;
00075   typedef typename InputImageType::RegionType   InputImageRegionType;
00076   typedef typename InputImageType::PixelType    InputImagePixelType;
00077 
00078   /* typedef for the polyline type */
00079   typedef TPolyline PolylineType;
00080 
00081   /* typedef for the output image */
00082   typedef TOutputImage                         OutputImageType;
00083   typedef typename OutputImageType::Pointer    OutputImagePointer;
00084   typedef typename OutputImageType::RegionType OutputImageRegionType;
00085   typedef typename OutputImageType::PixelType  OutputImagePixelType;
00086 
00088   void SetInput1(const InputImageType *image);
00089 
00090   void SetInput2(const PolylineType *polyline);
00091 
00092   /* Generate Data */
00093   void GenerateData(void);
00094 
00095 #ifdef ITK_USE_CONCEPT_CHECKING
00096 
00097   itkConceptMacro( SameDimensionCheck,
00098                    ( Concept::SameDimension< NDimensions, NOutputDimensions > ) );
00099   itkConceptMacro( IntConvertibleOutputCheck,
00100                    ( Concept::Convertible< int, OutputImagePixelType > ) );
00101   itkConceptMacro( OutputEqualityComparableCheck,
00102                    ( Concept::EqualityComparable< OutputImagePixelType > ) );
00103   itkConceptMacro( InputConvertibleToOutputCheck,
00104                    ( Concept::Convertible< InputImagePixelType, OutputImagePixelType > ) );
00105 
00107 #endif
00108 protected:
00109   PolylineMask2DImageFilter();
00110   virtual ~PolylineMask2DImageFilter() {}
00111 private:
00112   PolylineMask2DImageFilter(const Self &); //purposely not implemented
00113   void operator=(const Self &);            //purposely not implemented
00114 };
00115 } // end namespace itk
00117 
00118 #ifndef ITK_MANUAL_INSTANTIATION
00119 #include "itkPolylineMask2DImageFilter.hxx"
00120 #endif
00121 
00122 #endif
00123