CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
carta::InitialValueCalculator Class Reference

A class for calculating initial values used in the image fitting process. More...

#include <InitialValueCalculator.h>

Collaboration diagram for carta::InitialValueCalculator:
[legend]

Public Member Functions

 InitialValueCalculator (FitData *fit_data, float image_std, std::string image_unit)
 Constructor for the InitialValueCalculator class.
 
bool CalculateInitialValues (std::vector< CARTA::GaussianComponent > &initial_values, std::string &log)
 Calculate initial values from the provided image data.
 

Private Member Functions

std::vector< GaussianParamsMethodOfMoments (std::vector< int > centroid_indexes={0}, bool apply_filter=false, std::vector< double > center_x={}, std::vector< double > center_y={}, std::vector< double > radius={})
 
std::vector< int > KMeansPlusPlus (size_t num_components, float threshold)
 
std::string GetLog (std::vector< CARTA::GaussianComponent > &initial_values)
 

Private Attributes

float * _image
 Pointer to the image data.
 
int _width
 The width of the image.
 
int _height
 The height of the image.
 
size_t _offset_x
 X-axis offset from the fitting region to the entire image.
 
size_t _offset_y
 Y-axis offset from the fitting region to the entire image.
 
double _image_std
 Standard deviation of the image data.
 
std::string _image_unit
 Unit of the image.
 

Detailed Description

A class for calculating initial values used in the image fitting process.

Constructor & Destructor Documentation

◆ InitialValueCalculator()

InitialValueCalculator::InitialValueCalculator ( FitData fit_data,
float  image_std,
std::string  image_unit 
)

Constructor for the InitialValueCalculator class.

Parameters
fit_dataFitting-related data
image_stdStandard deviation of the image data
image_unitUnit of the image

Member Function Documentation

◆ CalculateInitialValues()

bool InitialValueCalculator::CalculateInitialValues ( std::vector< CARTA::GaussianComponent > &  initial_values,
std::string &  log 
)

Calculate initial values from the provided image data.

Parameters
initial_valuesVector to store the resulting initial values
logString to store the log message describing the generated intial values
Returns
Whether the parameters are successfully generated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLog()

std::string InitialValueCalculator::GetLog ( std::vector< CARTA::GaussianComponent > &  initial_values)
private
Here is the caller graph for this function:

◆ KMeansPlusPlus()

std::vector< int > InitialValueCalculator::KMeansPlusPlus ( size_t  num_components,
float  threshold 
)
private
Here is the caller graph for this function:

◆ MethodOfMoments()

std::vector< GaussianParams > InitialValueCalculator::MethodOfMoments ( std::vector< int >  centroid_indexes = {0},
bool  apply_filter = false,
std::vector< double >  center_x = {},
std::vector< double >  center_y = {},
std::vector< double >  radius = {} 
)
private
Here is the caller graph for this function:

Member Data Documentation

◆ _height

int carta::InitialValueCalculator::_height
private

The height of the image.

◆ _image

float* carta::InitialValueCalculator::_image
private

Pointer to the image data.

◆ _image_std

double carta::InitialValueCalculator::_image_std
private

Standard deviation of the image data.

◆ _image_unit

std::string carta::InitialValueCalculator::_image_unit
private

Unit of the image.

◆ _offset_x

size_t carta::InitialValueCalculator::_offset_x
private

X-axis offset from the fitting region to the entire image.

◆ _offset_y

size_t carta::InitialValueCalculator::_offset_y
private

Y-axis offset from the fitting region to the entire image.

◆ _width

int carta::InitialValueCalculator::_width
private

The width of the image.


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