1 #ifndef TIL_IF_THEN_ELSE_H 2 #define TIL_IF_THEN_ELSE_H 23 template <
class TImage1,
class TImage2,
class PixelTest,
class PixelAction1,
class PixelAction2 >
26 const PixelTest &test,
27 PixelAction1 &actionIf,
28 PixelAction2 &actionElse)
32 for (; !iIn.isAtEnd(); ++iIn, ++iOut, test.next(), actionIf.next(), actionElse.next())
34 if (test.compute(iIn))
40 actionElse.apply(iOut);
46 template <
class TImage,
class PixelTest,
class PixelAction1,
class PixelAction2 >
48 const PixelTest &test,
49 PixelAction1 &actionIf,
50 PixelAction2 &actionElse)
53 for (; !iIm.isAtEnd(); ++iIm, test.next(), actionIf.next(), actionElse.next())
55 if (test.compute(iIm))
61 actionElse.apply(iIm);
68 template <
class TImage1,
class TImage2,
class PixelTest,
class PixelAction >
71 const PixelTest &test,
76 for (; !iIn.isAtEnd(); ++iIn, ++iOut, test.next(), action.next())
78 if (test.compute(iIn))
86 template <
class TImage,
class PixelTest,
class PixelAction >
88 const PixelTest &test,
92 for (; !iIm.isAtEnd(); ++iIm, test.next(), action.next())
94 if (test.compute(iIm))
101 template <
class TImage,
class PixelTest,
class PixelAction >
103 const PixelTest &test,
108 if ((im.dim()[0] < 3) ||
118 Range<int,3> range(1,1,1,im.dim()[0]-2,im.dim()[1]-2,im.dim()[2]-2);
121 for (; !iIm.isAtEnd(); ++iIm, test.next(), action.next())
123 if (test.compute(iIm))
A trait class to assign iterators to image types.
void if_then(const TImage1 &in, TImage2 &out, const PixelTest &test, PixelAction &action)
Belongs to package Box Do not include directly, include til/Box.h instead.
void if_then_inInterior(TImage &im, const PixelTest &test, PixelAction &action)
void if_then_else_old(const TImage1 &in, TImage2 &out, const PixelTest &test, PixelAction1 &actionIf, PixelAction2 &actionElse)
General macros, definitions and functions.