ddt 1.2.1
Loading...
Searching...
No Matches
Public Types | Protected Attributes | List of all members
ddt::ImageHandling Class Reference

#include <imageHandling.hpp>

Public Types

enum  CutLevelType { AUTO , MINMAX , USERDEFINED }
 
enum  ColorScalingType { LINEAR_SCALE , LOG_SCALE , SQRT_SCALE }
 

Protected Attributes

ddt::DdtLoggerlogger
 
 ImageHandling ()
 
virtual ~ImageHandling ()
 
void set_logger (ddt::DdtLogger *const in_logger)
 
void FreeResources ()
 
bool LoadFile (const std::string &file_name, const int position=0)
 
template<typename TPOINTER >
bool LoadPointer (TPOINTER *new_image_data, int nx, int ny)
 
bool LoadFilePlane (const std::string &file_name, const int position=0, const int plane=0)
 
bool LoadImageExtensionsAsOne (const std::string &file_name)
 
void set_CutLevelType (const CutLevelType in_cut_level_type)
 
CutLevelType get_CutLevelType () const
 
std::string get_CutLevelTypeStr () const
 
bool ApplyCutLevelsMinMax ()
 
bool ApplyCutLevelsMinMax (const double lowerleftx, const double lowerlefty, const double upperrightx, const double upperrighty)
 
bool ApplyCutLevelsAuto ()
 
bool ApplyCutLevelsAuto (const double lowerleftx, const double lowerlefty, const double upperrightx, const double upperrighty)
 
bool ApplyCutLevelsManual (const double min_value, const double max_value)
 
bool ResetCutLevels ()
 
void AddCustomColorMaps (ddt::colorMap_t const &colourmap, ddt::colorMap_t const &colourmap_inverted, ddt::colorMapARGB_t const &colourmap_argb, ddt::colorMapARGB_t const &colourmap_argb_inverted)
 
std::string get_LastSelectedColourmapName () const
 
bool LoadColorMaps (const std::string color_map_folder, std::string color_map_name="standard")
 
bool LoadActualColorMap (std::string color_map_name)
 
bool LoadActualConfigurationMap (const std::string configuration_map_name)
 
bool LoadConfigurationMaps (const std::string configuration_map_source)
 
bool LoadInformationMaps (const std::string information_map_source)
 
int StoreActualImageAsBias (const std::string slot_name="")
 
bool StoreActualImageAsBiasInSlot (const std::string slot_name, const int slot)
 
int LoadFileAsBias (const std::string file_name)
 
bool LoadFileAsBiasInSlot (const std::string file_name, const int slot)
 
std::string GetBiasSlotName (const int slot)
 
bool GetBiasEnabled () const
 
void EnableBias (const bool enable_bias)
 
void ApplyBias (const int slot)
 
int GetCurrentSelectedBiasSlot () const
 
void ClearAllBiasImages ()
 
void ClearSelectedBiasImage (const int slot)
 
void DisplaySelectedBiasImage (const int slot)
 
int get_CurrentPlane () const
 
void set_CurrentPlane (const int plane)
 
void set_RotateFlag (const bool rot_flag)
 
bool get_RotateFlag () const
 
void set_FlipXFlag (const bool flip_flag)
 
bool get_FlipXFlag () const
 
void set_FlipYFlag (const bool flip_flag)
 
bool get_FlipYFlag () const
 
void * get_ImageData ()
 
cpl_image * get_Image ()
 
cpl_table * get_BinaryTable ()
 
int get_ImageWidth () const
 
int get_ImageHeight () const
 
int get_NumberExtensions ()
 
int get_NumberAxis () const
 
int get_NumberPlanes () const
 
bool get_LastSegment () const
 
std::string get_Timestamp () const
 
FitsExtensionget_FitsExtensionInfo (const int extension_number)
 
FitsExtension get_PrimaryHDUInfo () const
 
std::shared_ptr< DdtEncDecget_MetadataSample ()
 
bool get_ImageRotation (double *const rotation_angle) const
 
void set_CutLevelMin (const double min_value)
 
void set_CutLevelMax (const double max_value)
 
double get_CutLevelMin () const
 
double get_CutLevelMax () const
 
double get_ImagePixelMin () const
 
double get_ImagePixelMax () const
 
int get_ImageBitsPerPixel () const
 
std::list< std::string > get_ColorMaps () const
 
ddt::colorMap_tget_ActualColorMap ()
 
ddt::colorMapARGB_tget_ActualColorMapARGB ()
 
std::string get_ActualColorMapName () const
 
ddt::scalingLut_tget_ScalingLut ()
 
ddt::scalingLut_tget_LinearScalingLut ()
 
ddt::scalingLut_tget_LogarithmicScalingLut ()
 
ddt::scalingLut_tget_SqrtScalingLut ()
 
ColorScalingType get_ColorScalingType () const
 
void set_ColorScalingTypeLinear ()
 
