ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRLEImageScanlineIterator.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 itkRLEImageScanlineIterator_h
19 #define itkRLEImageScanlineIterator_h
20 
22 #include "itkRLEImageIterator.h"
24 
25 namespace itk
26 {
34 template< typename TPixel, unsigned int VImageDimension, typename CounterType >
35 class ImageScanlineIterator< RLEImage< TPixel, VImageDimension, CounterType > > :
36  public ImageScanlineConstIterator< RLEImage< TPixel, VImageDimension, CounterType > >
37 {
38 public:
42 
44  using IndexType = typename Superclass::IndexType;
45  using SizeType = typename Superclass::SizeType;
48  using ImageType = typename Superclass::ImageType;
50  using PixelType = typename Superclass::PixelType;
51 
55  {}
56 
60  : ImageScanlineConstIterator< ImageType >( ptr, region )
61  {}
62 
71  {}
72 
74  void
75  Set( const PixelType& value ) const
76  {
77  const_cast< ImageType * >( this->m_Image.GetPointer() )->SetPixel(
78  *const_cast< typename ImageType::RLLine * >( this->m_RunLengthLine ),
79  this->m_SegmentRemainder, this->m_RealIndex, value );
80  }
81 
85  // PixelType & Value(void)
86  // {
87  // return m_Buffer[m_Index[2]][m_Index[1]][m_RealIndex].second;
88  // }
89 
90 protected:
95  {}
96  Self &
98  {
100  return *this;
101  }
102 };
103 } // end namespace itk
105 
106 #endif // itkRLEImageScanlineIterator_h
A multi-dimensional iterator templated over image type that walks a region of pixels, scanline by scanline or in the direction of the fastest axis.
typename Superclass::PixelType PixelType
A multi-dimensional iterator templated over image type.
A multi-dimensional image iterator templated over image type.
Self & operator=(const Self &it)
typename Superclass::InternalPixelType InternalPixelType
TImage::ConstWeakPointer m_Image
typename Superclass::IndexType IndexType
typename Superclass::SizeType SizeType
typename Superclass::RegionType RegionType
typename Superclass::OffsetType OffsetType
A multi-dimensional iterator templated over image type that walks a region of pixels, scanline by scanline or in the direction of the fastest axis.
typename Superclass::ImageType ImageType
Run-Length Encoded image. It saves memory for label images at the expense of processing times...
Definition: itkRLEImage.h:52