ITK  5.2.0
Insight Toolkit
itkScanlineFilterCommon.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  * 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 itkScanlineFilterCommon_h
19 #define itkScanlineFilterCommon_h
20 
21 #include "itkImageToImageFilter.h"
23 #include <atomic>
24 #include <deque>
25 #include <functional>
26 #include <mutex>
27 #include <vector>
28 
29 namespace itk
30 {
40 template <typename TInputImage, typename TOutputImage>
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(ScanlineFilterCommon);
45 
49  void
50  Register() const
51  {
52  auto * obj = static_cast<Object *>(m_EnclosingFilter.GetPointer());
53  obj->Register();
54  }
55  void
56  UnRegister() const noexcept
57  {
58  auto * obj = static_cast<Object *>(m_EnclosingFilter.GetPointer());
59  obj->UnRegister();
60  }
61  static Pointer
62  New()
63  {
65  if (smartPtr == nullptr)
66  {
67  smartPtr = new Self(nullptr);
68  }
69  smartPtr->UnRegister();
70  return smartPtr;
71  }
72 
77  using OutputPixelType = typename TOutputImage::PixelType;
78  using InputPixelType = typename TInputImage::PixelType;
79  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
80  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
81  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
82  using InputImageType = TInputImage;
83  using InputImagePointer = typename InputImageType::Pointer;
84  using InputImageConstPointer = typename InputImageType::ConstPointer;
86  using SizeType = typename TInputImage::SizeType;
87  using OffsetType = typename TInputImage::OffsetType;
88  using OutputImageType = TOutputImage;
89  using OutputImagePointer = typename OutputImageType::Pointer;
94  using OutputOffsetType = typename TOutputImage::OffsetType;
95  using OutputImagePixelType = typename TOutputImage::PixelType;
96 
97 #ifdef ITK_USE_CONCEPT_CHECKING
98  // Concept checking -- input and output dimensions must be the same
100 #endif
101 
103 
105  : m_EnclosingFilter(enclosingFilter)
106  , m_FullyConnected(false)
107  {}
108  ~ScanlineFilterCommon() = default;
109 
110 protected:
113 
114  struct RunLength
115  {
119 
120  RunLength(SizeValueType iLength, const IndexType & iWhere, InternalLabelType iLabel = 0)
121  : length(iLength)
122  , where(iWhere)
123  , label(iLabel)
124  {}
125  };
126 
127  using LineEncodingType = std::vector<RunLength>;
128  using LineEncodingIterator = typename LineEncodingType::iterator;
129  using LineEncodingConstIterator = typename LineEncodingType::const_iterator;
130 
131  using OffsetVectorType = std::vector<OffsetValueType>;
132  using OffsetVectorConstIterator = typename OffsetVectorType::const_iterator;
133 
134  using LineMapType = std::vector<LineEncodingType>;
135 
136  using UnionFindType = std::vector<InternalLabelType>;
137  using ConsecutiveVectorType = std::vector<OutputPixelType>;
138 
140  IndexToLinearIndex(const IndexType & index) const
141  {
142  SizeValueType linearIndex = 0;
143  SizeValueType stride = 1;
144  RegionType requestedRegion = m_EnclosingFilter->GetOutput()->GetRequestedRegion();
145  // ignore x axis, which is always full size
146  for (unsigned dim = 1; dim < ImageDimension; dim++)
147  {
148  itkAssertOrThrowMacro(requestedRegion.GetIndex(dim) <= index[dim], "Index must be within the requested region!");
149  linearIndex += (index[dim] - requestedRegion.GetIndex(dim)) * stride;
150  stride *= requestedRegion.GetSize(dim);
151  }
152  return linearIndex;
153  }
154 
155  void
156  InitUnion(InternalLabelType numberOfLabels)
157  {
158  m_UnionFind = UnionFindType(numberOfLabels + 1);
159 
160  typename LineMapType::iterator MapBegin, MapEnd, LineIt;
161  MapBegin = m_LineMap.begin();
162  MapEnd = m_LineMap.end();
163  LineIt = MapBegin;
164  InternalLabelType label = 1;
165  for (LineIt = MapBegin; LineIt != MapEnd; ++LineIt)
166  {
168  for (cIt = LineIt->begin(); cIt != LineIt->end(); ++cIt)
169  {
170  cIt->label = label;
171  m_UnionFind[label] = label;
172  label++;
173  }
174  }
175  }
176 
179  {
180  InternalLabelType l = label;
181  while (l != m_UnionFind[l])
182  {
183  l = m_UnionFind[l]; // transitively sets equivalence
184  }
185  return l;
186  }
187 
188  void
189  LinkLabels(const InternalLabelType label1, const InternalLabelType label2)
190  {
191  std::lock_guard<std::mutex> mutexHolder(m_Mutex);
192  InternalLabelType E1 = this->LookupSet(label1);
193  InternalLabelType E2 = this->LookupSet(label2);
194 
195  if (E1 < E2)
196  {
197  m_UnionFind[E2] = E1;
198  }
199  else
200  {
201  m_UnionFind[E1] = E2;
202  }
203  }
204 
207  {
208  const size_t N = m_UnionFind.size();
209 
211  m_Consecutive[0] = backgroundValue;
212 
213  OutputPixelType consecutiveLabel = 0;
214  SizeValueType count = 0;
215 
216  for (size_t i = 1; i < N; i++)
217  {
218  const auto label = static_cast<size_t>(m_UnionFind[i]);
219  if (label == i)
220  {
221  if (consecutiveLabel == backgroundValue)
222  {
223  ++consecutiveLabel;
224  }
225  m_Consecutive[label] = consecutiveLabel;
226  ++consecutiveLabel;
227  ++count;
228  }
229  }
230  return count;
231  }
232 
233  bool
234  CheckNeighbors(const OutputIndexType & A, const OutputIndexType & B) const
235  {
236  // This checks whether the line encodings are really neighbors. The first
237  // dimension gets ignored because the encodings are along that axis.
238  SizeValueType diffSum = 0;
239  for (unsigned i = 1; i < OutputImageDimension; i++)
240  {
241  SizeValueType diff = Math::abs(A[i] - B[i]);
242  if (diff > 1)
243  {
244  return false;
245  }
246  diffSum += diff;
247  }
248 
249  if (!this->m_FullyConnected)
250  {
251  return (diffSum <= 1); // indices can differ only along one dimension
252  }
253  return true;
254  }
255 
256  using CompareLinesCallback = std::function<void(const LineEncodingConstIterator & currentRun,
257  const LineEncodingConstIterator & neighborRun,
258  OffsetValueType oStart,
260 
261  void
263  const LineEncodingType & Neighbour,
264  bool sameLineOffset,
265  bool labelCompare,
266  OutputPixelType background,
267  CompareLinesCallback callback)
268  {
269  bool sameLine = sameLineOffset;
270  if (sameLineOffset)
271  {
272  OutputOffsetType Off = current[0].where - Neighbour[0].where;
273 
274  for (unsigned int i = 1; i < ImageDimension; i++)
275  {
276  if (Off[i] != 0)
277  {
278  sameLine = false;
279  break;
280  }
281  }
282  }
283 
284  OffsetValueType offset = 0;
285  if (m_FullyConnected || sameLine)
286  {
287  offset = 1;
288  }
289 
290  LineEncodingConstIterator nIt, mIt, cIt;
291 
292  mIt = Neighbour.begin(); // out marker iterator
293 
294  for (cIt = current.begin(); cIt != current.end(); ++cIt)
295  {
296  if (!labelCompare || cIt->label != InternalLabelType(background))
297  {
298  OffsetValueType cStart = cIt->where[0]; // the start x position
299  OffsetValueType cLast = cStart + cIt->length - 1;
300 
301  if (labelCompare)
302  {
303  mIt = Neighbour.begin();
304  }
305 
306  for (nIt = mIt; nIt != Neighbour.end(); ++nIt)
307  {
308  if (!labelCompare || cIt->label != nIt->label)
309  {
310  OffsetValueType nStart = nIt->where[0];
311  OffsetValueType nLast = nStart + nIt->length - 1;
312 
313  // there are a few ways that neighbouring lines might overlap
314  // neighbor S------------------E
315  // current S------------------------E
316  //-------------
317  // neighbor S------------------E
318  // current S----------------E
319  //-------------
320  // neighbor S------------------E
321  // current S------------------E
322  //-------------
323  // neighbor S------------------E
324  // current S-------E
325  //-------------
326  OffsetValueType ss1 = nStart - offset;
327  // OffsetValueType ss2 = nStart + offset;
328  OffsetValueType ee1 = nLast - offset;
329  OffsetValueType ee2 = nLast + offset;
330 
331  bool eq = false;
332  OffsetValueType oStart = 0;
333  OffsetValueType oLast = 0;
334 
335  // the logic here can probably be improved a lot
336  if ((ss1 >= cStart) && (ee2 <= cLast))
337  {
338  // case 1
339  eq = true;
340  oStart = ss1;
341  oLast = ee2;
342  }
343  else if ((ss1 <= cStart) && (ee2 >= cLast))
344  {
345  // case 4
346  eq = true;
347  oStart = cStart;
348  oLast = cLast;
349  }
350  else if ((ss1 <= cLast) && (ee2 >= cLast))
351  {
352  // case 2
353  eq = true;
354  oStart = ss1;
355  oLast = cLast;
356  }
357  else if ((ss1 <= cStart) && (ee2 >= cStart))
358  {
359  // case 3
360  eq = true;
361  oStart = cStart;
362  oLast = ee2;
363  }
364 
365  if (eq)
366  {
367  callback(cIt, nIt, oStart, oLast);
368  if (sameLineOffset && oStart == cStart && oLast == cLast)
369  {
370  mIt = nIt;
371  break;
372  }
373  }
374 
375  if (!sameLineOffset && ee1 >= cLast)
376  {
377  // No point looking for more overlaps with the current run
378  // because the neighbor run is either case 2 or 4
379  mIt = nIt;
380  break;
381  }
382  }
383  }
384  }
385  }
386  }
387 
388  void
389  SetupLineOffsets(bool wholeNeighborhood)
390  {
391  // Create a neighborhood so that we can generate a table of offsets
392  // to "previous" line indexes
393  // We are going to mis-use the neighborhood iterators to compute the
394  // offset for us. All this messing around produces an array of
395  // offsets that will be used to index the map
396  typename TOutputImage::Pointer output = m_EnclosingFilter->GetOutput();
397  using PretendImageType = Image<OffsetValueType, TOutputImage::ImageDimension - 1>;
398  using PretendSizeType = typename PretendImageType::RegionType::SizeType;
399  using PretendIndexType = typename PretendImageType::RegionType::IndexType;
400  using LineNeighborhoodType = ConstShapedNeighborhoodIterator<PretendImageType>;
401 
402  typename PretendImageType::Pointer fakeImage;
403  fakeImage = PretendImageType::New();
404 
405  typename PretendImageType::RegionType LineRegion;
406 
407  OutSizeType OutSize = output->GetRequestedRegion().GetSize();
408 
409  PretendSizeType PretendSize;
410  // The first dimension has been collapsed
411  for (SizeValueType i = 0; i < PretendSize.GetSizeDimension(); i++)
412  {
413  PretendSize[i] = OutSize[i + 1];
414  }
415 
416  LineRegion.SetSize(PretendSize);
417  fakeImage->SetRegions(LineRegion);
418  PretendSizeType kernelRadius;
419  kernelRadius.Fill(1);
420  LineNeighborhoodType lnit(kernelRadius, fakeImage, LineRegion);
421 
422  if (wholeNeighborhood)
423  {
425  }
426  else
427  {
429  }
430 
431  typename LineNeighborhoodType::IndexListType ActiveIndexes;
432  ActiveIndexes = lnit.GetActiveIndexList();
433 
434  typename LineNeighborhoodType::IndexListType::const_iterator LI;
435 
436  PretendIndexType idx = LineRegion.GetIndex();
437  OffsetValueType offset = fakeImage->ComputeOffset(idx);
438 
439  for (LI = ActiveIndexes.begin(); LI != ActiveIndexes.end(); ++LI)
440  {
441  m_LineOffsets.push_back(fakeImage->ComputeOffset(idx + lnit.GetOffset(*LI)) - offset);
442  }
443 
444  if (wholeNeighborhood)
445  {
446  m_LineOffsets.push_back(0); // center pixel
447  }
448  }
449 
451 
453  {
456  };
457 
459  CreateWorkUnitData(const RegionType & outputRegionForThread)
460  {
461  const SizeValueType xsizeForThread = outputRegionForThread.GetSize()[0];
462  const SizeValueType numberOfLines = outputRegionForThread.GetNumberOfPixels() / xsizeForThread;
463 
464  const SizeValueType firstLine = this->IndexToLinearIndex(outputRegionForThread.GetIndex());
465  const SizeValueType lastLine = firstLine + numberOfLines - 1;
466 
467  return WorkUnitData{ firstLine, lastLine };
468  }
469 
470  /* Process the map and make appropriate entries in an equivalence table */
471  void
472  ComputeEquivalence(const SizeValueType workUnitResultsIndex, bool strictlyLess)
473  {
474  const OffsetValueType linecount = m_LineMap.size();
475  WorkUnitData wud = m_WorkUnitResults[workUnitResultsIndex];
476  SizeValueType lastLine = wud.lastLine;
477  if (!strictlyLess)
478  {
479  lastLine++;
480  // make sure we are not wrapping around
481  itkAssertInDebugAndIgnoreInReleaseMacro(lastLine >= wud.lastLine);
482  }
483  for (SizeValueType thisIdx = wud.firstLine; thisIdx < lastLine; ++thisIdx)
484  {
485  if (!m_LineMap[thisIdx].empty())
486  {
487  auto it = this->m_LineOffsets.begin();
488  while (it != this->m_LineOffsets.end())
489  {
490  OffsetValueType neighIdx = thisIdx + (*it);
491  // check if the neighbor is in the map
492  if (neighIdx >= 0 && neighIdx < linecount && !m_LineMap[neighIdx].empty())
493  {
494  // Now check whether they are really neighbors
495  bool areNeighbors = this->CheckNeighbors(m_LineMap[thisIdx][0].where, m_LineMap[neighIdx][0].where);
496  if (areNeighbors)
497  {
498  this->CompareLines(m_LineMap[thisIdx],
499  m_LineMap[neighIdx],
500  false,
501  false,
502  0,
503  [this](const LineEncodingConstIterator & currentRun,
504  const LineEncodingConstIterator & neighborRun,
506  OffsetValueType) { this->LinkLabels(neighborRun->label, currentRun->label); });
507  }
508  }
509  ++it;
510  }
511  }
512  }
513  }
514 
515 protected:
520  std::mutex m_Mutex;
521 
522  std::atomic<SizeValueType> m_NumberOfLabels;
523  std::deque<WorkUnitData> m_WorkUnitResults;
525 };
526 } // end namespace itk
527 
528 #endif
itk::ScanlineFilterCommon::RunLength::length
SizeValueType length
Definition: itkScanlineFilterCommon.h:116
itk::ScanlineFilterCommon::m_LineMap
LineMapType m_LineMap
Definition: itkScanlineFilterCommon.h:524
itk::ScanlineFilterCommon::m_NumberOfLabels
std::atomic< SizeValueType > m_NumberOfLabels
Definition: itkScanlineFilterCommon.h:522
itkConstShapedNeighborhoodIterator.h
itk::ScanlineFilterCommon::LineEncodingIterator
typename LineEncodingType::iterator LineEncodingIterator
Definition: itkScanlineFilterCommon.h:128
itk::ScanlineFilterCommon::CompareLinesCallback
std::function< void(const LineEncodingConstIterator &currentRun, const LineEncodingConstIterator &neighborRun, OffsetValueType oStart, OffsetValueType oLast)> CompareLinesCallback
Definition: itkScanlineFilterCommon.h:259
itk::ScanlineFilterCommon::RunLength::RunLength
RunLength(SizeValueType iLength, const IndexType &iWhere, InternalLabelType iLabel=0)
Definition: itkScanlineFilterCommon.h:120
itk::ScanlineFilterCommon::LineMapType
std::vector< LineEncodingType > LineMapType
Definition: itkScanlineFilterCommon.h:134
itk::setConnectivity
TIterator * setConnectivity(TIterator *it, bool fullyConnected=false)
Definition: itkConnectedComponentAlgorithm.h:28
itk::ScanlineFilterCommon::LineEncodingType
std::vector< RunLength > LineEncodingType
Definition: itkScanlineFilterCommon.h:127
itk::ScanlineFilterCommon::CompareLines
void CompareLines(const LineEncodingType &current, const LineEncodingType &Neighbour, bool sameLineOffset, bool labelCompare, OutputPixelType background, CompareLinesCallback callback)
Definition: itkScanlineFilterCommon.h:262
itk::ScanlineFilterCommon::OutputImageType
TOutputImage OutputImageType
Definition: itkScanlineFilterCommon.h:88
itk::ScanlineFilterCommon::CreateWorkUnitData
WorkUnitData CreateWorkUnitData(const RegionType &outputRegionForThread)
Definition: itkScanlineFilterCommon.h:459
itk::ScanlineFilterCommon::RunLength
Definition: itkScanlineFilterCommon.h:114
itk::ScanlineFilterCommon::New
static Pointer New()
Definition: itkScanlineFilterCommon.h:62
itk::ScanlineFilterCommon::OffsetVectorType
std::vector< OffsetValueType > OffsetVectorType
Definition: itkScanlineFilterCommon.h:131
itk::ScanlineFilterCommon::OffsetType
typename TInputImage::OffsetType OffsetType
Definition: itkScanlineFilterCommon.h:87
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ImageRegion::GetSize
const SizeType & GetSize() const
Definition: itkImageRegion.h:181
itk::ScanlineFilterCommon::WorkUnitData::lastLine
SizeValueType lastLine
Definition: itkScanlineFilterCommon.h:455
itk::SmartPointer< Self >
itk::ScanlineFilterCommon::m_FullyConnected
bool m_FullyConnected
Definition: itkScanlineFilterCommon.h:516
itk::ScanlineFilterCommon::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkScanlineFilterCommon.h:77
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::ScanlineFilterCommon::UnionFindType
std::vector< InternalLabelType > UnionFindType
Definition: itkScanlineFilterCommon.h:136
itk::ScanlineFilterCommon::OutputRegionType
typename TOutputImage::RegionType OutputRegionType
Definition: itkScanlineFilterCommon.h:90
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ScanlineFilterCommon::WorkUnitData::firstLine
SizeValueType firstLine
Definition: itkScanlineFilterCommon.h:454
itk::ScanlineFilterCommon::InternalLabelType
SizeValueType InternalLabelType
Definition: itkScanlineFilterCommon.h:111
itk::ScanlineFilterCommon::WorkUnitData
Definition: itkScanlineFilterCommon.h:452
itk::ScanlineFilterCommon::RunLength::label
InternalLabelType label
Definition: itkScanlineFilterCommon.h:118
itk::ScanlineFilterCommon::m_LineOffsets
OffsetVectorType m_LineOffsets
Definition: itkScanlineFilterCommon.h:517
itk::ScanlineFilterCommon::LinkLabels
void LinkLabels(const InternalLabelType label1, const InternalLabelType label2)
Definition: itkScanlineFilterCommon.h:189
itk::ScanlineFilterCommon::OutSizeType
typename TOutputImage::RegionType::SizeType OutSizeType
Definition: itkScanlineFilterCommon.h:112
itk::ScanlineFilterCommon::m_UnionFind
UnionFindType m_UnionFind
Definition: itkScanlineFilterCommon.h:518
itk::ScanlineFilterCommon::ScanlineFilterCommon
ScanlineFilterCommon(EnclosingFilter *enclosingFilter)
Definition: itkScanlineFilterCommon.h:104
itk::ScanlineFilterCommon::Pointer
SmartPointer< Self > Pointer
Definition: itkScanlineFilterCommon.h:47
itk::ScanlineFilterCommon::RunLength::where
InputImageType::IndexType where
Definition: itkScanlineFilterCommon.h:117
itk::ScanlineFilterCommon::OffsetVectorConstIterator
typename OffsetVectorType::const_iterator OffsetVectorConstIterator
Definition: itkScanlineFilterCommon.h:132
itk::ScanlineFilterCommon::m_WorkUnitResults
std::deque< WorkUnitData > m_WorkUnitResults
Definition: itkScanlineFilterCommon.h:523
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ScanlineFilterCommon::InputImageDimension
static constexpr unsigned int InputImageDimension
Definition: itkScanlineFilterCommon.h:81
itk::ScanlineFilterCommon::ImageDimension
static constexpr unsigned int ImageDimension
Definition: itkScanlineFilterCommon.h:79
itk::ScanlineFilterCommon::~ScanlineFilterCommon
~ScanlineFilterCommon()=default
itk::SmartPointer::UnRegister
void UnRegister() noexcept
Definition: itkSmartPointer.h:212
itk::ScanlineFilterCommon::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkScanlineFilterCommon.h:89
itk::ConstShapedNeighborhoodIterator
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
Definition: itkConstShapedNeighborhoodIterator.h:72
itk::ScanlineFilterCommon::m_Mutex
std::mutex m_Mutex
Definition: itkScanlineFilterCommon.h:520
itkImageToImageFilter.h
itk::ScanlineFilterCommon::ConsecutiveVectorType
std::vector< OutputPixelType > ConsecutiveVectorType
Definition: itkScanlineFilterCommon.h:137
itk::ScanlineFilterCommon::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkScanlineFilterCommon.h:78
itk::ScanlineFilterCommon::InputImageType
TInputImage InputImageType
Definition: itkScanlineFilterCommon.h:82
itk::ScanlineFilterCommon::Self
ScanlineFilterCommon Self
Definition: itkScanlineFilterCommon.h:46
itk::ScanlineFilterCommon::m_Consecutive
ConsecutiveVectorType m_Consecutive
Definition: itkScanlineFilterCommon.h:519
itk::ScanlineFilterCommon::OutputIndexType
typename TOutputImage::IndexType OutputIndexType
Definition: itkScanlineFilterCommon.h:92
itk::ScanlineFilterCommon::UnRegister
void UnRegister() const noexcept
Definition: itkScanlineFilterCommon.h:56
itk::Size::SetSize
void SetSize(const SizeValueType val[VDimension])
Definition: itkSize.h:179
itk::WeakPointer
Implements a weak reference to an object.
Definition: itkWeakPointer.h:44
itk::ScanlineFilterCommon::CreateConsecutive
SizeValueType CreateConsecutive(OutputPixelType backgroundValue)
Definition: itkScanlineFilterCommon.h:206
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::ScanlineFilterCommon::SetupLineOffsets
void SetupLineOffsets(bool wholeNeighborhood)
Definition: itkScanlineFilterCommon.h:389
itk::ScanlineFilterCommon::OutputOffsetType
typename TOutputImage::OffsetType OutputOffsetType
Definition: itkScanlineFilterCommon.h:94
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ScanlineFilterCommon
Helper class for a group of filters which operate on scan-lines.
Definition: itkScanlineFilterCommon.h:41
itk::ScanlineFilterCommon::Register
void Register() const
Definition: itkScanlineFilterCommon.h:50
itk::OffsetValueType
signed long OffsetValueType
Definition: itkIntTypes.h:94
itk::ScanlineFilterCommon::LookupSet
InternalLabelType LookupSet(const InternalLabelType label)
Definition: itkScanlineFilterCommon.h:178
itk::ScanlineFilterCommon::m_EnclosingFilter
WeakPointer< EnclosingFilter > m_EnclosingFilter
Definition: itkScanlineFilterCommon.h:450
itk::ScanlineFilterCommon::InitUnion
void InitUnion(InternalLabelType numberOfLabels)
Definition: itkScanlineFilterCommon.h:156
itk::ScanlineFilterCommon::OutputImageDimension
static constexpr unsigned int OutputImageDimension
Definition: itkScanlineFilterCommon.h:80
itk::ScanlineFilterCommon::OutputSizeType
typename TOutputImage::SizeType OutputSizeType
Definition: itkScanlineFilterCommon.h:93
itk::ObjectFactory::Create
static T::Pointer Create()
Definition: itkObjectFactory.h:59
itk::ScanlineFilterCommon::LineEncodingConstIterator
typename LineEncodingType::const_iterator LineEncodingConstIterator
Definition: itkScanlineFilterCommon.h:129
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::ScanlineFilterCommon::CheckNeighbors
bool CheckNeighbors(const OutputIndexType &A, const OutputIndexType &B) const
Definition: itkScanlineFilterCommon.h:234
itk::ScanlineFilterCommon::ComputeEquivalence
void ComputeEquivalence(const SizeValueType workUnitResultsIndex, bool strictlyLess)
Definition: itkScanlineFilterCommon.h:472
itk::setConnectivityPrevious
TIterator * setConnectivityPrevious(TIterator *it, bool fullyConnected=false)
Definition: itkConnectedComponentAlgorithm.h:64
itk::ScanlineFilterCommon::OutputImagePixelType
typename TOutputImage::PixelType OutputImagePixelType
Definition: itkScanlineFilterCommon.h:95
itk::ScanlineFilterCommon::IndexToLinearIndex
SizeValueType IndexToLinearIndex(const IndexType &index) const
Definition: itkScanlineFilterCommon.h:140
itk::ScanlineFilterCommon::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkScanlineFilterCommon.h:83
itk::ScanlineFilterCommon::IndexType
typename TInputImage::IndexType IndexType
Definition: itkScanlineFilterCommon.h:85
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ScanlineFilterCommon::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkScanlineFilterCommon.h:84
itk::ScanlineFilterCommon::RegionType
OutputRegionType RegionType
Definition: itkScanlineFilterCommon.h:91
itk::ScanlineFilterCommon::SizeType
typename TInputImage::SizeType SizeType
Definition: itkScanlineFilterCommon.h:86