void set_ColorScalingTypeLogarithmic ()
 
void set_ColorScalingTypeSquareRoot ()
 
void set_ColorScalingType (const ColorScalingType scaling_type)
 
void set_InvertColourmap (const bool invert)
 
std::string get_ColorScalingTypeStr () const
 
double ImagePixelFromImage (const double x_image, double y_image)
 
double ImagePixelFromCanvas (const double x_canvas, const double y_canvas, double *const x_image, double *const y_image)
 
void ConvertCanvasToImage (const double x_canvas, const double y_canvas, double *const x_image, double *const y_image) const
 
void ConvertImageToCanvas (const double x_image, const double y_image, double *const x_canvas, double *const y_canvas) const
 
bool WorldCoordinatesDegreesFromImage (const double x_image, const double y_image, double *alpha, double *delta) const
 
bool ImageCoordinatesFromWorldCoordinatesDegrees (const double alpha, const double delta, double *const x_image, double *const y_image) const
 
bool WorldCoordinatesDegreesFromCanvas (const double x_canvas, const double y_canvas, double *alpha, double *delta)
 
bool CanvasCoordinatesFromWorldCoordinatesDegrees (const double alpha, const double delta, double *const x_canvas, double *const y_canvas)
 
CplStatisticsGetStatisticsCplImageWindow (int llx, int lly, int urx, int ury)
 
bool get_ConfigurationMap_Value (const double x, const double y, double *const value) const
 
std::list< std::string > get_TextInformation (const double x, const double y) const
 
bool get_AttachedToStream () const
 
ddt::DdtStatisticsget_DataStatistics ()
 
void set_RetrieveStatsFlag (bool value)
 
bool ReprocessImage ()
 
void GetHistogramFromImage (const int64_t min_value, const int64_t max_value, std::vector< int > &distribution) const
 
void GetHistogramBinsFromImage (const int64_t min_value, const int64_t max_value, std::vector< int > &distribution) const
 
void GetCutValuesPercentageFromImage (const double percentage, double *const min_value, double *const max_value) const
 
void AttachDataStream (const std::string data_stream_id)
 
void DetachDataStream (const std::string data_stream_id)
 
cpl_apertures * GetCircularObjects (const double sigma)
 
bool GetObjectCentroidPos (const cpl_apertures *const apertures, const double x_image, const double y_image, double *const x_centroid, double *const y_centroid) const
 
bool GetObjectInformation (const double x_image, const double y_image, const int size, double *const x_axis_angle, double *const background, double *const peak_above_background, double *const fwhm_x, double *const fwhm_y, double *const object_coord_x, double *const object_coord_y)
 
bool GetGaussianParameters (const double x_image, const double y_image, const int size, double *const background, double *const gaussian_volume, double *const correlation, double *const gaussian_coord_x, double *const gaussian_coord_y, double *const sigma_x, double *const sigma_y)
 
std::string GetEquinox ()
 
SignalTImageAvailableInBufferSignal ()
 
SignalTCutLevelChangedSignal ()
 
std::vector< std::string > GetPrimaryFITSHeader ()
 
std::vector< std::vector< std::string > > GetExtensionsFITSHeader ()
 
cpl_propertylist * GetPropertyList ()
 
double GetPixelToDegreesScalingFactor ()
 
double GetImagePixelDistance (const double startx, const double starty, const double endx, const double endy, double *const xoffset=nullptr, double *const yoffset=nullptr) const
 
double GetImagePixelDistanceDegrees (const double startx, const double starty, const double endx, const double endy, double *const xoffsetdeg=nullptr, double *const yoffsetdeg=nullptr)
 
std::vector< int > get_invalid_image_hdus () const
 

Detailed Description

Class to wrap the usage of image handling functions.

This class allows to load a data file or attach to a data stream. It offers access to image properties and the possibility to process the image data (e.g. flip / rotate etc.).

Member Enumeration Documentation

◆ ColorScalingType

To distinguish between color scaling types.

Enumerator
LINEAR_SCALE 

Linear scaling. The LUT for pixel values is setup using a linear scaling. The LUT will scale the pixels inside the cut level range to the range 0-255.

LOG_SCALE 

Logarithmic scaling. The LUT for pixel values is setup using a logarithmic scaling. The LUT will scale the pixels inside the cut level range to the range 0-255.

SQRT_SCALE 

Square root scaling. The LUT for pixel values is setup using a square root scaling. The LUT will scale the pixels inside the cut level range to the range 0-255.

◆ CutLevelType

To distinguish between cut level types.

Enumerator
AUTO 

Auto cut level. The cut levels are determined by taking the min/max values of the median filtered image.

MINMAX 

Min/Max cut level. The cut levels are determined by taking the min/max values of the image.

USERDEFINED 

Used defined cut levels.

Constructor & Destructor Documentation

◆ ImageHandling()

ImageHandling::ImageHandling ( )

Constructor

◆ ~ImageHandling()

