ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkRLEImageScanlineIterator.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
25namespace itk
26{
34template <typename TPixel, unsigned int VImageDimension, typename CounterType>
35class ImageScanlineIterator<RLEImage<TPixel, VImageDimension, CounterType>>
36 : public ImageScanlineConstIterator<RLEImage<TPixel, VImageDimension, CounterType>>
37{
38public:
42
44 using IndexType = typename Superclass::IndexType;
45 using SizeType = typename Superclass::SizeType;
46 using OffsetType = typename Superclass::OffsetType;
47 using RegionType = typename Superclass::RegionType;
48 using ImageType = typename Superclass::ImageType;
49 using InternalPixelType = typename Superclass::InternalPixelType;
50 using PixelType = typename Superclass::PixelType;
51
56
61 {}
62
72
74 void
75 Set(const PixelType & value) const
76 {
77 const_cast<ImageType *>(this->m_Image.GetPointer())
78 ->SetPixel(*const_cast<typename ImageType::RLLine *>(this->m_RunLengthLine),
79 this->m_SegmentRemainder,
80 this->m_RealIndex,
81 value);
82 }
83
85 // * This method will provide the fastest access to pixel
86 // * data, but it will NOT support ImageAdaptors. */
87 // PixelType & Value()
88 // {
89 // return m_Buffer[m_Index[2]][m_Index[1]][m_RealIndex].second;
90 // }
91
92protected:
98 Self &
104};
105
106// Deduction guide for class template argument deduction (CTAD).
107template <typename TPixel, unsigned int VImageDimension, typename CounterType>
111
112// Deduction guide for class template argument deduction (CTAD).
113template <typename TPixel, unsigned int VImageDimension, typename CounterType>
117
118} // end namespace itk
119
120#endif // itkRLEImageScanlineIterator_h
Self & operator=(const Self &)=default
WeakPointer< RLEImage< TPixel, VImageDimension, CounterType > > m_Image
ImageScanlineConstIterator< RLEImage< TPixel, VImageDimension, CounterType > > Superclass
A multi-dimensional iterator templated over image type that walks a region of pixels,...
Run-Length Encoded image. It saves memory for label images at the expense of processing times....
Definition itkRLEImage.h:53
typename Superclass::RegionType RegionType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ImageScanlineIterator(SmartPointer< TImage >, const typename TImage::RegionType &) -> ImageScanlineIterator< TImage >