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