ImageHandling::~ImageHandling ( )
virtual

Destructor

Member Function Documentation

◆ AddCustomColorMaps()

void ImageHandling::AddCustomColorMaps ( ddt::colorMap_t const & colourmap,
ddt::colorMap_t const & colourmap_inverted,
ddt::colorMapARGB_t const & colourmap_argb,
ddt::colorMapARGB_t const & colourmap_argb_inverted )

Adds a custom color map and stores it as actual color map.

Parameters
colour_mapthe custom colourmap
colourmap_invertedthe inverted custom colourmap
colourmap_argbthe custom colourmap with alpha channel
colourmap_argb_invertedthe custom colourmap with alpha channel

◆ ApplyBias()

void ImageHandling::ApplyBias ( const int slot)

Apply the BIAS identified by the slot number on the current image

Parameters
slotthe BIAS slot number (starting with 0)

◆ ApplyCutLevelsAuto() [1/2]

bool ImageHandling::ApplyCutLevelsAuto ( )

Apply cut levels based on the median filtered image's min/max values

Returns
true if applying the cut levels was successful, false otherwise

◆ ApplyCutLevelsAuto() [2/2]

bool ImageHandling::ApplyCutLevelsAuto ( const double lowerleftx,
const double lowerlefty,
const double upperrightx,
const double upperrighty )

Apply cut levels based on the median filtered sub-image's min/max values. The sub-image is the part of the image covered by the rectangle that is specified by the lower left and upper right corners image pixel coordinate arguments.

Parameters
lowerleftxthe x coordinate of the lower left corner of the sub-image
lowerleftythe y coordinate of the lower left corner of the sub-image
upperrightxthe x coordinate of the upper right corner of the sub-image
upperrightythe y coordinate of the upper right corner of the sub-image
Returns
true if applying the cut levels was successful, false otherwise

◆ ApplyCutLevelsManual()

bool ImageHandling::ApplyCutLevelsManual ( const double min_value,
const double max_value )

Apply cut levels based manually

Returns
true if applying the cut levels was successful, false otherwise

◆ ApplyCutLevelsMinMax() [1/2]

bool ImageHandling::ApplyCutLevelsMinMax ( )

Apply cut levels based on the image min/max values

Returns
true if applying the cut levels was successful, false otherwise

◆ ApplyCutLevelsMinMax() [2/2]

bool ImageHandling::ApplyCutLevelsMinMax ( const double lowerleftx,
const double lowerlefty,
const double upperrightx,
const double upperrighty )

Apply cut levels based on a sub-image min/max values. The sub-image is the part of the image covered by the rectangle that is specified by the lower left and upper right corners image pixel coordinate arguments.

Parameters
lowerleftxthe x coordinate of the lower left corner of the sub-image
lowerleftythe y coordinate of the lower left corner of the sub-image
upperrightxthe x coordinate of the upper right corner of the sub-image
upperrightythe y coordinate of the upper right corner of the sub-image
Returns
true if applying the cut levels was successful, false otherwise

◆ AttachDataStream()

void ImageHandling::AttachDataStream ( const std::string data_stream_id)

Attach to a data stream

Parameters
data_stream_idThe ID of the data stream (could be the URI)

◆ CanvasCoordinatesFromWorldCoordinatesDegrees()

bool ImageHandling::CanvasCoordinatesFromWorldCoordinatesDegrees ( const double alpha,
const double delta,
double *const x_canvas,
double *const y_canvas )

Get the canvas coordinates from the world coordinates in degrees

Parameters
alphathe world coordinates alpha value
deltathe world coordinates delta value
x_canvasthe resulting canvas x position
y_canvasthe resulting canvas y position
Returns
bool indicating success or failure of coordinate fetching

◆ ClearAllBiasImages()

void ImageHandling::ClearAllBiasImages ( )

Clear all BIAS images.

◆ ClearSelectedBiasImage()

void ImageHandling::ClearSelectedBiasImage ( const int slot)

Clear the selected BIAS image, identified by its slot number

Parameters
slotthe BIAS slot number (starting with 0)

◆ ConvertCanvasToImage()

void ImageHandling::ConvertCanvasToImage ( const double x_canvas,
const double y_canvas,
double *const x_image,
double *const y_image ) const

Converts canvas coordinates to image coordinates

Parameters
x_canvasthe canvas x position
y_canvasthe canvas y position
x_imagethe resulting image x position
y_imagethe resulting image y position

◆ ConvertImageToCanvas()

void ImageHandling::ConvertImageToCanvas ( const double x_image,
const double y_image,
double *const x_canvas,
double *const y_canvas ) const

Converts image coordinates to canvas coordinates

Parameters
x_imagethe image x position
y_imagethe image y position
x_canvasthe resulting canvas x position
y_canvasthe resulting canvas y position

◆ CutLevelChangedSignal()

SignalT * ImageHandling::CutLevelChangedSignal ( )

Provide the cut level changed signal

