ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelSetUtils.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 itkLabelSetUtils_h
19#define itkLabelSetUtils_h
20
21#include <itkArray.h>
22
23#include "itkProgressReporter.h"
24#include <vector>
25namespace itk
26{
27namespace LabSet
28{
29template <class LineBufferType, class RealType>
30void
31DoLineErodeFirstPass(LineBufferType & lineBuf,
32 RealType leftend,
33 RealType rightend,
34 const RealType magnitude,
35 const RealType sigma)
36{
37 // This is the first pass algorithm. We can write down the values
38 // because we know the inputs are binary
39
40 const long lineLength = lineBuf.size();
41
42 for (long pos = 0; pos < lineLength; pos++)
43 {
44 // compute the height of the parabola starting at each end and
45 // keep the minimum
46 RealType left, right;
47 unsigned offset = lineLength - pos;
48 left = leftend - magnitude * (pos + 1) * (pos + 1);
49 right = rightend - magnitude * offset * offset;
50 // note hard coded value here - could be a parameter
51 // lineBuf[pos] = std::min(std::min(left, right),
52 // itk::NumericTraits<RealType>::One);
53 lineBuf[pos] = std::min(std::min(left, right), sigma);
54 }
55}
56
57template <class LineBufferType, class LabLineBufferType, class RealType>
58void
59DoLineDilateFirstPass(LineBufferType & lineBuf,
60 LineBufferType & tmpLineBuf,
61 LabLineBufferType & labBuf,
62 LabLineBufferType & NewLabBuf,
63 const RealType magnitude)
64{
65 // need to propagate the labels here
66 const long lineLength = lineBuf.size();
67 long lastcontact = 0;
68 RealType lastval = lineBuf[0];
69
70 for (long pos = 0; pos < lineLength; pos++)
71 {
72 // left pass
73 RealType krange = pos - lastcontact;
74 RealType thisval = lastval - magnitude * krange * krange;
75
76 if (lineBuf[pos] >= lineBuf[lastcontact])
77 {
78 lastcontact = pos;
79 lastval = lineBuf[pos];
80 }
81 tmpLineBuf[pos] = std::max(lineBuf[pos], thisval);
82 if (thisval > lineBuf[pos])
83 {
84 NewLabBuf[pos] = labBuf[lastcontact];
85 }
86 else
87 {
88 NewLabBuf[pos] = labBuf[pos];
89 }
90 }
91
92 lastcontact = lineLength - 1;
93 lastval = tmpLineBuf[lastcontact];
94 for (long pos = lineLength - 1; pos >= 0; pos--)
95 {
96 // right pass
97 RealType krange = lastcontact - pos;
98 RealType thisval = lastval - magnitude * krange * krange;
99
100 if (tmpLineBuf[pos] >= tmpLineBuf[lastcontact])
101 {
102 lastcontact = pos;
103 lastval = tmpLineBuf[pos];
104 }
105 lineBuf[pos] = std::max(tmpLineBuf[pos], thisval);
106 if (thisval > tmpLineBuf[pos])
107 {
108 NewLabBuf[pos] = labBuf[lastcontact];
109 }
110 // only need to do this bit on the first pass - it doubles as a
111 // way of initializing NewLabPos
112 // else
113 // {
114 // NewLabBuf[pos] = labBuf[pos];
115 // }
116 }
117}
118
119template <class LineBufferType, class RealType, bool doDilate>
120void
121DoLine(LineBufferType & lineBuf, LineBufferType & tmpLineBuf, const RealType magnitude, const RealType extreme)
122{
123 // contact point algorithm
124 long koffset = 0, newcontact = 0; // how far away the search starts.
125
126 const long lineLength = lineBuf.size();
127
128 // negative half of the parabola
129 for (long pos = 0; pos < lineLength; pos++)
130 {
131 auto baseVal = (RealType)extreme; // the base value for comparison
132 for (long krange = koffset; krange <= 0; krange++)
133 {
134 // difference needs to be paramaterised
135 RealType T = lineBuf[pos + krange] - magnitude * krange * krange;
136 // switch on template parameter - hopefully gets optimized away.
137 if (doDilate ? (T >= baseVal) : (T <= baseVal))
138 {
139 baseVal = T;
140 newcontact = krange;
141 }
142 }
143 tmpLineBuf[pos] = baseVal;
144 koffset = newcontact - 1;
145 }
146 // positive half of parabola
147 koffset = newcontact = 0;
148 for (long pos = lineLength - 1; pos >= 0; pos--)
149 {
150 auto baseVal = (RealType)extreme; // the base value for comparison
151 for (long krange = koffset; krange >= 0; krange--)
152 {
153 RealType T = tmpLineBuf[pos + krange] - magnitude * krange * krange;
154 if (doDilate ? (T >= baseVal) : (T <= baseVal))
155 {
156 baseVal = T;
157 newcontact = krange;
158 }
159 }
160 lineBuf[pos] = baseVal;
161 koffset = newcontact + 1;
162 }
163}
164
165template <class LineBufferType, class LabBufferType, class RealType, bool doDilate>
166void
167DoLineLabelProp(LineBufferType & lineBuf,
168 LineBufferType & tmpLineBuf,
169 LabBufferType & labelBuf,
170 LabBufferType & tmpLabelBuf,
171 const RealType magnitude,
172 const RealType extreme)
173{
174 // contact point algorithm
175 long koffset = 0, newcontact = 0; // how far away the search starts.
176
177 using LabelType = typename LabBufferType::ValueType;
178
179 const long lineLength = lineBuf.size();
180 // negative half of the parabola
181 for (long pos = 0; pos < lineLength; pos++)
182 {
183 auto baseVal = (RealType)extreme; // the base value for comparison
184 LabelType baseLab = labelBuf[pos];
185 for (long krange = koffset; krange <= 0; krange++)
186 {
187 // difference needs to be paramaterised
188 RealType T = lineBuf[pos + krange] - magnitude * krange * krange;
189 // switch on template parameter - hopefully gets optimized away.
190 if (doDilate ? (T >= baseVal) : (T <= baseVal))
191 {
192 baseVal = T;
193 newcontact = krange;
194 baseLab = labelBuf[pos + krange];
195 }
196 }
197 tmpLineBuf[pos] = baseVal;
198 tmpLabelBuf[pos] = baseLab;
199 koffset = newcontact - 1;
200 }
201 // positive half of parabola
202 koffset = newcontact = 0;
203#if 1
204 for (long pos = lineLength - 1; pos >= 0; pos--)
205 {
206 auto baseVal = (RealType)extreme; // the base value for comparison
207 // initialize the label to the previously pro
208 LabelType baseLab = tmpLabelBuf[pos];
209 for (long krange = koffset; krange >= 0; krange--)
210 {
211 RealType T = tmpLineBuf[pos + krange] - magnitude * krange * krange;
212 if (doDilate ? (T >= baseVal) : (T <= baseVal))
213 {
214 baseVal = T;
215 newcontact = krange;
216 baseLab = tmpLabelBuf[pos + krange];
217 }
218 }
219 lineBuf[pos] = baseVal;
220 labelBuf[pos] = baseLab;
221 koffset = newcontact + 1;
222 }
223#else
224 for (long pos = lineLength - 1; pos >= 0; pos--)
225 {
226 lineBuf[pos] = tmpLineBuf[pos];
227 labelBuf[pos] = tmpLabelBuf[pos];
228 }
229
230#endif
231}
232
233template <class TInIter, class TOutDistIter, class TOutLabIter, class RealType>
234void
235doOneDimensionErodeFirstPass(TInIter & inputIterator,
236 TOutDistIter & outputIterator,
237 TOutLabIter & outputLabIterator,
238 ProgressReporter & progress,
239 const unsigned lineLength,
240 const unsigned direction,
241 const int magnitudeSign,
242 const bool useImageSpacing,
243 const RealType imageScale,
244 const RealType sigma,
245 const bool lastpass)
246{
247 // specialised version for binary erosion during first pass. We can
248 // compute the results directly because the inputs are flat.
249 using LineBufferType = typename itk::Array<RealType>;
250 using LabelBufferType = typename itk::Array<typename TInIter::PixelType>;
251 RealType iscale = 1.0;
252 if (useImageSpacing)
253 {
254 iscale = imageScale;
255 }
256 // restructure equation to reduce numerical error
257 // const RealType magnitude = (magnitudeSign * iscale * iscale)/(2.0 *
258 // sigma);
259 const RealType magnitude = (magnitudeSign * iscale * iscale) / (2.0);
260 LineBufferType lineBuf(lineLength, 0.0);
261 LabelBufferType labBuf(lineLength, 0.0);
262
263 inputIterator.SetDirection(direction);
264 outputIterator.SetDirection(direction);
265 outputLabIterator.SetDirection(direction);
266
267 inputIterator.GoToBegin();
268 outputIterator.GoToBegin();
269 outputLabIterator.GoToBegin();
270
271 while (!inputIterator.IsAtEnd() && !outputIterator.IsAtEnd())
272 {
273 // process this direction
274 // fetch the line into the buffer - this methodology is like
275 // the gaussian filters
276 unsigned int i = 0;
277
278 // copy the scanline to a buffer
279 while (!inputIterator.IsAtEndOfLine())
280 {
281 labBuf[i] = (inputIterator.Get());
282 if (labBuf[i])
283 {
284 lineBuf[i] = 1.0;
285 }
286 ++i;
287 ++inputIterator;
288 }
289 // runlength encode the line buffer (could be integrated with extraction)
290
291 using EndType = std::vector<unsigned>;
292 EndType firsts;
293 EndType lasts;
294
295 for (unsigned idx = 0; idx < lineLength; idx++)
296 {
297 RealType val = labBuf[idx];
298 if (val != 0)
299 {
300 // found a run
301 firsts.push_back(idx);
302 unsigned idxend = idx;
303 for (; idxend < lineLength; idxend++)
304 {
305 if (val != labBuf[idxend])
306 {
307 break;
308 }
309 }
310 lasts.push_back(idxend - 1);
311 idx = idxend - 1;
312 }
313 }
314
315 for (unsigned R = 0; R < firsts.size(); R++)
316 {
317 unsigned first = firsts[R];
318 unsigned last = lasts[R];
319 unsigned SLL = last - first + 1;
320 LineBufferType ShortLineBuf(SLL);
321 // if one end of the run touches the image edge, then we leave
322 // the value as 1
323 RealType leftend = 0, rightend = 0;
324 if (first == 0)
325 {
326 leftend = sigma;
327 }
328 if (last == lineLength - 1)
329 {
330 rightend = sigma;
331 }
332
333 DoLineErodeFirstPass<LineBufferType, RealType>(ShortLineBuf, leftend, rightend, magnitude, sigma);
334 // copy the segment back into the full line buffer
335 std::copy(ShortLineBuf.begin(), ShortLineBuf.end(), &(lineBuf[first]));
336 }
337 // copy the line buffer back to the image
338 unsigned j = 0;
339 while (!outputIterator.IsAtEndOfLine())
340 {
341 outputIterator.Set(static_cast<typename TOutDistIter::PixelType>(lineBuf[j++]));
342 ++outputIterator;
343 }
344
345 if (lastpass)
346 {
347 // copy to the output image - this would be a weird case of only
348 // using a one dimensional SE
349 unsigned j2 = 0;
350 while (!outputLabIterator.IsAtEndOfLine())
351 {
352 typename TInIter::PixelType val = 0;
353 if (lineBuf[j2] == sigma)
354 {
355 val = labBuf[j2];
356 }
357 outputLabIterator.Set(val);
358 ++outputLabIterator;
359 ++j2;
360 }
361 outputLabIterator.NextLine();
362 }
363
364 // now onto the next line
365 inputIterator.NextLine();
366 outputIterator.NextLine();
367 progress.CompletedPixel();
368 }
369}
370
371template <class TInIter, class TOutDistIter, class TOutLabIter, class RealType>
372void
373doOneDimensionDilateFirstPass(TInIter & inputIterator,
374 TOutDistIter & outputIterator,
375 TOutLabIter & outputLabIterator,
376 ProgressReporter & progress,
377 const unsigned lineLength,
378 const unsigned direction,
379 const int magnitudeSign,
380 const bool useImageSpacing,
381 const RealType imageScale,
382 const RealType sigma)
383{
384 // specialised version for binary erosion during first pass. We can
385 // compute the results directly because the inputs are flat.
386 using LineBufferType = typename itk::Array<RealType>;
387 using LabelBufferType = typename itk::Array<typename TInIter::PixelType>;
388 RealType iscale = 1.0;
389 if (useImageSpacing)
390 {
391 iscale = imageScale;
392 }
393 // restructure equation to reduce numerical error
394 // const RealType magnitude = (magnitudeSign * iscale * iscale)/(2.0 *
395 // sigma);
396 const RealType magnitude = (magnitudeSign * iscale * iscale) / (2.0);
397 const RealType initRealValue = 0.0;
398 const typename TInIter::PixelType initPixelValue = 0.0;
399 LineBufferType lineBuf(lineLength, initRealValue);
400 LabelBufferType labBuf(lineLength, initPixelValue);
401 LineBufferType tmpLineBuf(lineLength, initRealValue);
402 LabelBufferType newLabBuf(lineLength, initPixelValue);
403
404 inputIterator.SetDirection(direction);
405 outputIterator.SetDirection(direction);
406 outputLabIterator.SetDirection(direction);
407
408 inputIterator.GoToBegin();
409 outputIterator.GoToBegin();
410 outputLabIterator.GoToBegin();
411
412 while (!inputIterator.IsAtEnd() && !outputIterator.IsAtEnd())
413 {
414 // process this direction
415 // fetch the line into the buffer - this methodology is like
416 // the gaussian filters
417 unsigned int i = 0;
418
419 // copy the scanline to a buffer
420 while (!inputIterator.IsAtEndOfLine())
421 {
422 labBuf[i] = (inputIterator.Get());
423 if (labBuf[i])
424 {
425 lineBuf[i] = sigma;
426 }
427 else
428 {
429 lineBuf[i] = 0;
430 }
431 ++i;
432 ++inputIterator;
433 }
434
435 DoLineDilateFirstPass<LineBufferType, LabelBufferType, RealType>(lineBuf, tmpLineBuf, labBuf, newLabBuf, magnitude);
436 // copy the line buffer back to the image
437 unsigned j = 0;
438 while (!outputIterator.IsAtEndOfLine())
439 {
440 outputIterator.Set(static_cast<typename TOutDistIter::PixelType>(lineBuf[j]));
441 outputLabIterator.Set(newLabBuf[j]);
442 ++outputLabIterator;
443 ++outputIterator;
444 ++j;
445 }
446
447 // now onto the next line
448 inputIterator.NextLine();
449 outputIterator.NextLine();
450 outputLabIterator.NextLine();
451 progress.CompletedPixel();
452 }
453}
454
455template <class TInIter, class TDistIter, class TOutLabIter, class TOutDistIter, class RealType>
456void
457doOneDimensionErode(TInIter & inputIterator,
458 TDistIter & inputDistIterator,
459 TOutDistIter & outputDistIterator,
460 TOutLabIter & outputLabIterator,
461 ProgressReporter & progress,
462 const unsigned lineLength,
463 const unsigned direction,
464 const int magnitudeSign,
465 const bool useImageSpacing,
466 const RealType extreme,
467 const RealType imageScale,
468 const RealType sigma,
469 const RealType BaseSigma,
470 const bool lastpass)
471{
472 // traditional erosion - can't optimise the same way as the first pass
473 using LineBufferType = typename itk::Array<RealType>;
474 using LabelBufferType = typename itk::Array<typename TInIter::PixelType>;
475 RealType iscale = 1.0;
476 if (useImageSpacing)
477 {
478 iscale = imageScale;
479 }
480 const RealType magnitude = (magnitudeSign * iscale * iscale) / (2.0 * sigma);
481 LineBufferType lineBuf(lineLength, 0.0);
482 LabelBufferType labBuf(lineLength, 0.0);
483
484 inputIterator.SetDirection(direction);
485 outputDistIterator.SetDirection(direction);
486 inputDistIterator.SetDirection(direction);
487 outputLabIterator.SetDirection(direction);
488
489 inputIterator.GoToBegin();
490 outputDistIterator.GoToBegin();
491 inputDistIterator.GoToBegin();
492 outputLabIterator.GoToBegin();
493
494 while (!inputIterator.IsAtEnd() && !outputDistIterator.IsAtEnd())
495 {
496 // process this direction
497 // fetch the line into the buffer - this methodology is like
498 // the gaussian filters
499 unsigned int i = 0;
500
501 // copy the scanline to a buffer
502 while (!inputIterator.IsAtEndOfLine())
503 {
504 lineBuf[i] = static_cast<RealType>(inputDistIterator.Get());
505 labBuf[i] = inputIterator.Get();
506 ++i;
507 ++inputDistIterator;
508 ++inputIterator;
509 }
510 // runlength encode the line buffer (could be integrated with extraction)
511 using EndType = std::vector<unsigned>;
512 EndType firsts;
513 EndType lasts;
514 for (unsigned idx = 0; idx < lineLength; idx++)
515 {
516 RealType val = labBuf[idx];
517 if (val != 0)
518 {
519 // found a run
520 firsts.push_back(idx);
521 unsigned idxend = idx;
522 for (; idxend < lineLength; idxend++)
523 {
524 if (val != labBuf[idxend])
525 {
526 break;
527 }
528 }
529 lasts.push_back(idxend - 1);
530 idx = idxend - 1;
531 }
532 }
533
534 for (unsigned R = 0; R < firsts.size(); R++)
535 {
536 unsigned first = firsts[R];
537 unsigned last = lasts[R];
538 unsigned SLL = last - first + 1;
539 LineBufferType ShortLineBuf(SLL + 2);
540 LineBufferType tmpShortLineBuf(SLL + 2);
541
542 // if one end of the run touches the image edge, then we leave
543 // the value as 1
544 RealType leftend = 0, rightend = 0;
545 if (first == 0)
546 {
547 leftend = BaseSigma;
548 }
549 if (last == lineLength - 1)
550 {
551 rightend = BaseSigma;
552 }
553
554 ShortLineBuf[0] = leftend;
555 ShortLineBuf[SLL + 1] = rightend;
556
557 std::copy(&(lineBuf[first]), &(lineBuf[last + 1]), &(ShortLineBuf[1]));
558
559 DoLine<LineBufferType, RealType, false>(ShortLineBuf, tmpShortLineBuf, magnitude, extreme);
560 // copy the segment back into the full line buffer
561 std::copy(&(ShortLineBuf[1]), &(ShortLineBuf[SLL + 1]), &(lineBuf[first]));
562 }
563 // copy the line buffer back to the image - don't need to do it on
564 // the last pass - move when we are sure it is working
565 unsigned j = 0;
566 while (!outputDistIterator.IsAtEndOfLine())
567 {
568 outputDistIterator.Set(static_cast<typename TOutDistIter::PixelType>(lineBuf[j++]));
569 ++outputDistIterator;
570 }
571
572 if (lastpass)
573 {
574 unsigned j2 = 0;
575 while (!outputLabIterator.IsAtEndOfLine())
576 {
577 typename TInIter::PixelType val = 0;
578 if (lineBuf[j2] == BaseSigma)
579 {
580 val = labBuf[j2];
581 }
582 outputLabIterator.Set(val);
583 ++outputLabIterator;
584 ++j2;
585 }
586 outputLabIterator.NextLine();
587 }
588 // now onto the next line
589 inputIterator.NextLine();
590 inputDistIterator.NextLine();
591 outputDistIterator.NextLine();
592 progress.CompletedPixel();
593 }
594}
595
596template <class TInIter, class TDistIter, class TOutLabIter, class TOutDistIter, class RealType>
597void
598doOneDimensionDilate(TInIter & inputIterator,
599 TDistIter & inputDistIterator,
600 TOutDistIter & outputDistIterator,
601 TOutLabIter & outputLabIterator,
602 ProgressReporter & progress,
603 const unsigned lineLength,
604 const unsigned direction,
605 const int magnitudeSign,
606 const bool useImageSpacing,
607 const RealType extreme,
608 const RealType imageScale,
609 const RealType sigma)
610{
611 // specialised version for binary erosion during first pass. We can
612 // compute the results directly because the inputs are flat.
613 using LineBufferType = typename itk::Array<RealType>;
614 using LabelBufferType = typename itk::Array<typename TInIter::PixelType>;
615 RealType iscale = 1.0;
616 if (useImageSpacing)
617 {
618 iscale = imageScale;
619 }
620 // restructure equation to reduce numerical error
621 const RealType magnitude = (magnitudeSign * iscale * iscale) / (2.0 * sigma);
622 // const RealType magnitude = (magnitudeSign * iscale * iscale)/(2.0 );
623 const RealType initRealValue = 0.0;
624 const typename TInIter::PixelType initPixelValue = 0.0;
625 LineBufferType lineBuf(lineLength, initRealValue);
626 LabelBufferType labBuf(lineLength, initPixelValue);
627 LineBufferType tmpLineBuf(lineLength, initRealValue);
628 LabelBufferType newLabBuf(lineLength, initPixelValue);
629 LabelBufferType tmpLabBuf(lineLength, initPixelValue);
630
631 inputIterator.SetDirection(direction);
632 inputDistIterator.SetDirection(direction);
633 outputDistIterator.SetDirection(direction);
634 outputLabIterator.SetDirection(direction);
635
636 inputIterator.GoToBegin();
637 inputDistIterator.GoToBegin();
638 outputDistIterator.GoToBegin();
639 outputLabIterator.GoToBegin();
640
641 while (!inputDistIterator.IsAtEnd() && !outputLabIterator.IsAtEnd())
642 {
643 // process this direction
644 // fetch the line into the buffer - this methodology is like
645 // the gaussian filters
646 unsigned int i = 0;
647
648 // copy the scanline to a buffer
649 while (!inputDistIterator.IsAtEndOfLine())
650 {
651 lineBuf[i] = inputDistIterator.Get();
652 labBuf[i] = inputIterator.Get();
653 ++i;
654 ++inputIterator;
655 ++inputDistIterator;
656 }
657
659 lineBuf, tmpLineBuf, labBuf, tmpLabBuf, magnitude, extreme);
660 // copy the line buffer back to the image
661 unsigned j = 0;
662 while (!outputDistIterator.IsAtEndOfLine())
663 {
664 outputDistIterator.Set(static_cast<typename TOutDistIter::PixelType>(lineBuf[j]));
665 outputLabIterator.Set(labBuf[j]);
666 ++outputDistIterator;
667 ++outputLabIterator;
668 j++;
669 }
670
671 // now onto the next line
672 inputIterator.NextLine();
673 outputLabIterator.NextLine();
674 inputDistIterator.NextLine();
675 outputDistIterator.NextLine();
676 progress.CompletedPixel();
677 }
678}
679} // namespace LabSet
680} // namespace itk
681#endif
Array class with size defined at construction time.
Definition itkArray.h:48
Implements progress tracking for a filter.
void doOneDimensionDilate(TInIter &inputIterator, TDistIter &inputDistIterator, TOutDistIter &outputDistIterator, TOutLabIter &outputLabIterator, ProgressReporter &progress, const unsigned lineLength, const unsigned direction, const int magnitudeSign, const bool useImageSpacing, const RealType extreme, const RealType imageScale, const RealType sigma)
void DoLineLabelProp(LineBufferType &lineBuf, LineBufferType &tmpLineBuf, LabBufferType &labelBuf, LabBufferType &tmpLabelBuf, const RealType magnitude, const RealType extreme)
void DoLineErodeFirstPass(LineBufferType &lineBuf, RealType leftend, RealType rightend, const RealType magnitude, const RealType sigma)
void doOneDimensionErodeFirstPass(TInIter &inputIterator, TOutDistIter &outputIterator, TOutLabIter &outputLabIterator, ProgressReporter &progress, const unsigned lineLength, const unsigned direction, const int magnitudeSign, const bool useImageSpacing, const RealType imageScale, const RealType sigma, const bool lastpass)
void doOneDimensionErode(TInIter &inputIterator, TDistIter &inputDistIterator, TOutDistIter &outputDistIterator, TOutLabIter &outputLabIterator, ProgressReporter &progress, const unsigned lineLength, const unsigned direction, const int magnitudeSign, const bool useImageSpacing, const RealType extreme, const RealType imageScale, const RealType sigma, const RealType BaseSigma, const bool lastpass)
void doOneDimensionDilateFirstPass(TInIter &inputIterator, TOutDistIter &outputIterator, TOutLabIter &outputLabIterator, ProgressReporter &progress, const unsigned lineLength, const unsigned direction, const int magnitudeSign, const bool useImageSpacing, const RealType imageScale, const RealType sigma)
void DoLineDilateFirstPass(LineBufferType &lineBuf, LineBufferType &tmpLineBuf, LabLineBufferType &labBuf, LabLineBufferType &NewLabBuf, const RealType magnitude)
void DoLine(LineBufferType &lineBuf, LineBufferType &tmpLineBuf, const RealType magnitude, const RealType extreme)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....