ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkImageRegionReverseIterator.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 __itkImageRegionReverseIterator_h
00019 #define __itkImageRegionReverseIterator_h
00020 
00021 #include "itkImageRegionReverseConstIterator.h"
00022 #include "itkImageConstIterator.h"
00023 
00024 namespace itk
00025 {
00068 template< typename TImage >
00069 class ITK_EXPORT ImageRegionReverseIterator:public ImageRegionReverseConstIterator< TImage >
00070 {
00071 public:
00073   typedef ImageRegionReverseIterator                Self;
00074   typedef ImageRegionReverseConstIterator< TImage > Superclass;
00075 
00077   typedef typename Superclass::IndexType             IndexType;
00078   typedef typename Superclass::SizeType              SizeType;
00079   typedef typename Superclass::OffsetType            OffsetType;
00080   typedef typename Superclass::RegionType            RegionType;
00081   typedef typename Superclass::ImageType             ImageType;
00082   typedef typename Superclass::PixelContainer        PixelContainer;
00083   typedef typename Superclass::PixelContainerPointer PixelContainerPointer;
00084   typedef typename Superclass::InternalPixelType     InternalPixelType;
00085   typedef typename Superclass::PixelType             PixelType;
00086   typedef typename Superclass::AccessorType          AccessorType;
00087 
00089   ImageRegionReverseIterator();
00090 
00093   ImageRegionReverseIterator(ImageType *ptr, const RegionType & region);
00094 
00101   ImageRegionReverseIterator(const ImageConstIterator< TImage > & it);
00102 
00104   void Set(const PixelType & value) const
00105   { this->m_PixelAccessor.Set(*const_cast< InternalPixelType  * >( ( this->m_Buffer + this->m_Offset ) ), value); }
00106 
00110   PixelType & Value(void)
00111   { return *const_cast< InternalPixelType  * >( ( this->m_Buffer + this->m_Offset ) ); }
00112 
00116   Self Begin(void) const;
00117 
00121   Self End(void) const;
00122 
00123 protected:
00126   ImageRegionReverseIterator(const ImageRegionReverseConstIterator< TImage > & it);
00127   Self & operator=(const ImageRegionReverseConstIterator< TImage > & it);
00128 };
00129 } // end namespace itk
00131 
00132 // Define instantiation macro for this template.
00133 #define ITK_TEMPLATE_ImageRegionReverseIterator(_, EXPORT, TypeX, TypeY)                          \
00134   namespace itk                                                                                   \
00135   {                                                                                               \
00136   _( 1 ( class EXPORT ImageRegionReverseIterator< ITK_TEMPLATE_1 TypeX > ) )                      \
00137   namespace Templates                                                                             \
00138   {                                                                                               \
00139   typedef ImageRegionReverseIterator< ITK_TEMPLATE_1 TypeX > ImageRegionReverseIterator##TypeY; \
00140   }                                                                                               \
00141   }
00142 
00143 #if ITK_TEMPLATE_EXPLICIT
00144 #include "Templates/itkImageRegionReverseIterator+-.h"
00145 #endif
00146 
00147 #if ITK_TEMPLATE_TXX
00148 #include "itkImageRegionReverseIterator.hxx"
00149 #endif
00150 
00151 #endif
00152