◆ DetachDataStream()

void ImageHandling::DetachDataStream ( const std::string data_stream_id)

Detach from a data stream

Parameters
data_stream_idThe ID of the stream to be disconnected

◆ DisplaySelectedBiasImage()

void ImageHandling::DisplaySelectedBiasImage ( const int slot)

Displax the selected BIAS image, identified by its slot number

Parameters
slotthe BIAS slot number (starting with 0)

◆ EnableBias()

void ImageHandling::EnableBias ( const bool enable_bias)

Enable BIAS processing. If enabled, the currently selected BIAS image will be subtracted from each new image.

Parameters
enable_biasflag indicating if BIAS processing shall be enabled

◆ FreeResources()

void ImageHandling::FreeResources ( )

◆ get_ActualColorMap()

ddt::colorMap_t * ImageHandling::get_ActualColorMap ( )

Get the actual color map

Returns
the actual color map

◆ get_ActualColorMapARGB()

ddt::colorMapARGB_t * ImageHandling::get_ActualColorMapARGB ( )

Get the actual color map as ARGB value array

Returns
the actual color map

◆ get_ActualColorMapName()

std::string ImageHandling::get_ActualColorMapName ( ) const

Get the name of the current colourmap

Returns
name of the current colourmap

◆ get_AttachedToStream()

bool ImageHandling::get_AttachedToStream ( ) const

Get the attached to stream flag from the data acquisition

Returns
the flag indicating if the data acquisition is attached to a data stream

◆ get_BinaryTable()

cpl_table * ImageHandling::get_BinaryTable ( )

Get the binary table data

◆ get_ColorMaps()

std::list< std::string > ImageHandling::get_ColorMaps ( ) const

Get the list of loaded color maps

Returns
the list of currently loaded color maps

◆ get_ColorScalingType()

ImageHandling::ColorScalingType ImageHandling::get_ColorScalingType ( ) const

Get the color scalingtype.

Returns
the currently selected color scaling type

◆ get_ColorScalingTypeStr()

std::string ImageHandling::get_ColorScalingTypeStr ( ) const

Get a string representaiton of the color scaling type.

Returns
the currently selected color scaling type as string

◆ get_ConfigurationMap_Value()

bool ImageHandling::get_ConfigurationMap_Value ( const double x,
const double y,
double *const value ) const

Get the value from a configuration map located at the specified x/y coordinate.

Parameters
xthe x coordinate
ythe y coordinate
valuethe value at the specified coordinate, or 0.0 in case of error
Returns
true if value could be determined, false otherwise

◆ get_CurrentPlane()

int ImageHandling::get_CurrentPlane ( ) const

Get the currently selected plane.

Returns
the currently selected plane number

◆ get_CutLevelMax()

double ImageHandling::get_CutLevelMax ( ) const

Get the cut level maximum

◆ get_CutLevelMin()

double ImageHandling::get_CutLevelMin ( ) const

Get the cut level minimum

◆ get_CutLevelType()

ImageHandling::CutLevelType ImageHandling::get_CutLevelType ( ) const

Get the cut level type.

Returns
the currently selected cut level type

◆ get_CutLevelTypeStr()

std::string ImageHandling::get_CutLevelTypeStr ( ) const

Get a string representation of the cut level type.

Returns
the currently selected cut level type as string

◆ get_DataStatistics()

ddt::DdtStatistics * ImageHandling::get_DataStatistics ( )

Get statistics data sample from current subscriber

Returns
Pointer to the statistic information structure

◆ get_FitsExtensionInfo()

FitsExtension * ImageHandling::get_FitsExtensionInfo ( const int extension_number)

Get the information about one file extension

Parameters
extension_numberthe extension number
Returns
the FitsExtension object corresponding to the extension number, or nullptr if no such object is available

◆ get_FlipXFlag()

bool ImageHandling::get_FlipXFlag ( ) const

Get the flip X flag.

Returns
the flip X flag (indicating if the image had been flipped horizontally)

◆ get_FlipYFlag()

bool ImageHandling::get_FlipYFlag ( ) const

Get the flip Y flag.

Returns
the flip Y flag (indicating if the image had been flipped vertically)

◆ get_Image()

cpl_image * ImageHandling::get_Image ( )

Get the image data

◆ get_ImageBitsPerPixel()

int ImageHandling::get_ImageBitsPerPixel ( ) const

Get the image bits per pixel

◆ get_ImageData()

void * ImageHandling::get_ImageData ( )

Get the image data

◆ get_ImageHeight()

int ImageHandling::get_ImageHeight ( ) const

Get the image height

◆ get_ImagePixelMax()

double ImageHandling::get_ImagePixelMax ( ) const

Get the image pixel maximum

◆ get_ImagePixelMin()

double ImageHandling::get_ImagePixelMin ( ) const

Get the image pixel minimum

◆ get_ImageRotation()

bool ImageHandling::get_ImageRotation ( double *const rotation_angle) const

