ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkImageIteratorWithIndex_h 00019 #define __itkImageIteratorWithIndex_h 00020 00021 #include "itkImageConstIteratorWithIndex.h" 00022 00023 namespace itk 00024 { 00067 template< typename TImage > 00068 class ITK_EXPORT ImageIteratorWithIndex:public ImageConstIteratorWithIndex< TImage > 00069 { 00070 public: 00071 00073 typedef ImageIteratorWithIndex Self; 00074 00079 itkStaticConstMacro(ImageIteratorDimension, unsigned int, 00080 TImage::ImageDimension); 00081 00083 typedef ImageConstIteratorWithIndex< TImage > Superclass; 00084 00086 typedef typename Superclass::IndexType IndexType; 00087 typedef typename Superclass::SizeType SizeType; 00088 typedef typename Superclass::OffsetType OffsetType; 00089 typedef typename Superclass::RegionType RegionType; 00090 typedef typename Superclass::ImageType ImageType; 00091 typedef typename Superclass::PixelContainer PixelContainer; 00092 typedef typename Superclass::PixelContainerPointer PixelContainerPointer; 00093 typedef typename Superclass::InternalPixelType InternalPixelType; 00094 typedef typename Superclass::PixelType PixelType; 00095 typedef typename Superclass::AccessorType AccessorType; 00096 00099 ImageIteratorWithIndex(); 00100 00102 ~ImageIteratorWithIndex() {} 00103 00106 ImageIteratorWithIndex(const Self & it); 00107 00110 ImageIteratorWithIndex(TImage *ptr, const RegionType & region); 00111 00114 Self & operator=(const Self & it); 00115 00117 void Set(const PixelType & value) const 00118 { this->m_PixelAccessor.Set(*( const_cast< InternalPixelType * >( this->m_Position ) ), value); } 00119 00123 PixelType & Value(void) 00124 { return *( const_cast< InternalPixelType * >( this->m_Position ) ); } 00125 protected: 00126 00129 ImageIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > & it); 00130 Self & operator=(const ImageConstIteratorWithIndex< TImage > & it); 00131 }; 00132 } // end namespace itk 00134 00135 #ifndef ITK_MANUAL_INSTANTIATION 00136 #include "itkImageIteratorWithIndex.hxx" 00137 #endif 00138 00139 #endif 00140