Class Image (version 0.20)Description: An image to be stored as a layout annotation Images can be put onto the layout canvas as annotations, along with rulers and markers. Images can be monochrome (represent scalar data) as well as color (represent color images). The display of images can be adjusted in various ways, i.e. color mapping (translation of scalar values to colors), geometrical transformations (including rotation by arbitrary angles) and similar. Images are always based on floating point data. The actual data range is not fixed and can be adjusted to the data set (i.e. 0..255 or -1..1). This gives a great flexibility when displaying data which is the result of some measurement or calculation for example. The basic parameters of an image are the width and height of the data set, the width and height of one pixel, the geometrical transformation to be applied, the data range (min_value to max_value) and the data mapping which is described by an own class, ImageDataMapping.
Method Overview
assign( Image other )Description: Assign the contents of another object to self This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.
[const] DBox boxDescription: Get the bounding box of the image
[const] const ref ImageDataMapping data_mappingDescription: Get the data mapping The data mapping describes the transformation of a pixel value (any double value) into pixel data which can be sent to the graphics cards for display. See ImageDataMapping for a more detailed description.
data_mapping=( ImageDataMapping data_mapping )Description: Set the data mapping object The data mapping describes the transformation of a pixel value (any double value) into pixel data which can be sent to the graphics cards for display. See ImageDataMapping for a more detailed description.
destroyDescription: Explicitly destroy the object Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.
[const] bool destroyedDescription: Tell, if the object was destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.
[const] Image dupDescription: Creates a copy of self.
[const] string filenameDescription: Get the name of the file loaded of an empty string if not file is loaded
[const] double get_pixel( unsigned int x, unsigned int y )Description: Accessor to one pixel (monochrome and color) If the component index, x or y value exceeds the image bounds, this method returns 0.0. For monochrome images, the component index is ignored.
[const] double get_pixel( unsigned int, unsigned int, unsigned int )Description: Accessor to one pixel (monochrome and color) If the component index, x or y value exceeds the image bounds, this method returns 0.0. For monochrome images, the component index is ignored.
[const] unsigned int heightDescription: Get the height of the image in pixels
[const] int idDescription: Get the Id The Id is an arbitrary integer that can be used to track the evolution of an image object. The Id is not changed when the object is edited. On initialization, a unique Id is given to the object. The Id cannot be changed. This behaviour has been modified in version 0.20.
[const] bool is_color?Description: Returns true, if the image is a color image
[const] bool is_empty?Description: Returns true, if the image does not contain any data (i.e. is default constructed)
[const] bool is_visible?Description: Gets a flag indicating whether the image object is visible An image object can be made invisible by setting the visible property to false. This method has been introduced in version 0.20.
[const] double max_valueDescription: Set the maximum value See the max_value method for the description of the maximum value property.
max_value=( double v )Description: Get the upper limit of the values in the data set This value determines the upper end of the data mapping (i.e. white value etc.). It does not necessarily correspond to the maximum value of the data set but it must be larger than that.
[const] double min_valueDescription: Get the upper limit of the values in the data set This value determines the upper end of the data mapping (i.e. white value etc.). It does not necessarily correspond to the minimum value of the data set but it must be larger than that.
min_value=( double v )Description: Set the minimum value See min_value for the description of the minimum value property.
[static] Image new( string filename, DCplxTrans trans )Description: Constructor from a image file This constructor creates an image object from a file (which can have any format supported by Qt) and a transformation. The image will originally be put to position 0, 0 (lower left corner) and each pixel will have a size of 1. The transformation describes how to transform this image into micron space.
[static] Image new( string filename )Description: Constructor from a image file This constructor creates an image object from a file (which can have any format supported by Qt) and a unit transformation. The image will originally be put to position 0, 0 (lower left corner) and each pixel will have a size of 1 (micron).
[static] Image new( unsigned int w, unsigned int h, double data[ ] )Description: Constructor for a monochrome image with the given pixel values This constructor creates an image from the given pixel values. The values have to be organized line by line. Each line must consist of "w" values where the first value is the leftmost pixel. Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to the common convention for image data. Initially the pixel width and heigt will be 1 micron and the data range will be 0 to 1.0 (black to white level). To adjust the data range use the min_value and max_value properties.
[static] Image new( unsigned int w, unsigned int h, DCplxTrans trans, double data[ ] )Description: Constructor for a monochrome image with the given pixel values This constructor creates an image from the given pixel values. The values have to be organized line by line. Each line must consist of "w" values where the first value is the leftmost pixel. Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to the common convention for image data. Initially the pixel width and heigt will be 1 micron and the data range will be 0 to 1.0 (black to white level). To adjust the data range use the min_value and max_value properties.
[static] Image new( unsigned int w, unsigned int h, double red[ ], double green[ ], double blue[ ] )Description: Constructor for a color image with the given pixel values This constructor creates an image from the given pixel values. The values have to be organized line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to the common convention for image data. Initially the pixel width and heigt will be 1 micron and the data range will be 0 to 1.0 (black to white level). To adjust the data range use the min_value and max_value properties.
[static] Image new( unsigned int w, unsigned int h, DCplxTrans trans, double red[ ], double green[ ], double blue[ ] )Description: Constructor for a color image with the given pixel values This constructor creates an image from the given pixel values. The values have to be organized line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to the common convention for image data. Initially the pixel width and heigt will be 1 micron and the data range will be 0 to 1.0 (black to white level). To adjust the data range use the min_value and max_value properties.
[static] Image newDescription: Create a new image with the default attributes This will create an empty image without data and no particular pixel width or related. Use the read_file or set_data methods to set image properties and pixel values.
[const] double pixel_heightDescription: Get the pixel height See pixel_height= for a description of that property.
pixel_height=( double h )Description: Set the pixel height The pixel height determines the height of on pixel in the original space which is transformed to micron space with the transformation.
[const] double pixel_widthDescription: Get the pixel width See pixel_width= for a description of that property.
pixel_width=( double w )Description: Set the pixel width The pixel width determines the width of on pixel in the original space which is transformed to micron space with the transformation.
set_data( unsigned int w, unsigned int h, double r[ ], double g[ ], double b[ ] )Description: Write the image data field (color) See the constructor description for the data organisation in that field.
set_data( unsigned int w, unsigned int h, double d[ ] )Description: Write the image data field (monochrome) See the constructor description for the data organisation in that field.
set_pixel( unsigned int x, unsigned int y, double v )Description: Set one pixel (monochrome) If the component index, x or y value exceeds the image bounds of the image is a color image, this method does nothing.
set_pixel( unsigned int x, unsigned int y, double r, double g, double b )Description: Set one pixel (color) If the component index, x or y value exceeds the image bounds of the image is not a color image, this method does nothing.
[const] string to_sDescription: Conver the image to a string
[const] const ref DCplxTrans transDescription: Return the pixel-to-micron transformation This transformation converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height) to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
trans=( DCplxTrans t )Description: Set the transformation This transformation converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height) to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
[const] Image transformed( DTrans t )Description: Transform the ruler or marker with the given simple transformation
[const] Image transformed( DTrans t )Description: Transform the image with the given simple transformation
[const] Image transformed_cplx( DCplxTrans t )Description: Transform the image with the given complex transformation
visible=( bool v )Description: Set the visibility See the is_visible? method for a description of this property. This method has been introduced in version 0.20.
[const] unsigned int widthDescription: Get the width of the image in pixels
|