Get the rotation angle (in degrees) as calculated from the CD matrix contained in the WCS image data

Parameters
rotation_anglethe calculated rotation angle, or -1.0 in case of error
Returns
true, if calculation was possible, false otherwise (e.g. no wcs or cd matrix data available)

◆ get_ImageWidth()

int ImageHandling::get_ImageWidth ( ) const

Get the image width

◆ get_invalid_image_hdus()

std::vector< int > ImageHandling::get_invalid_image_hdus ( ) const

Get the information about invalid image HDUs

Returns
Vector of invalid HDUs

◆ get_LastSegment()

bool ImageHandling::get_LastSegment ( ) const

Get the last segment flag

◆ get_LastSelectedColourmapName()

std::string ImageHandling::get_LastSelectedColourmapName ( ) const

Returns the name of the last colourmap selected within the colourmap dialog.

Returns
The name of the last selected colourmap

◆ get_LinearScalingLut()

ddt::scalingLut_t * ImageHandling::get_LinearScalingLut ( )

Get the LUT for linear color scaling

Returns
a scalingLut object (an array of 64K uint values)

◆ get_LogarithmicScalingLut()

ddt::scalingLut_t * ImageHandling::get_LogarithmicScalingLut ( )

Get the LUT for logarithmic color scaling

Returns
a scalingLut object (an array of 64K uint values)

◆ get_MetadataSample()

std::shared_ptr< DdtEncDec > ImageHandling::get_MetadataSample ( )

Get image metadata infomation

Returns
the metadata encoder/decoder object with already filled attributes

◆ get_NumberAxis()

int ImageHandling::get_NumberAxis ( ) const

Get the number of axis

◆ get_NumberExtensions()

int ImageHandling::get_NumberExtensions ( )

Get the number of extensions

◆ get_NumberPlanes()

int ImageHandling::get_NumberPlanes ( ) const

Get the number of planes

◆ get_PrimaryHDUInfo()

FitsExtension ImageHandling::get_PrimaryHDUInfo ( ) const

Get the information about the primary HDU

Returns
the FitsExtension object corresponding to the primary HDU

◆ get_RotateFlag()

bool ImageHandling::get_RotateFlag ( ) const

Get the rotate flag.

Returns
the rotate flag (indicating if the image had been rotated)

◆ get_ScalingLut()

ddt::scalingLut_t * ImageHandling::get_ScalingLut ( )

Get the scaling LUT, depending on the current scaling type

Returns
a scalingLut object (an array of 64K uint values)

◆ get_SqrtScalingLut()

ddt::scalingLut_t * ImageHandling::get_SqrtScalingLut ( )

Get the LUT for square root color scaling

Returns
a scalingLut object (an array of 64K uint values)

◆ get_TextInformation()

std::list< std::string > ImageHandling::get_TextInformation ( const double x,
const double y ) const

Get the textual information contained in a configuration text info file related to a certain position

Parameters
xthe x coordinate
ythe y coordinate
Returns
list of strings containing the textual information

◆ get_Timestamp()

std::string ImageHandling::get_Timestamp ( ) const

Get last timestamp

Returns
last timestamp

◆ GetBiasEnabled()

bool ImageHandling::GetBiasEnabled ( ) const

Get the flag indicating whether bias processing is enabled

◆ GetBiasSlotName()

std::string ImageHandling::GetBiasSlotName ( const int slot)

Get the slot name associated to a certain slot number

Parameters
slotthe slot number (starting with 0)
Returns
the slot name, or empty string in case that the slot number is out of range or there is no image stored in that slot

◆ GetCircularObjects()

cpl_apertures * ImageHandling::GetCircularObjects ( const double sigma)

Get a list of objects from a CPL image

Parameters
sigmathe detection level
Returns
list of cpl_apertures objects

◆ GetCurrentSelectedBiasSlot()

int ImageHandling::GetCurrentSelectedBiasSlot ( ) const

Get the currently selected BIAS slot

Returns
the currently selected BIAS slot, or -1 if no slot is selected

◆ GetCutValuesPercentageFromImage()

void ImageHandling::GetCutValuesPercentageFromImage ( const double percentage,
double *const min_value,
double *const max_value ) const

◆ GetEquinox()

std::string ImageHandling::GetEquinox ( )

Return the current equinox information related to the image, if available

Returns
the equinox information

◆ GetExtensionsFITSHeader()

std::vector< std::vector< std::string > > ImageHandling::GetExtensionsFITSHeader ( )

Get all Extension FITS header as a vector of strings

Returns
a vector of strings containing the FITS header items

◆ GetGaussianParameters()

bool ImageHandling::GetGaussianParameters ( const double x_image,
const double y_image,
const int size,
double *const background,
double *const gaussian_volume,
double *const correlation,
double *const gaussian_coord_x,
double *const gaussian_coord_y,
double *const sigma_x,
double *const sigma_y )

