MeVisLab Toolbox Reference
mlTSubImage.h File Reference
#include "mlInitSystemML.h"
#include "mlSubImage.h"
#include "mlTypeTraits.h"
#include "mlTemplateSupport.h"

Go to the source code of this file.

Classes

class  ml::TSubImage< DATATYPE >
 This template class manages/represents a rectangular 6d image region in memory which is organized linearly. More...
 
class  ml::TSubImageCursorBase< DATATYPE >
 Base class for all TSubImage Cursors. More...
 
class  ml::ConstTSubImageCursor< DATATYPE >
 Predeclaration for const cursor. More...
 
class  ml::TSubImageCursor< DATATYPE >
 Predeclaration for cursor. More...
 
class  ml::TSubImageWithCursor< DATATYPE >
 A class that offers a TSubImage with a TSubImageCursor. More...
 

Namespaces

 ml
 Main documentation file for ML users and developers.
 

Macros

#define _ML_TSUBIMG_SUBDOT6(pos, offset, stride)
 Private helper macro for calculation of memory offset, calculates (pos-offset) * stride. More...
 
#define _ML_TSUBIMG_SUBDOT3(x, y, z, offset, stride)
 Private helper macro for calculation of memory offset, calculates ((xyz)-offset) * stride. More...
 
#define _ML_TSUBIMG_SUBDOT2(x, y, offset, stride)
 Private helper macro for calculation of memory offset, calculates ((xy)-offset) * stride. More...
 
Copying voxel from one subimage to another
#define _ML_CHECK_SUBIMAGE_DATA_POINTERS(FROM_PTR, TO_PTR)
 Internal helper macro to check validity of data pointers of subimages. More...
 

Functions

template<typename T >
TSubImage< T > * ml::tsubimg_cast (SubImage *subImg)
 
template<typename T >
const TSubImage< T > * ml::tsubimg_cast (const SubImage *subImg)
 
template<typename T >
TSubImage< T > & ml::tsubimg_cast (SubImage &subImg)
 
template<typename T >
const TSubImage< T > & ml::tsubimg_cast (const SubImage &subImg)
 
template<typename DATATYPE >
ostream & std::operator<< (ostream &ostr, const ml::TSubImage< DATATYPE > &v)
 Implement print of subimage into std::ostream. More...
 
Casting of SubImage to TSubImage<T>

The tsubimage_cast allows to cast a SubImage (pointer or reference) to a typed TSubImage<T> (pointer or reference).

If the cast is not possible because the datatype of the SubImage does not match the T of tsubimage_cast<T>, a fatal ML error occurs.

Usage:

TSubImage<MLfloat>& tsubimg = tsubimage_cast<MLfloat>(subimg);
template<typename T >
TSubImage< T > & ml::tsubimage_cast (SubImage &subImg)
 
template<typename T >
const TSubImage< T > & ml::tsubimage_cast (const SubImage &subImg)
 
template<typename T >
TSubImage< T > * ml::tsubimage_cast (SubImage *subImg)
 
template<typename T >
const TSubImage< T > * ml::tsubimage_cast (const SubImage *subImg)
 

Macro Definition Documentation

◆ _ML_CHECK_SUBIMAGE_DATA_POINTERS

#define _ML_CHECK_SUBIMAGE_DATA_POINTERS (   FROM_PTR,
  TO_PTR 
)
Value:
/* Check for valid data pointers to avoid memory access errors. */ \
{ \
if (!FROM_PTR || !TO_PTR){ \
ML_PRINT_ERROR("TSubImage::copySubImageTyped( )", \
"Valid data pointers in source and target subimage required for" \
"subimage copying, thus call is ignored."); \
return; \
} \
}
#define ML_BAD_POINTER_OR_0
A pointer is NULL or a value is NULL or 0 where it should not be; this sometimes indicates a memory a...
Definition: mlTypeDefs.h:1035

Internal helper macro to check validity of data pointers of subimages.

Definition at line 482 of file mlTSubImage.h.

◆ _ML_TSUBIMG_SUBDOT2

#define _ML_TSUBIMG_SUBDOT2 (   x,
  y,
  offset,
  stride 
)
Value:
(((x) - (offset).x) * (stride).x + \
((y) - (offset).y) * (stride).y)

Private helper macro for calculation of memory offset, calculates ((xy)-offset) * stride.

Definition at line 59 of file mlTSubImage.h.

◆ _ML_TSUBIMG_SUBDOT3

#define _ML_TSUBIMG_SUBDOT3 (   x,
  y,
  z,
  offset,
  stride 
)
Value:
(((x) - (offset).x) * (stride).x + \
((y) - (offset).y) * (stride).y + \
((z) - (offset).z) * (stride).z)

Private helper macro for calculation of memory offset, calculates ((xyz)-offset) * stride.

Definition at line 53 of file mlTSubImage.h.

◆ _ML_TSUBIMG_SUBDOT6

#define _ML_TSUBIMG_SUBDOT6 (   pos,
  offset,
  stride 
)
Value:
(((pos).x - (offset).x) * (stride).x + \
((pos).y - (offset).y) * (stride).y + \
((pos).z - (offset).z) * (stride).z + \
((pos).c - (offset).c) * (stride).c + \
((pos).t - (offset).t) * (stride).t + \
((pos).u - (offset).u) * (stride).u)

Private helper macro for calculation of memory offset, calculates (pos-offset) * stride.

Definition at line 44 of file mlTSubImage.h.

Function Documentation

◆ operator<<()

template<typename DATATYPE >
ostream& std::operator<< ( ostream &  ostr,
const ml::TSubImage< DATATYPE > &  v 
)
inline

Implement print of subimage into std::ostream.

This must be implemented in std namespace to avoid STL problems.

Definition at line 1602 of file mlTSubImage.h.

References std::operator<<(), and ml::TVector6DBase< CompIntType >::x.