ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkConstantPadImageFilter.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 __itkConstantPadImageFilter_h
00019 #define __itkConstantPadImageFilter_h
00020 
00021 #include "itkPadImageFilter.h"
00022 
00023 #include "itkConstantBoundaryCondition.h"
00024 
00025 namespace itk
00026 {
00047 template< class TInputImage, class TOutputImage >
00048 class ITK_EXPORT ConstantPadImageFilter:
00049   public PadImageFilter< TInputImage, TOutputImage >
00050 {
00051 public:
00053   typedef ConstantPadImageFilter                      Self;
00054   typedef PadImageFilter< TInputImage, TOutputImage > Superclass;
00055   typedef SmartPointer< Self >                        Pointer;
00056   typedef SmartPointer< const Self >                  ConstPointer;
00057 
00059   itkNewMacro(Self);
00060 
00062   itkTypeMacro(ConstantPadImageFilter, PadImageFilter);
00063 
00065   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00066   typedef typename Superclass::InputImageRegionType  InputImageRegionType;
00067 
00069   typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00070   typedef typename Superclass::InputImagePixelType  InputImagePixelType;
00071 
00073   typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
00074   typedef typename Superclass::InputImageIndexType  InputImageIndexType;
00075   typedef typename Superclass::OutputImageSizeType  OutputImageSizeType;
00076   typedef typename Superclass::InputImageSizeType   InputImageSizeType;
00077 
00079   itkStaticConstMacro(ImageDimension, unsigned int,
00080                       TInputImage::ImageDimension);
00081   itkStaticConstMacro(OutputImageDimension, unsigned int,
00082                       TOutputImage::ImageDimension);
00084 
00086   void SetConstant( OutputImagePixelType constant )
00087   {
00088     if ( constant != m_InternalBoundaryCondition.GetConstant() )
00089       {
00090       m_InternalBoundaryCondition.SetConstant( constant );
00091       this->Modified();
00092       }
00093   }
00094   OutputImagePixelType GetConstant() const
00095   {
00096     return m_InternalBoundaryCondition.GetConstant();
00097   }
00099 
00100 #ifdef ITK_USE_CONCEPT_CHECKING
00101 
00102   itkConceptMacro( OutputEqualityComparableCheck,
00103                    ( Concept::EqualityComparable< OutputImagePixelType > ) );
00104   itkConceptMacro( InputConvertibleToOutputCheck,
00105                    ( Concept::Convertible< InputImagePixelType, OutputImagePixelType > ) );
00106   itkConceptMacro( SameDimensionCheck,
00107                    ( Concept::SameDimension< ImageDimension, OutputImageDimension > ) );
00108   itkConceptMacro( OutputOStreamWritableCheck,
00109                    ( Concept::OStreamWritable< OutputImagePixelType > ) );
00110 
00112 #endif
00113 protected:
00114   ConstantPadImageFilter();
00115   ~ConstantPadImageFilter() {}
00116   void PrintSelf(std::ostream & os, Indent indent) const;
00118 
00119 private:
00120   ConstantPadImageFilter(const Self &); //purposely not implemented
00121   void operator=(const Self &);         //purposely not implemented
00122 
00123   ConstantBoundaryCondition< TInputImage, TOutputImage > m_InternalBoundaryCondition;
00124 };
00125 } // end namespace itk
00126 
00127 #ifndef ITK_MANUAL_INSTANTIATION
00128 #include "itkConstantPadImageFilter.hxx"
00129 #endif
00130 
00131 #endif
00132