Get parameters from 2D gaussian fit

Parameters
x_imagethe image x position
y_imagethe image y position
sizethe size of the rectangle around the image position to consider
backgroundthe background level, or 0.0 on error
gaussian_volumethe gaussian volumne, or 0.0 on error
correlationthe correlation, or 0.0 on error
gaussian_coord_xthe x coordinate of the mid of the gaussian fit
gaussian_coord_ythe y coordinate of the mid of the gaussian fit
sigma_xthe variance of gaussian fit in x direction
sigma_ythe variance of gaussian fit in y direction
Returns
true on success, otherwise false

◆ GetHistogramBinsFromImage()

void ImageHandling::GetHistogramBinsFromImage ( const int64_t min_value,
const int64_t max_value,
std::vector< int > & distribution ) const

◆ GetHistogramFromImage()

void ImageHandling::GetHistogramFromImage ( const int64_t min_value,
const int64_t max_value,
std::vector< int > & distribution ) const

◆ GetImagePixelDistance()

double ImageHandling::GetImagePixelDistance ( const double startx,
const double starty,
const double endx,
const double endy,
double *const xoffset = nullptr,
double *const yoffset = nullptr ) const

Returns the pixel distance between two pixels, provided with their x and y coordinates. In addition, the x- and y-offset is returned.

Parameters
startxx coordinate of the first pixel
startyy coordinate of the first pixel
endxx coordinate of the second pixel
endyy coordinate of the second pixel
xoffsetif provided and no nullptr, will contain the offset in x direction
yoffsetif provided and no nullptr, will contain the offset in y direction
Returns
the pixel distance

◆ GetImagePixelDistanceDegrees()

double ImageHandling::GetImagePixelDistanceDegrees ( const double startx,
const double starty,
const double endx,
const double endy,
double *const xoffsetdeg = nullptr,
double *const yoffsetdeg = nullptr )

Returns the pixel distance in degrees between two pixels, provided with their x and y coordinates. In addition, the x- and y-offset is returned. This uses the pixel scaling factor as provided in the CPL property list

Parameters
startxx coordinate of the first pixel
startyy coordinate of the first pixel
endxx coordinate of the second pixel
endyy coordinate of the second pixel
xoffsetdegif provided and no nullptr, will contain the offset in x direction [degrees]
yoffsetdegif provided and no nullptr, will contain the offset in y direction [degrees]
Returns
the pixel distance in degrees, or 0.0 if the scaling factor could not be

◆ GetObjectCentroidPos()

bool ImageHandling::GetObjectCentroidPos ( const cpl_apertures *const apertures,
const double x_image,
const double y_image,
double *const x_centroid,
double *const y_centroid ) const

Find an aperture object that matches certain image coordinates and return the centroid position

Parameters
apertureslist of cpl_apertures objects
x_imagethe image x position
y_imagethe image y position
x_centroidthe centroid x coordinate, or -1.0 on error
y_centroidthe centroid y coordinate, or -1.0 on error
Returns
true on success, otherwise false

◆ GetObjectInformation()

bool ImageHandling::GetObjectInformation ( const double x_image,
const double y_image,
const int size,
double *const x_axis_angle,
double *const background,
double *const peak_above_background,
double *const fwhm_x,
double *const fwhm_y,
double *const object_coord_x,
double *const object_coord_y )

Get information about an aperture object

Parameters
x_imagethe image x position
y_imagethe image y position
sizethe size of the rectangle around the image position to consider
x_axis_anglethe angle of the x_axis (degrees), or 0.0 on error
backgroundthe background level, or 0.0 on error
peak_above_backgroundthe peak above background value, or 0.0 on error
fwhm_xthe FWHM along the x axis, or -1.0 on error
fwhm_ythe FWHM along the y axis, or -1.0 on error
object_coord_xx coordinate of the center of the detected object
object_coord_yy coordinate of the center of the detected object
Returns
true on success, otherwise false

◆ GetPixelToDegreesScalingFactor()

double ImageHandling::GetPixelToDegreesScalingFactor ( )

Calculate and return the factor needed to convert pixel distances to degrees The needed information is taken from the FITS header items, if available

Returns
the pixel to degrees scaling factor, or 0.0 if not available

◆ GetPrimaryFITSHeader()

std::vector< std::string > ImageHandling::GetPrimaryFITSHeader ( )

Get the Primary FITS header items as a vector of strings

Returns
a vector of strings containing the FITS header items

◆ GetPropertyList()

cpl_propertylist * ImageHandling::GetPropertyList ( )

Get the FITS header property list as a cpl_propertylist object

Returns
a cpl_propertylist object containing the FITS header items

◆ GetStatisticsCplImageWindow()

CplStatistics * ImageHandling::GetStatisticsCplImageWindow ( int llx,
int lly,
int urx,
int ury )

Get statistics from CPL internal image sub-window

