MeVisLab Scripting Reference
|
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 (https://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 |
Returns 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 |
||
) |
Copies the given image into this image, using the region that 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 |
Returns the ML data type of the subimage.
const char* PySubImage::dataTypeName | ( | ) | const |
Returns the ML data type name of the subimage.
ml::ImageVector PySubImage::extent | ( | ) | const |
Returns the extent of the subimage in (x,y,z,c,t,u) order.
void PySubImage::fillInvalidRegionWithBorderValues | ( | ) |
Fills 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 | ) |
Fills 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 whether the image has an invalid region.
ml::ImageVector PySubImage::imageExtent | ( | ) | const |
Returns the extent of the subimage in (x,y,z,c,t,u) order.
ml::ImageVector PySubImage::origin | ( | ) | const |
Returns 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 |
Sets the origin of the subimage relative to its source image in (x,y,z,c,t,u) order.
ml::ImageVector PySubImage::sourceImageExtent | ( | ) | const |
Returns 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 |
Returns 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 |
Returns the valid region of the subimage (which means clipping agains the source image extent).