22 #ifndef mia_2d_2dimage_hh
23 #define mia_2d_2dimage_hh
35 #define ATTR_IMAGE_KMEANS_CLASSES "kmeans"
56 typedef std::shared_ptr<C2DImage >
Pointer;
76 virtual C2DImage* clone() const __attribute__((warn_unused_result)) = 0;
116 template <typename T>
186 virtual C2DImage* clone() const __attribute__((warn_unused_result));
189 const_reference operator()(
size_t x,
size_t y)
const {
210 return m_image(l.
x,l.
y);
215 return m_image(l.
x,l.
y);
220 return m_image.begin();
224 const_iterator
end()
const {
225 return m_image.end();
230 return m_image.begin();
235 return m_image.end();
240 return m_image.begin_at(x, y);
245 return m_image.begin_at(x, y);
250 return m_image.begin_range(begin, end);
255 return m_image.end_range(begin, end);
260 return m_image.begin_range(begin, end);
265 return m_image.end_range(begin, end);
275 void get_data_line_x(
size_t y, std::vector<T>& buffer)
const;
278 void get_data_line_y(
size_t x, std::vector<T>& buffer)
const;
281 void put_data_line_x(
size_t y,
const std::vector<T>& buffer);
284 void put_data_line_y(
size_t x,
const std::vector<T>& buffer);
309 template <
typename T,
typename S>
316 cvdebug() << *si++ <<
" expect " << *ri++ <<
"\n";
324 template <
typename S>
325 struct plugin_data_type<
T2DImage<S> > {
365 template <
typename T>
417 typedef __bind_all<T2DImage> Derived;
430 static std::string val2string(
const C2DFVector& value) {
431 std::stringstream sval;
432 sval << value.
x <<
" " << value.
y;
440 static C2DFVector string2val(
const std::string& str) {
441 std::istringstream sval(str);
443 sval >> value.
x >> value.
y;
460 template <
typename O>
468 template <
typename T>
471 copy(image.
begin(), image.
end(), result.begin());
482 return filter(*
this, image);
492 return filter(*
this, *image);
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
TTranslator< C2DFVector > C2DFVectorTranslator
typedef for the C2DFVector to std::string translator
std::map< std::string, C2DImageSeriesGroup > C2DImageGroupedSeries
T2DImage< signed int > C2DSIImage
2D image with signed 32 bit integer values
functor to convert an image with an abitrary pixel type to single floating point pixels ...
Generic string vs. attribute translator singleton.
iterator end()
forwarding function to access the underlying T2DDatafield
std::vector< C2DImageSeries > C2DImageSeriesGroup
functor to copy an image into paointer representation
T2DImage< double > C2DDImage
2D image with double precsion floating point values
base class for all filer type functors.
This is the template version of a 2D image that is used for holding real data.
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
A collection of attributes.
T2DImage< unsigned short > C2DUSImage
2D image with unsigned 16 bit integer values
T2DImage< float > C2DFImage
2D image with single precsion floating point values
static F::result_type filter(const F &f, const B &b)
const_iterator end() const
forwarding function to access the underlying T2DDatafield
EXPORT_2D bool operator==(const C2DImage &a, const C2DImage &b)
bool operator!=(const C2DImage &a, const C2DImage &b)
range_iterator begin_range(const C2DBounds &begin, const C2DBounds &end)
forwarding function to access the specified range of the underlying T2DDatafield
reference operator[](size_t idx)
forwarding function to access the underlying T2DDatafield
T2DImage< signed short > C2DSSImage
2D image with signed 16 bit integer values
iterator begin_at(size_t x, size_t y)
forwarding function to access the underlying T2DDatafield
iterator begin()
forwarding function to access the underlying T2DDatafield
const_range_iterator begin_range(const C2DBounds &begin, const C2DBounds &end) const
forwarding function to access the specified range of the underlying T2DDatafield
T2DImage< unsigned int > C2DUIImage
2D image with unsigned 32 bit integer values
EXPORT_2D C2DFVectorfield get_gradient(const C2DImage &image)
const_iterator begin() const
forwarding function to access the underlying T2DDatafield
std::shared_ptr< C2DImage > Pointer
2D Image pointer type
static const char * data_descr
A class to hold data on a regular 2D grid.
vstream & cvdebug()
Short for debug output in non-debug build output send to this will be ignored.
C2DImage Super
define the super class of this class for generic processing
const_reference operator[](size_t idx) const
forwarding function to access the underlying T2DDatafield
T2DImage< unsigned char > C2DUBImage
2D image with unsigned 8 bit integer values
reference operator()(size_t x, size_t y)
forwarding function to access the underlying T2DDatafield
const_iterator begin_at(size_t x, size_t y) const
forwarding function to access the underlying T2DDatafield
std::shared_ptr< C2DImageSeries > P2DImageSeries
range_iterator end_range(const C2DBounds &begin, const C2DBounds &end)
forwarding function to access the specified range of the underlying T2DDatafield
FConvert2DImageToPixeltypeO< float > FCopy2DImageToFloatRepn
short name for 2DImage to float pixel repn copy functor
const_range_iterator end_range(const C2DBounds &begin, const C2DBounds &end) const
forwarding function to access the specified range of the underlying T2DDatafield
This is the base class for 2D images that can hold generic pixel data.
C2DBounds dimsize_type
a definition of the image dimension type for
T2DImage< bool > C2DBitImage
2D image with binary values
T2DImage< signed char > C2DSBImage
2D image with signed 8 bit integer values
a class to print out the intensity values of two images to compare them
const C2DBounds & get_size() const
::std::vector< T > data_array
type for the flat reprentation of the 2D data field
std::vector< P2DImage > C2DImageSeries
helper type for image series
T2DImage< signed long > C2DSLImage
2D image with signed 64 bit integer values
T2DImage< unsigned long > C2DULImage
2D image with unsigned 64 bit integer values
const_reference operator()(const C2DBounds &l) const
forwarding function to access the underlying T2DDatafield
reference operator()(const C2DBounds &l)
forwarding function to access the underlying T2DDatafield
#define NS_MIA_END
conveniance define to end the mia namespace