Parameters
llxlower left x position (1: leftmost)
llylower left y position (1: lowest)
urxupper right x position
uryupper right y position
Returns
CplStatistics structure containing statistic values or NULL in case of errors Following values are contained: number of pixels, min pixel value, max pixel value, mean pixel value, rms value

◆ ImageAvailableInBufferSignal()

SignalT * ImageHandling::ImageAvailableInBufferSignal ( )

Provide the image available in buffer signal

◆ ImageCoordinatesFromWorldCoordinatesDegrees()

bool ImageHandling::ImageCoordinatesFromWorldCoordinatesDegrees ( const double alpha,
const double delta,
double *const x_image,
double *const y_image ) const

Get the image coordinates from world coordinates in degrees

Parameters
alphaworld coordinates alpha value
deltaworld coordinates delta value
x_imagethe resulting image x position, or 0.0 on error
y_imagethe resulting image y position, or 0.0 on error
Returns
bool indicating success or failure of coordinate fetching

◆ ImagePixelFromCanvas()

double ImageHandling::ImagePixelFromCanvas ( const double x_canvas,
const double y_canvas,
double *const x_image,
double *const y_image )

Get the image pixel value from the position expressed as canvas coordinates

Parameters
x_canvasthe canvas x position
y_canvasthe canvas y position
x_imagethe resulting image x position
y_imagethe resulting image y position
Returns
the pixel value (converted to double) from the canvas coordinates

◆ ImagePixelFromImage()

double ImageHandling::ImagePixelFromImage ( const double x_image,
double y_image )

Get the image pixel value from the position expressed as image coordinates

Parameters
x_imagethe image x position
y_imagethe image y position
Returns
the pixel value (converted to double) from the image coordinates

◆ LoadActualColorMap()

bool ImageHandling::LoadActualColorMap ( std::string color_map_name)

Load the supplied color map as actual color map.

Parameters
color_map_namethe name of the color map to be loaded. The color map names are derived from the color map file names.
Returns
true if loading was successful, false otherwise

◆ LoadActualConfigurationMap()

bool ImageHandling::LoadActualConfigurationMap ( const std::string configuration_map_name)

Load the supplied configuration map as the actual configuration map.

Parameters
configuration_map_namethe name of the configuration map to be loaded.
Returns
true if loading was successful, false otherwise

◆ LoadColorMaps()

bool ImageHandling::LoadColorMaps ( const std::string color_map_folder,
std::string color_map_name = "standard" )

Load the color maps from the specified folder into the color_maps member. If possible, the supplied color map is then loaded as the actual color map.

Parameters
color_map_folderthe folder containing color map files. These files (with extension .lut or .lasc) should contain 256 RGB triples (in the form: r.rrrr g.gggg b.bbbb, where each value is in the range 0.0 and 1.0).
color_map_namethe name of the color map to be loaded. The color map names are derived from the color map file names.
Returns
true if loading was successful, false otherwise

◆ LoadConfigurationMaps()

bool ImageHandling::LoadConfigurationMaps ( const std::string configuration_map_source)

Load the configuration maps from the specified configuration map source.

Parameters
configuration_map_sourcethe source of the configuration maps

◆ LoadFile()

bool ImageHandling::LoadFile ( const std::string & file_name,
const int position = 0 )

Load file. This function takes a CPL file (FITS) name and a position. The position indicates the HDU to use. The default HDU is the first (position 0).

Parameters
file_namethe FITS file name to load
positionthe position indicating the HDU to use. This defaults to 0 (the first HDU).
Returns
true if loading was successful, false otherwise

◆ LoadFileAsBias()

int ImageHandling::LoadFileAsBias ( const std::string file_name)

Load a file from disc as BIAS image

Parameters
file_namethe name of the file to load as BIAS image
Returns
slot number into which the image was stored, or -1 in case storing was not possible

◆ LoadFileAsBiasInSlot()

bool ImageHandling::LoadFileAsBiasInSlot ( const std::string file_name,
const int slot )

Load a file from disc as BIAS image in certain slot

Parameters
file_namethe name of the file to load as BIAS image
slotthe slot number (starting with 0)
Returns
true if loading was successful, false otherwise

◆ LoadFilePlane()

bool ImageHandling::LoadFilePlane ( const std::string & file_name,
const int position = 0,
const int plane = 0 )

Load certain plain from a 3D cube CPL file.

Parameters
file_namethe FITS file name to load
positionthe position indicating the HDU to use. This defaults to 0 (the first HDU).
planethe plane of the HDU to load. This defaults to 0.
Returns
true if loading was successful, false otherwise

◆ LoadImageExtensionsAsOne()

bool ImageHandling::LoadImageExtensionsAsOne ( const std::string & file_name)

Load all image extensions from a CPL file into one cpl_image.

Parameters
file_namethe FITS file name to load
Returns
true if loading was successful, false otherwise

◆ LoadInformationMaps()

bool ImageHandling::LoadInformationMaps ( const std::string information_map_source)

