Image

class Image : public emcore::Array

Image class

Public Functions

Image()

Default constructor. The Array will not have any data associated and the type will be nullptr.

Image(const Image &other)

Copy constructor from another Array. This Array will have the same dimensions, data type and values of the other Array.

Parameters
  • other: Other Array to be copied

ObjectDict &getHeader(size_t index = 0)

Return the header of a given image.

Return

ObjectDict reference of the required header

Parameters
  • index: If 0, return the main header, if not, the specified one

void read(const ImageLocation &location)

Read image data from a given location. This function is a shortcut to easily read an image from a location without using the ImageFile class. The file will be open before data is read and closed after it. If you want to read multiple images from the same file, it would be better to first open the file explicitly using ImageFile, read all the images and then close the file.

Parameters
  • location: Input image location (index range and path) to be read

void write(const ImageLocation &location) const

Write the image data into a file location. This function is a shortcut to easily write an image without using the ImageFile class.

Parameters
  • location: Input location where the image will be written.