MeVisLab Scripting Reference
|
#include <PySubImage.h>
Public Member Functions | |
Property read access | |
| |
ml::ImageVector | origin () const |
void | setOrigin (ml::ImageVector origin) const |
ml::ImageVector | extent () const |
ml::ImageVector | imageExtent () const |
ml::ImageVector | validExtent () const |
ml::SubImageBox | validRegion () const |
bool | hasInvalidRegion () const |
ml::SubImageBox | box () const |
ml::ImageVector | sourceImageExtent () const |
MLDataType | dataType () const |
const char * | dataTypeName () const |
void | copySubImage (ml::SubImage *image, double scale=1., double shift=0, ml::ImageVector offset=ml::ImageVector(0), bool ignoreOrigin=false) |
void | fillInvalidRegionWithBorderValues () |
void | fillInvalidRegionWithValue (double value) |
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 listed 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).
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), | ||
bool | ignoreOrigin = false ) |
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:
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::ImageVector 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::ImageVector PySubImage::imageExtent | ( | ) | const |
get the extent of the subimage in (x,y,z,c,t,u) order
ml::ImageVector PySubImage::origin | ( | ) | const |
get the origin of the subimage relative to its source image in (x,y,z,c,t,u) order
void PySubImage::setOrigin | ( | ml::ImageVector | origin | ) | const |
set the origin of the subimage relative to its source image in (x,y,z,c,t,u) order
ml::ImageVector 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::ImageVector 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)