Load the information maps from the specified information map source.

Parameters
information_map_sourcethe source of the information maps

◆ LoadPointer()

template<class TPOINTER >
template bool ImageHandling::LoadPointer< int16_t > ( TPOINTER * new_image_data,
int nx,
int ny )

Load in-memory pointer to array. This function takes the pointer to a an array, and its x and y dimensions and loads it using CPL methods.

Parameters
new_image_datapointer to an array of type TPOINTER
nxfirst dimension size
nysecond dimension size
Returns
true if loading was successful, false otherwise

◆ ReprocessImage()

bool ImageHandling::ReprocessImage ( )

Apply all processing flags and cut levels on the image

◆ ResetCutLevels()

bool ImageHandling::ResetCutLevels ( )

Reset cut levels

Returns
true if resetting the cut levels was successful, false otherwise

◆ set_ColorScalingType()

void ImageHandling::set_ColorScalingType ( const ColorScalingType scaling_type)

Set the actual color scaling type

Parameters
scaling_typethe scaling type to be set

◆ set_ColorScalingTypeLinear()

void ImageHandling::set_ColorScalingTypeLinear ( )

Set the scaling type to LINEAR_SCALE.

◆ set_ColorScalingTypeLogarithmic()

void ImageHandling::set_ColorScalingTypeLogarithmic ( )

Set the scaling type to LOG_SCALE.

◆ set_ColorScalingTypeSquareRoot()

void ImageHandling::set_ColorScalingTypeSquareRoot ( )

Set the scaling type to SQRT_SCALE.

◆ set_CurrentPlane()

void ImageHandling::set_CurrentPlane ( const int plane)

Set the plane to be loaded.

Parameters
planethe plane number

◆ set_CutLevelMax()

void ImageHandling::set_CutLevelMax ( const double max_value)

Set the cut level maximum

◆ set_CutLevelMin()

void ImageHandling::set_CutLevelMin ( const double min_value)

Set the cut level minimum

◆ set_CutLevelType()

void ImageHandling::set_CutLevelType ( const CutLevelType in_cut_level_type)

Set the cut level type.

◆ set_FlipXFlag()

void ImageHandling::set_FlipXFlag ( const bool flip_flag)

Set the flip X flag.

◆ set_FlipYFlag()

void ImageHandling::set_FlipYFlag ( const bool flip_flag)

Set the flip Y flag.

◆ set_InvertColourmap()

void ImageHandling::set_InvertColourmap ( const bool invert)

Set if colourmap should get inverted

Parameters
invertsets if colourmap should get inverted

◆ set_logger()

void ImageHandling::set_logger ( ddt::DdtLogger *const in_logger)

Set logger

Parameters
in_loggerThe logger object

◆ set_RetrieveStatsFlag()

void ImageHandling::set_RetrieveStatsFlag ( bool value)

Enable or Disables subscriber statistics

Parameters
valueFlag to read statitics

◆ set_RotateFlag()

void ImageHandling::set_RotateFlag ( const bool rot_flag)

Set the rotate flag.

◆ StoreActualImageAsBias()

int ImageHandling::StoreActualImageAsBias ( const std::string slot_name = "")

Stores the actually displayed image as BIAS image

Parameters
slot_namename to assign to the slot Should be the filename in case of storing a selected file Defaults to empty string, in which case a slot name will be automatically set
Returns
slot number into which the image was stored, or -1 in case storing was not possible

◆ StoreActualImageAsBiasInSlot()

bool ImageHandling::StoreActualImageAsBiasInSlot ( const std::string slot_name,
const int slot )

Stores the actually displayed image as BIAS image in certain slot

Parameters
slot_namename to assign to the slot Should be the filename in case of storing a selected file Defaults to empty string, in which case a slot name will be automatically set
slotthe slot number (starting with 0)
Returns
true if loading was successful, false otherwise

◆ WorldCoordinatesDegreesFromCanvas()

bool ImageHandling::WorldCoordinatesDegreesFromCanvas ( const double x_canvas,
const double y_canvas,
double * alpha,
double * delta )

Get the world coordinates in degrees from canvas coordinates

Parameters
x_canvasthe canvas x position
y_canvasthe canvas y position
alphathe resulting world coordinates alpha value
deltathe resulting world coordinates delta value
Returns
bool indicating success or failure of coordinate fetching

◆ WorldCoordinatesDegreesFromImage()

bool ImageHandling::WorldCoordinatesDegreesFromImage ( const double x_image,
const double y_image,
double * alpha,
double * delta ) const

Get the world coordinates in degrees from image coordinates

Parameters
x_imagethe image x position
y_imagethe image y position
alphathe resulting world coordinates alpha value
deltathe resulting world coordinates delta value
Returns
bool indicating success or failure of coordinate fetching

Member Data Documentation

◆ logger

ddt::DdtLogger* ddt::ImageHandling::logger
protected

The logger object


The documentation for this class was generated from the following files: