PySubImage Class Reference

Allows access to the data of an ML subimage. More...

List of all members.

Public Member Functions

Property read access
ml::SubImageBox box () const
void copySubImage (ml::SubImage *image, double scale=1., double shift=0, ml::ImageVector offset=ml::ImageVector(0))
MLDataType dataType () const
const char * dataTypeName () const
ml::Vector6 extent () const
void fillInvalidRegionWithBorderValues ()
void fillInvalidRegionWithValue (double value)
bool hasInvalidRegion () const
ml::Vector6 imageExtent () const
ml::Vector6 origin () const
ml::Vector6 sourceImageExtent () const
ml::Vector6 validExtent () const
ml::SubImageBox validRegion () const


Detailed Description

Allows access to the data of an ML subimage.

This is a Python class that is derived from NumPy's ndarray (http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html) and offers all properties of ndarray in addition to the listed methods. NOTE: ML subimages/pages are typically 6 dimensional and NumPy handles the dimensions in a different ordering than the ML convention. So if you use indexing in NumPy, keep in mind that you have to either do ndarray.squeeze() to get rid of the dimensions that are 1 or you need to write N leading zeros to fill up all 6 dimensions. All methods lsited below expect/return (x,y,z,c,t,u) order using the ML convention, while NumPy methods like ndarray.shape will return (u,t,c,z,y,x).


Member Function Documentation

ml::SubImageBox PySubImage::box (  )  const

get the box of the subimage (composed of [origin, origin+extent-1]

void PySubImage::copySubImage ( ml::SubImage *  image,
double  scale = 1.,
double  shift = 0,
ml::ImageVector  offset = ml::ImageVector(0) 
)

copy the given image into this image, using the region which intersects, optionally scaling/shifting the data.

The given offset can be used to translate the copied image. All arguments are available as Python keyword arguments, so you can for example do:

 image.copySubImage(other, offset=(24,24,0,0,0,0))

MLDataType PySubImage::dataType (  )  const

get the ML datatype of the subimage

const char* PySubImage::dataTypeName (  )  const

get the ML datatype name of the subimage

ml::Vector6 PySubImage::extent (  )  const

get the extent of the subimage in (x,y,z,c,t,u) order

void PySubImage::fillInvalidRegionWithBorderValues (  ) 

Fill the invalid region of a page with border image values (this filles everything outside of validRegion() and does nothing if validRegion()==box()).

void PySubImage::fillInvalidRegionWithValue ( double  value  ) 

Fill the invalid region of a page with clamped image values (this filles everything outside of validRegion() and does nothing if validRegion()==box()).

bool PySubImage::hasInvalidRegion (  )  const

returns if the image has an invalid region

ml::Vector6 PySubImage::imageExtent (  )  const

get the extent of the subimage in (x,y,z,c,t,u) order

ml::Vector6 PySubImage::origin (  )  const

get the origin of the subimage relative to its source image in (x,y,z,c,t,u) order

ml::Vector6 PySubImage::sourceImageExtent (  )  const

get the extent of the source image that this subimage was created from in (x,y,z,c,t,u) order

ml::Vector6 PySubImage::validExtent (  )  const

get the valid extent of the subimage (which means clipping agains the source image extent) in (x,y,z,c,t,u) order

ml::SubImageBox PySubImage::validRegion (  )  const

get the valid region of the subimage (which means clipping agains the source image extent)


Generated on Sat Sep 3 18:38:03 2011 for MeVisLab Scripting Reference by  doxygen 1.5.8