36#ifndef VIGRA_LOCALMINMAX_HXX
37#define VIGRA_LOCALMINMAX_HXX
42#include "stdimage.hxx"
43#include "initimage.hxx"
44#include "labelimage.hxx"
45#include "labelvolume.hxx"
46#include "pixelneighborhood.hxx"
47#include "voxelneighborhood.hxx"
48#include "multi_shape.hxx"
62template <
class SrcIterator,
class SrcAccessor,
66isLocalExtremum(SrcIterator is, SrcAccessor sa, Neighborhood,
67 typename SrcAccessor::value_type threshold,
70 typename SrcAccessor::value_type v = sa(is);
72 if(!compare(v, threshold))
75 int directionCount = Neighborhood::nearBorderDirectionCount(atBorder);
76 RestrictedNeighborhoodCirculator<SrcIterator, Neighborhood> sc(is, atBorder);
77 for(
int i = 0; i < directionCount; ++i, ++sc)
79 if(!compare(v, sa(sc)))
85template <
class SrcIterator,
class SrcAccessor,
86 class DestIterator,
class DestAccessor,
87 class DestValue,
class Neighborhood,
90localMinMax(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
91 DestIterator dul, DestAccessor da,
92 DestValue marker, Neighborhood neighborhood,
93 typename SrcAccessor::value_type threshold,
95 bool allowExtremaAtBorder =
false)
97 int w = slr.x - sul.x;
98 int h = slr.y - sul.y;
102 if(allowExtremaAtBorder)
104 SrcIterator is = sul;
105 DestIterator
id = dul;
107 for(x=0; x<w; ++x, ++is.x, ++
id.x)
109 if(isLocalExtremum(is, sa, neighborhood, threshold, compare,
114 is = sul + Diff2D(0,1);
115 id = dul + Diff2D(0,1);
117 for(y=1; y<h-1; ++y, ++is.y, ++
id.y)
119 if(isLocalExtremum(is, sa, neighborhood, threshold, compare,
124 is = sul + Diff2D(w-1,1);
125 id = dul + Diff2D(w-1,1);
127 for(y=1; y<h-1; ++y, ++is.y, ++
id.y)
129 if(isLocalExtremum(is, sa, neighborhood, threshold, compare,
134 is = sul + Diff2D(0,h-1);
135 id = dul + Diff2D(0,h-1);
137 for(x=0; x<w; ++x, ++is.x, ++
id.x)
139 if(isLocalExtremum(is, sa, neighborhood, threshold, compare,
150 for(y=0; y<h; ++y, ++sul.y, ++dul.y)
152 SrcIterator sx = sul;
153 DestIterator dx = dul;
155 for(x=0; x<w; ++x, ++sx.x, ++dx.x)
157 typename SrcAccessor::value_type v = sa(sx);
159 if(!compare(v, threshold))
163 NeighborhoodCirculator<SrcIterator, Neighborhood> sc(sx);
164 for(i = 0; i < Neighborhood::DirectionCount; ++i, ++sc)
166 if(!compare(v, sa(sc)))
170 if(i == Neighborhood::DirectionCount)
176template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
177 class DestIterator,
class DestAccessor,
class DestValue,
178 class Neighborhood,
class Compare>
180localMinMax3D(SrcIterator sul, SrcShape shp, SrcAccessor sa,
181 DestIterator dul, DestAccessor da,
184 typename SrcAccessor::value_type threshold,
186 bool allowExtremaAtBorder =
false)
194 if (allowExtremaAtBorder)
196 throw std::runtime_error(
"Not implemented (use localMinima() or localMaxima() instead).");
207 SrcIterator zs = sul;
208 DestIterator zd = dul;
210 for (z = 0; z != d; ++z, ++zs.dim2(), ++zd.dim2())
215 for (y = 0; y != h; ++y, ++ys.dim1(), ++yd.dim1())
220 for (x = 0; x != w; ++x, ++xs.dim0(), ++xd.dim0())
223 typename SrcAccessor::value_type v = sa(xs);
224 if (!compare(v, threshold))
228 NeighborhoodCirculator<SrcIterator, Neighborhood> sc(xs);
229 for (i = 0; i < Neighborhood::DirectionCount; ++i, ++sc)
231 if(!compare(v, sa(sc)))
235 if(i == Neighborhood::DirectionCount)
242template <
class SrcIterator,
class SrcAccessor,
243 class DestIterator,
class DestAccessor,
class DestValue,
244 class Neighborhood,
class Compare,
class Equal>
246extendedLocalMinMax(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
247 DestIterator dul, DestAccessor da, DestValue marker,
249 Compare compare, Equal equal,
250 typename SrcAccessor::value_type threshold,
251 bool allowExtremaAtBorder =
false)
253 typedef typename SrcAccessor::value_type SrcType;
255 int w = slr.x - sul.x;
256 int h = slr.y - sul.y;
260 BasicImage<int> labels(w,h);
262 int number_of_regions =
263 labelImage(sul, slr, sa, labels.upperLeft(), labels.accessor(),
264 (Neighborhood::DirectionCount == 8), equal);
267 std::vector<unsigned char> isExtremum(number_of_regions+1, (
unsigned char)1);
271 for(y=0; y<h; ++y, ++sul.y, ++ly.y)
273 SrcIterator sx = sul;
276 for(x=0; x<w; ++x, ++sx.x, ++lx.x)
281 if(isExtremum[lab] == 0)
284 if(!compare(v, threshold))
294 NeighborhoodCirculator<SrcIterator, Neighborhood> sc(sx);
295 NeighborhoodCirculator<BasicImage<int>::traverser, Neighborhood> lc(lx);
296 for(i=0; i<Neighborhood::DirectionCount; ++i, ++sc, ++lc)
298 if(lab != *lc && compare(sa(sc),v))
307 if(allowExtremaAtBorder)
309 RestrictedNeighborhoodCirculator<SrcIterator, Neighborhood>
310 sc(sx, atBorder), scend(sc);
313 if(lab != *(lx+sc.diff()) && compare(sa(sc),v))
319 while(++sc != scend);
329 ly = labels.upperLeft();
330 for(y=0; y<h; ++y, ++dul.y, ++ly.y)
332 DestIterator xd = dul;
335 for(x=0; x<w; ++x, ++xd.x, ++lx.x)
343template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
344 class DestIterator,
class DestAccessor,
class DestValue,
345 class Neighborhood,
class Compare,
class Equal>
347extendedLocalMinMax3D(SrcIterator sul, SrcShape shp, SrcAccessor sa,
348 DestIterator dul, DestAccessor da,
350 Neighborhood neighbourhood,
353 typename SrcAccessor::value_type threshold,
354 bool allowExtremaAtBorder =
false)
356 typedef typename SrcAccessor::value_type SrcType;
364 MultiArray<3, int> labels(shp);
366 int number_of_regions =
367 labelVolume(sul, shp, sa, labels.traverser_begin(),
368 typename AccessorTraits<int>::default_accessor(),
373 SrcIterator zs = sul;
374 DestIterator zd = dul;
377 std::vector<unsigned char> isExtremum(number_of_regions + 1, (
unsigned char)1);
379 for (z = 0; z != d; ++z, ++zs.dim2(), ++zd.dim2(), ++zl.dim2())
385 for (y = 0; y != h; ++y, ++ys.dim1(), ++yd.dim1(), ++yl.dim1())
391 for (x = 0; x != w; ++x, ++xs.dim0(), ++xd.dim0(), ++xl.dim0())
397 if (isExtremum[lab] == 0)
400 if (!compare(v, threshold))
410 NeighborhoodCirculator<SrcIterator, Neighborhood> sc(xs);
411 NeighborhoodCirculator<MultiArray<3, int>::traverser, Neighborhood> lc(xl);
412 for (i = 0; i < Neighborhood::DirectionCount; ++i, ++sc, ++lc)
414 if (lab != *lc && compare(sa(sc), v))
424 if (allowExtremaAtBorder)
426 RestrictedNeighborhoodCirculator<SrcIterator, Neighborhood>
427 sc(xs, atBorder), scend(sc);
430 if (lab != *(xl + sc.diff()) && compare(sa(sc), v))
436 while (++sc != scend);
447 zl = labels.traverser_begin();
451 for (z = 0; z != d; ++z, ++zs.dim2(), ++zd.dim2(), ++zl.dim2())
457 for (y = 0; y != h; ++y, ++ys.dim1(), ++yd.dim1(), ++yl.dim1())
463 for (x = 0; x != w; ++x, ++xs.dim0(), ++xd.dim0(), ++xl.dim0())
496 double marker, thresh;
498 bool use_threshold, allow_at_border, allow_plateaus;
509 use_threshold(false),
510 allow_at_border(false),
511 allow_plateaus(false)
556 use_threshold =
true;
716template <
class SrcIterator,
class SrcAccessor,
717 class DestIterator,
class DestAccessor>
719localMinima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
720 DestIterator dul, DestAccessor da,
723 typedef typename SrcAccessor::value_type SrcType;
724 typedef typename DestAccessor::value_type DestType;
726 SrcType threshold = options.use_threshold
727 ? std::min(NumericTraits<SrcType>::max(), (SrcType)options.thresh)
728 : NumericTraits<SrcType>::max();
729 DestType marker = (DestType)options.marker;
731 if(options.allow_plateaus)
733 if(options.neigh == 0 || options.neigh == 4)
735 detail::extendedLocalMinMax(sul, slr, sa, dul, da, marker,
FourNeighborCode(),
736 std::less<SrcType>(), std::equal_to<SrcType>(),
737 threshold, options.allow_at_border);
739 else if(options.neigh == 1 || options.neigh == 8)
742 std::less<SrcType>(), std::equal_to<SrcType>(),
743 threshold, options.allow_at_border);
746 vigra_precondition(
false,
"localMinima(): neighborhood must be 4 or 8.");
751 if(options.neigh == 0 || options.neigh == 4)
754 threshold, std::less<SrcType>(), options.allow_at_border);
756 else if(options.neigh == 1 || options.neigh == 8)
759 threshold, std::less<SrcType>(), options.allow_at_border);
762 vigra_precondition(
false,
"localMinima(): neighborhood must be 4 or 8.");
766template <
class SrcIterator,
class SrcAccessor,
767 class DestIterator,
class DestAccessor,
770localMinima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
771 DestIterator dul, DestAccessor da,
774 detail::localMinMax(sul, slr, sa, dul, da, marker, neighborhood,
775 NumericTraits<typename SrcAccessor::value_type>::max(),
776 std::less<typename SrcAccessor::value_type>());
779template <
class SrcIterator,
class SrcAccessor,
780 class DestIterator,
class DestAccessor,
783localMinima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
784 DestIterator dul, DestAccessor da,
787 detail::localMinMax(sul, slr, sa, dul, da, marker, neighborhood,
788 NumericTraits<typename SrcAccessor::value_type>::max(),
789 std::less<typename SrcAccessor::value_type>());
792template <
class SrcIterator,
class SrcAccessor,
793 class DestIterator,
class DestAccessor,
class DestValue>
795localMinima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
796 DestIterator dul, DestAccessor da,
802template <
class SrcIterator,
class SrcAccessor,
803 class DestIterator,
class DestAccessor,
806localMinima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
807 pair<DestIterator, DestAccessor> dest,
811 dest.first, dest.second, marker, neighborhood);
814template <
class SrcIterator,
class SrcAccessor,
815 class DestIterator,
class DestAccessor,
818localMinima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
819 pair<DestIterator, DestAccessor> dest,
823 dest.first, dest.second, marker, neighborhood);
826template <
class SrcIterator,
class SrcAccessor,
827 class DestIterator,
class DestAccessor,
class DestValue>
829localMinima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
830 pair<DestIterator, DestAccessor> dest,
837template <
class SrcIterator,
class SrcAccessor,
838 class DestIterator,
class DestAccessor>
840localMinima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
841 pair<DestIterator, DestAccessor> dest,
842 LocalMinmaxOptions
const & options = LocalMinmaxOptions())
845 dest.first, dest.second, options);
863template<
class SrcIterator,
class SrcAccessor,
class SrcShape,
864 class DestIterator,
class DestAccessor,
class DestValue>
867 DestIterator dul, DestAccessor da,
871 detail::localMinMax3D(sul, slr, sa, dul, da, marker, neighborhood,
872 NumericTraits<typename SrcAccessor::value_type>::max(),
873 std::less<typename SrcAccessor::value_type>());
876template<
class SrcIterator,
class SrcAccessor,
class SrcShape,
877 class DestIterator,
class DestAccessor,
class DestValue>
880 DestIterator dul, DestAccessor da,
884 detail::localMinMax3D(sul, slr, sa, dul, da, marker, neighborhood,
885 NumericTraits<typename SrcAccessor::value_type>::max(),
886 std::less<typename SrcAccessor::value_type>());
889template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
890 class DestIterator,
class DestAccessor,
class DestValue>
893 DestIterator dul, DestAccessor da,
899template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
900 class DestIterator,
class DestAccessor,
class DestValue>
903 pair<DestIterator, DestAccessor> dest,
907 localMinima3D(src.first, src.second, src.third, dest.first, dest.second,
908 marker, neighborhood);
911template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
912 class DestIterator,
class DestAccessor,
class DestValue>
915 pair<DestIterator, DestAccessor> dest,
919 localMinima3D(src.first, src.second, src.third, dest.first, dest.second,
920 marker, neighborhood);
923template<
class T1,
class S1,
929 MultiArrayView<3, T2, S2> dest,
931 Neighborhood neighborhood)
934 marker, neighborhood);
937template<
class T1,
class S1,
942 MultiArrayView<2, T2, S2> dest,
1081template <
class SrcIterator,
class SrcAccessor,
1082 class DestIterator,
class DestAccessor>
1084localMaxima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
1085 DestIterator dul, DestAccessor da,
1088 typedef typename SrcAccessor::value_type SrcType;
1089 typedef typename DestAccessor::value_type DestType;
1091 SrcType threshold = options.use_threshold
1092 ? std::max(NumericTraits<SrcType>::min(), (SrcType)options.thresh)
1093 : NumericTraits<SrcType>::min();
1094 DestType marker = (DestType)options.marker;
1096 if(options.allow_plateaus)
1098 if(options.neigh == 0 || options.neigh == 4)
1100 detail::extendedLocalMinMax(sul, slr, sa, dul, da, marker,
FourNeighborCode(),
1101 std::greater<SrcType>(), std::equal_to<SrcType>(),
1102 threshold, options.allow_at_border);
1104 else if(options.neigh == 1 || options.neigh == 8)
1107 std::greater<SrcType>(), std::equal_to<SrcType>(),
1108 threshold, options.allow_at_border);
1111 vigra_precondition(
false,
"localMaxima(): neighborhood must be 4 or 8.");
1115 if(options.neigh == 0 || options.neigh == 4)
1118 threshold, std::greater<SrcType>(), options.allow_at_border);
1120 else if(options.neigh == 1 || options.neigh == 8)
1123 threshold, std::greater<SrcType>(), options.allow_at_border);
1126 vigra_precondition(
false,
"localMaxima(): neighborhood must be 4 or 8.");
1130template <
class SrcIterator,
class SrcAccessor,
1131 class DestIterator,
class DestAccessor,
1134localMaxima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
1135 DestIterator dul, DestAccessor da,
1138 detail::localMinMax(sul, slr, sa, dul, da, marker, neighborhood,
1139 NumericTraits<typename SrcAccessor::value_type>::min(),
1140 std::greater<typename SrcAccessor::value_type>());
1143template <
class SrcIterator,
class SrcAccessor,
1144 class DestIterator,
class DestAccessor,
1147localMaxima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
1148 DestIterator dul, DestAccessor da,
1151 detail::localMinMax(sul, slr, sa, dul, da, marker, neighborhood,
1152 NumericTraits<typename SrcAccessor::value_type>::min(),
1153 std::greater<typename SrcAccessor::value_type>());
1156template <
class SrcIterator,
class SrcAccessor,
1157 class DestIterator,
class DestAccessor,
class DestValue>
1159localMaxima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
1160 DestIterator dul, DestAccessor da,
1166template <
class SrcIterator,
class SrcAccessor,
1167 class DestIterator,
class DestAccessor,
1170localMaxima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
1171 pair<DestIterator, DestAccessor> dest,
1175 dest.first, dest.second, marker, neighborhood);
1178template <
class SrcIterator,
class SrcAccessor,
1179 class DestIterator,
class DestAccessor,
1182localMaxima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
1183 pair<DestIterator, DestAccessor> dest,
1187 dest.first, dest.second, marker, neighborhood);
1190template <
class SrcIterator,
class SrcAccessor,
1191 class DestIterator,
class DestAccessor,
class DestValue>
1193localMaxima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
1194 pair<DestIterator, DestAccessor> dest,
1201template <
class SrcIterator,
class SrcAccessor,
1202 class DestIterator,
class DestAccessor>
1204localMaxima(triple<SrcIterator, SrcIterator, SrcAccessor> src,
1205 pair<DestIterator, DestAccessor> dest,
1206 LocalMinmaxOptions
const & options = LocalMinmaxOptions())
1209 dest.first, dest.second, options);
1226template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1227 class DestIterator,
class DestAccessor,
class DestValue>
1230 DestIterator dul, DestAccessor da,
1234 detail::localMinMax3D(sul, slr, sa, dul, da, marker, neighborhood,
1235 NumericTraits<typename SrcAccessor::value_type>::min(),
1236 std::greater<typename SrcAccessor::value_type>());
1239template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1240 class DestIterator,
class DestAccessor,
class DestValue>
1243 DestIterator dul, DestAccessor da,
1247 detail::localMinMax3D(sul, slr, sa, dul, da, marker, neighborhood,
1248 NumericTraits<typename SrcAccessor::value_type>::min(),
1249 std::greater<typename SrcAccessor::value_type>());
1252template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1253 class DestIterator,
class DestAccessor,
class DestValue>
1255localMaxima3D(triple<SrcIterator, SrcShape, SrcAccessor> src,
1256 pair<DestIterator, DestAccessor> dest,
1260 localMaxima3D(src.first, src.second, src.third, dest.first, dest.second,
1261 marker, neighborhood);
1264template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1265 class DestIterator,
class DestAccessor,
class DestValue>
1267localMaxima3D(triple<SrcIterator, SrcShape, SrcAccessor> src,
1268 pair<DestIterator, DestAccessor> dest,
1271 localMaxima3D(src.first, src.second, src.third, dest.first, dest.second,
1275template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1276 class DestIterator,
class DestAccessor,
class DestValue>
1278localMaxima3D(triple<SrcIterator, SrcShape, SrcAccessor> src,
1279 pair<DestIterator, DestAccessor> dest,
1283 localMaxima3D(src.first, src.second, src.third, dest.first, dest.second,
1284 marker, neighborhood);
1287template<
class T1,
class S1,
1293 MultiArrayView<3, T2, S2> dest,
1295 Neighborhood neighborhood)
1297 localMaxima3D(srcMultiArrayRange(src), destMultiArray(dest),
1298 marker, neighborhood);
1301template<
class T1,
class S1,
1306 MultiArrayView<3, T2, S2> dest,
1309 localMaxima3D(srcMultiArrayRange(src), destMultiArray(dest),
1494template <
class SrcIterator,
class SrcAccessor,
1495 class DestIterator,
class DestAccessor,
1496 class Neighborhood,
class EqualityFunctor>
1499 DestIterator dul, DestAccessor da,
1500 typename DestAccessor::value_type marker,
1501 Neighborhood neighborhood, EqualityFunctor equal)
1503 typedef typename SrcAccessor::value_type SrcType;
1505 detail::extendedLocalMinMax(sul, slr, sa, dul, da,
1506 marker, neighborhood,
1507 std::less<SrcType>(), equal,
1508 NumericTraits<typename SrcAccessor::value_type>::max());
1511template <
class SrcIterator,
class SrcAccessor,
1512 class DestIterator,
class DestAccessor,
1516 DestIterator dul, DestAccessor da,
1517 typename DestAccessor::value_type marker,
1518 Neighborhood neighborhood)
1520 typedef typename SrcAccessor::value_type SrcType;
1523 marker, neighborhood, std::equal_to<SrcType>());
1526template <
class SrcIterator,
class SrcAccessor,
1527 class DestIterator,
class DestAccessor>
1530 DestIterator dul, DestAccessor da,
1531 typename DestAccessor::value_type marker)
1537template <
class SrcIterator,
class SrcAccessor,
1538 class DestIterator,
class DestAccessor>
1541 DestIterator dul, DestAccessor da)
1544 NumericTraits<typename DestAccessor::value_type>::one());
1547template <
class SrcIterator,
class SrcAccessor,
1548 class DestIterator,
class DestAccessor,
1549 class Neighborhood,
class EqualityFunctor>
1552 pair<DestIterator, DestAccessor> dest,
1553 typename DestAccessor::value_type marker, Neighborhood neighborhood,
1554 EqualityFunctor equal)
1557 dest.first, dest.second, marker, neighborhood, equal);
1560template <
class SrcIterator,
class SrcAccessor,
1561 class DestIterator,
class DestAccessor,
1565 pair<DestIterator, DestAccessor> dest,
1566 typename DestAccessor::value_type marker, Neighborhood neighborhood)
1569 dest.first, dest.second, marker, neighborhood);
1572template <
class SrcIterator,
class SrcAccessor,
1573 class DestIterator,
class DestAccessor>
1576 pair<DestIterator, DestAccessor> dest,
1577 typename DestAccessor::value_type marker)
1583template <
class SrcIterator,
class SrcAccessor,
1584 class DestIterator,
class DestAccessor>
1587 pair<DestIterator, DestAccessor> dest)
1590 dest.first, dest.second);
1608template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1609 class DestIterator,
class DestAccessor,
class Neighborhood,
1610 class EqualityFunctor>
1613 DestIterator dul, DestAccessor da,
1614 typename DestAccessor::value_type marker,
1615 Neighborhood neighborhood,
1616 EqualityFunctor equal)
1618 typedef typename SrcAccessor::value_type SrcType;
1620 detail::extendedLocalMinMax3D(sul, slr, sa, dul, da, marker, neighborhood,
1621 std::less<SrcType>(), equal,
1622 NumericTraits<typename SrcAccessor::value_type>::max());
1625template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1626 class DestIterator,
class DestAccessor,
class Neighborhood>
1629 DestIterator dul, DestAccessor da,
1630 typename DestAccessor::value_type marker,
1631 Neighborhood neighborhood)
1633 typedef typename SrcAccessor::value_type SrcType;
1636 std::equal_to<SrcType>());
1639template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1640 class DestIterator,
class DestAccessor>
1643 DestIterator dul, DestAccessor da)
1646 NumericTraits<typename DestAccessor::value_type>::one(),
1650template<
class SrcIterator,
class SrcAccessor,
class SrcShape,
1651 class DestIterator,
class DestAccessor,
class Neighborhood>
1654 pair<DestIterator, DestAccessor> dest,
1655 typename DestAccessor::value_type marker,
1656 Neighborhood neighborhood)
1659 dest.first, dest.second,
1660 marker, neighborhood);
1842template <
class SrcIterator,
class SrcAccessor,
1843 class DestIterator,
class DestAccessor,
1844 class Neighborhood,
class EqualityFunctor>
1847 DestIterator dul, DestAccessor da,
1848 typename DestAccessor::value_type marker,
1849 Neighborhood neighborhood, EqualityFunctor equal)
1851 typedef typename SrcAccessor::value_type SrcType;
1853 detail::extendedLocalMinMax(sul, slr, sa, dul, da,
1854 marker, neighborhood,
1855 std::greater<SrcType>(), equal,
1856 NumericTraits<typename SrcAccessor::value_type>::min());
1859template <
class SrcIterator,
class SrcAccessor,
1860 class DestIterator,
class DestAccessor,
1864 DestIterator dul, DestAccessor da,
1865 typename DestAccessor::value_type marker,
1866 Neighborhood neighborhood)
1868 typedef typename SrcAccessor::value_type SrcType;
1871 marker, neighborhood, std::equal_to<SrcType>());
1874template <
class SrcIterator,
class SrcAccessor,
1875 class DestIterator,
class DestAccessor>
1878 DestIterator dul, DestAccessor da,
1879 typename DestAccessor::value_type marker)
1885template <
class SrcIterator,
class SrcAccessor,
1886 class DestIterator,
class DestAccessor>
1889 DestIterator dul, DestAccessor da)
1892 NumericTraits<typename DestAccessor::value_type>::one());
1895template <
class SrcIterator,
class SrcAccessor,
1896 class DestIterator,
class DestAccessor,
1897 class Neighborhood,
class EqualityFunctor>
1900 pair<DestIterator, DestAccessor> dest,
1901 typename DestAccessor::value_type marker, Neighborhood neighborhood,
1902 EqualityFunctor equal)
1905 dest.first, dest.second, marker, neighborhood, equal);
1908template <
class SrcIterator,
class SrcAccessor,
1909 class DestIterator,
class DestAccessor,
1913 pair<DestIterator, DestAccessor> dest,
1914 typename DestAccessor::value_type marker, Neighborhood neighborhood)
1917 dest.first, dest.second, marker, neighborhood);
1920template <
class SrcIterator,
class SrcAccessor,
1921 class DestIterator,
class DestAccessor>
1924 pair<DestIterator, DestAccessor> dest,
1925 typename DestAccessor::value_type marker)
1931template <
class SrcIterator,
class SrcAccessor,
1932 class DestIterator,
class DestAccessor>
1935 pair<DestIterator, DestAccessor> dest)
1938 dest.first, dest.second);
1954template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1955 class DestIterator,
class DestAccessor,
class Neighborhood,
1956 class EqualityFunctor>
1959 DestIterator dul, DestAccessor da,
1960 typename DestAccessor::value_type marker,
1961 Neighborhood neighborhood,
1962 EqualityFunctor equal)
1964 typedef typename SrcAccessor::value_type SrcType;
1966 detail::extendedLocalMinMax3D(sul, slr, sa, dul, da, marker, neighborhood,
1967 std::greater<SrcType>(), equal,
1968 NumericTraits<typename SrcAccessor::value_type>::min());
1971template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1972 class DestIterator,
class DestAccessor,
class Neighborhood>
1975 DestIterator dul, DestAccessor da,
1976 typename DestAccessor::value_type marker,
1977 Neighborhood neighborhood)
1979 typedef typename SrcAccessor::value_type SrcType;
1982 marker, neighborhood,
1983 std::equal_to<SrcType>());
1986template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1987 class DestIterator,
class DestAccessor>
1990 DestIterator dul, DestAccessor da)
1993 NumericTraits<typename DestAccessor::value_type>::one(),
1997template<
class SrcIterator,
class SrcShape,
class SrcAccessor,
1998 class DestIterator,
class DestAccessor,
class Neighborhood>
2001 pair<DestIterator, DestAccessor> dest,
2002 typename DestAccessor::value_type marker,
2003 Neighborhood neighborhood)
2006 dest.first, dest.second,
2007 marker, neighborhood);
BasicImageIterator< PIXELTYPE, PIXELTYPE ** > traverser
Definition basicimage.hxx:528
BasicImageIterator< PIXELTYPE, PIXELTYPE ** > Iterator
Definition basicimage.hxx:532
Options object for localMinima() and localMaxima().
Definition localminmax.hxx:494
LocalMinmaxOptions()
Construct default options object.
Definition localminmax.hxx:505
LocalMinmaxOptions & allowAtBorder(bool f=true)
Detect extrema at the image border.
Definition localminmax.hxx:565
LocalMinmaxOptions & threshold(double t)
Threshold the extrema.
Definition localminmax.hxx:554
LocalMinmaxOptions & markWith(double m)
Mark extrema in the destination image with the given value.
Definition localminmax.hxx:541
LocalMinmaxOptions & neighborhood(unsigned int n)
Use the given neighborhood.
Definition localminmax.hxx:525
LocalMinmaxOptions & allowPlateaus(bool f=true)
Allow extremal plateaus.
Definition localminmax.hxx:578
view_type::traverser traverser
Definition multi_array.hxx:2532
Encapsulation of direction management of neighbors for a 3D 6-neighborhood.
Definition voxelneighborhood.hxx:164
Encapsulation of direction management of neighbors for a 3D 26-neighborhood.
Definition voxelneighborhood.hxx:504
EightNeighborhood::NeighborCode EightNeighborCode
Definition pixelneighborhood.hxx:687
void localMaxima3D(...)
Find local maxima in a 3D multi array.
void extendedLocalMaxima(...)
Find local maximal regions in an array.
unsigned int labelVolume(...)
Find the connected components of a segmented volume.
AtImageBorder AtVolumeBorder
Encode whether a voxel is near the volume border.
Definition voxelneighborhood.hxx:72
FourNeighborhood::NeighborCode FourNeighborCode
Definition pixelneighborhood.hxx:379
void extendedLocalMinima3D(...)
Find local minimal regions in a volume.
AtImageBorder
Encode whether a point is near the image border.
Definition pixelneighborhood.hxx:69
@ NotAtBorder
 
Definition pixelneighborhood.hxx:70
AtVolumeBorder isAtVolumeBorder(int x, int y, int z, int width, int height, int depth)
Find out whether a voxel is at the volume border.
Definition voxelneighborhood.hxx:82
unsigned int labelImage(...)
Find the connected components of a segmented image.
Neighborhood3DTwentySix::NeighborCode3D NeighborCode3DTwentySix
Definition voxelneighborhood.hxx:1646
void localMinima3D(...)
Find local minima in a 3D multi array.
NeighborhoodType
Choose the neighborhood system in a dimension-independent way.
Definition multi_fwd.hxx:186
void localMinima(...)
Find local minima in an image or multi-dimensional array.
Neighborhood3DSix::NeighborCode3D NeighborCode3DSix
Definition voxelneighborhood.hxx:490
void extendedLocalMinima(...)
Find local minimal regions (plateaus) in an array.
void localMaxima(...)
Find local maxima in an image or multi-dimensional array.
vigra::TinyVector< int, 3 > Diff3D
3-dimensional difference vector
Definition voxelneighborhood.hxx:55
AtImageBorder isAtImageBorder(int x, int y, int width, int height)
Find out whether a point is at the image border.
Definition pixelneighborhood.hxx:111
void extendedLocalMaxima3D(...)
Find local maximal regions in 3D multi array.