1 #ifndef TIL_RF4_TOOLS_H 2 #define TIL_RF4_TOOLS_H 23 template <
typename TImage,
typename TLineFilter >
25 (
const TImage &im, TImage &out,
ImageAxis axis,
const TLineFilter &filter)
27 typedef typename TImage::value_type value_type;
29 int barLength = im.dim()[axis];
31 std::vector<value_type> barIn(barLength);
32 std::vector<value_type> barOut(barLength);
35 for (p[0]=0; p[0]<(axis==
X_AXIS?1:im.dim()[0]); ++p[0])
37 for (p[1]=0; p[1]<(axis==
Y_AXIS?1:im.dim()[1]); ++p[1])
39 for (p[2]=0; p[2]<(axis==
Z_AXIS?1:im.dim()[2]); ++p[2])
42 filter.apply(barIn, barOut);
Belongs to package Box Do not include directly, include til/Box.h instead.
General macros, definitions and functions.
void extractBar(const TImage &im, const numeric_array< int, 3 > &pos, ImageAxis axis, std::vector< typename TImage::value_type > &bar)
Extract the line starting from (x,y,z) in the direction of axis from im to bar.
void filterAlongAxis(const TImage &im, TImage &out, ImageAxis axis, const TLineFilter &filter)
void insertBar(TImage &im, const numeric_array< int, 3 > &pos, ImageAxis axis, const std::vector< typename TImage::value_type > &bar)
Insert the line starting from (x,y,z) in the direction of axis from bar to im.