![]() |
CARTA Backend
The backend component of CARTA
|
#include <Frame.h>
Public Member Functions | |
Frame (uint32_t session_id, std::shared_ptr< FileLoader > loader, const std::string &hdu, int default_z=DEFAULT_Z, bool load_image_cache=true) | |
~Frame () | |
bool | IsValid () |
std::string | GetErrorMessage () |
std::string | GetFileName () |
std::shared_ptr< casacore::CoordinateSystem > | CoordinateSystem (const StokesSource &stokes_source=StokesSource()) |
casacore::IPosition | ImageShape (const StokesSource &stokes_source=StokesSource()) |
DimsInfo | Dims () |
size_t | Width () |
size_t | Height () |
size_t | Depth () |
size_t | NumStokes () |
int | CurrentZ () |
int | CurrentStokes () |
bool | IsCurrentZStokes (const StokesSource &stokes_source) |
int | SpectralAxis () |
int | StokesAxis () |
int | XAxis () |
int | YAxis () |
int | ZAxis () |
AxesInfo | Axes () |
bool | GetBeams (std::vector< CARTA::Beam > &beams) |
StokesSlicer | GetImageSlicer (const AxisRange &z_range, int stokes) |
StokesSlicer | GetImageSlicer (const AxisRange &x_range, const AxisRange &y_range, const AxisRange &z_range, int stokes) |
void | SetAnimationViewSettings (const CARTA::AddRequiredTiles &required_animation_tiles) |
CARTA::AddRequiredTiles | GetAnimationViewSettings () |
bool | SetImageChannels (int new_z, int new_stokes, std::string &message) |
bool | SetCursor (float x, float y) |
bool | FillRasterTileData (CARTA::RasterTileData &raster_tile_data, const Tile &tile, int z, int stokes, CARTA::CompressionType compression_type, float compression_quality, bool is_current_z) |
bool | SetContourParameters (const CARTA::SetContourParameters &message) |
ContourSettings & | GetContourParameters () |
bool | ContourImage (ContourCallback &partial_contour_callback, int channel) |
bool | SetHistogramRequirements (int region_id, const std::vector< CARTA::HistogramConfig > &histogram_configs) |
bool | FillRegionHistogramData (std::function< void(CARTA::RegionHistogramData histogram_data)> region_histogram_callback, int region_id, int file_id, bool channel_changed) |
bool | GetBasicStats (int z, int stokes, BasicStats< float > &stats) |
bool | CalculateHistogram (int region_id, int z, int stokes, int num_bins, const HistogramBounds &bounds, Histogram &hist) |
bool | GetCubeHistogramConfig (HistogramConfig &config) |
void | CacheCubeStats (int stokes, BasicStats< float > &stats) |
void | CacheCubeHistogram (int stokes, Histogram &hist) |
bool | SetStatsRequirements (int region_id, const std::vector< CARTA::SetStatsRequirements_StatsConfig > &stats_configs) |
bool | FillRegionStatsData (std::function< void(CARTA::RegionStatsData stats_data)> stats_data_callback, int region_id, int file_id) |
void | SetSpatialRequirements (const std::vector< CARTA::SetSpatialRequirements_SpatialConfig > &spatial_profiles) |
bool | FillSpatialProfileData (std::vector< CARTA::SpatialProfileData > &spatial_data_vec) |
bool | FillSpatialProfileData (PointXy point, std::vector< CARTA::SetSpatialRequirements_SpatialConfig > spatial_configs, std::vector< CARTA::SpatialProfileData > &spatial_data_vec) |
bool | SetSpectralRequirements (int region_id, const std::vector< CARTA::SetSpectralRequirements_SpectralConfig > &spectral_configs) |
bool | FillSpectralProfileData (std::function< void(CARTA::SpectralProfileData profile_data)> cb, int region_id, bool stokes_changed) |
void | WaitForTaskCancellation () |
bool | IsConnected () |
std::shared_ptr< casacore::LCRegion > | GetImageRegion (int file_id, std::shared_ptr< Region > region, const StokesSource &stokes_source=StokesSource(), bool report_error=true) |
bool | GetImageRegion (int file_id, const AxisRange &z_range, int stokes, StokesRegion &stokes_region) |
casacore::IPosition | GetRegionShape (const StokesRegion &stokes_region) |
bool | GetRegionSubImage (const StokesRegion &stokes_region, casacore::SubImage< float > &sub_image) |
bool | GetSlicerSubImage (const StokesSlicer &stokes_slicer, casacore::SubImage< float > &sub_image) |
bool | GetRegionData (const StokesRegion &stokes_region, std::vector< float > &data, bool report_performance=true) |
bool | GetSlicerData (const StokesSlicer &stokes_slicer, float *data) |
bool | GetRegionStats (const StokesRegion &stokes_region, const std::vector< CARTA::StatsType > &required_stats, bool per_z, std::map< CARTA::StatsType, std::vector< double > > &stats_values) |
bool | GetSlicerStats (const StokesSlicer &stokes_slicer, std::vector< CARTA::StatsType > &required_stats, bool per_z, std::map< CARTA::StatsType, std::vector< double > > &stats_values) |
bool | UseLoaderSpectralData (const casacore::IPosition ®ion_shape) |
bool | GetLoaderPointSpectralData (std::vector< float > &profile, int stokes, CARTA::Point &point) |
bool | GetLoaderSpectralData (int region_id, const AxisRange &z_range, int stokes, const casacore::ArrayLattice< casacore::Bool > &mask, const casacore::IPosition &origin, std::map< CARTA::StatsType, std::vector< double > > &results, float &progress) |
bool | CalculateMoments (int file_id, GeneratorProgressCallback progress_callback, const StokesRegion &stokes_region, const CARTA::MomentRequest &moment_request, CARTA::MomentResponse &moment_response, std::vector< GeneratedImage > &collapse_results, RegionState region_state=RegionState()) |
void | StopMomentCalc () |
bool | FitImage (const CARTA::FittingRequest &fitting_request, CARTA::FittingResponse &fitting_response, GeneratedImage &model_image, GeneratedImage &residual_image, GeneratorProgressCallback progress_callback, StokesRegion *stokes_region=nullptr) |
void | StopFitting () |
void | SaveFile (const std::string &root_folder, const CARTA::SaveFile &save_file_msg, CARTA::SaveFileAck &save_file_ack, std::shared_ptr< Region > image_region) |
bool | GetStokesTypeIndex (const string &coordinate, int &stokes_index) |
std::string | GetStokesType (int stokes_index) |
std::shared_mutex & | GetActiveTaskMutex () |
std::shared_ptr< casacore::ImageInterface< float > > | GetImage () |
void | CloseCachedImage (const std::string &file) |
bool | SetVectorOverlayParameters (const CARTA::SetVectorOverlayParameters &message) |
bool | GetDownsampledRasterData (std::vector< float > &data, int &downsampled_width, int &downsampled_height, int z, int stokes, CARTA::ImageBounds &bounds, int mip) |
bool | CalculateVectorField (const std::function< void(CARTA::VectorOverlayTileData &)> &callback) |
Protected Member Functions | |
bool | CheckZ (int z) |
bool | CheckStokes (int stokes) |
bool | ZStokesChanged (int z, int stokes) |
bool | FillImageCache () |
void | InvalidateImageCache () |
bool | GetRasterData (int z, std::vector< float > &image_data, CARTA::ImageBounds &bounds, int mip, bool mean_filter=true) |
bool | GetRasterTileData (int z, std::shared_ptr< std::vector< float > > &tile_data_ptr, const Tile &tile, int &width, int &height) |
void | GetZMatrix (std::vector< float > &z_matrix, size_t z, size_t stokes) |
int | AutoBinSize () |
bool | FillHistogramFromLoaderCache (int z, int stokes, int num_bins, CARTA::Histogram *histogram) |
bool | FillHistogramFromFrameCache (int z, int stokes, int num_bins, const HistogramBounds &bounds, CARTA::Histogram *histogram) |
bool | GetCachedImageHistogram (int z, int stokes, int num_bins, const HistogramBounds &bounds, Histogram &hist) |
bool | GetCachedCubeHistogram (int stokes, int num_bins, const HistogramBounds &bounds, Histogram &hist) |
bool | HasSpectralConfig (const SpectralConfig &config) |
bool | ExportCASAImage (casacore::ImageInterface< casacore::Float > &image, fs::path output_filename, std::string &message) |
bool | ExportFITSImage (casacore::ImageInterface< casacore::Float > &image, fs::path output_filename, std::string &message) |
void | ValidateChannelStokes (std::vector< int > &channels, std::vector< int > &stokes, const CARTA::SaveFile &save_file_msg) |
casacore::Slicer | GetExportImageSlicer (const CARTA::SaveFile &save_file_msg, casacore::IPosition image_shape) |
casacore::Slicer | GetExportRegionSlicer (const CARTA::SaveFile &save_file_msg, casacore::IPosition image_shape, casacore::IPosition region_shape, casacore::LattRegionHolder &latt_region_holder) |
int | CacheKey (int z, int stokes) |
bool | DoVectorFieldCalculation (const std::function< void(CARTA::VectorOverlayTileData &)> &callback) |
carta::Frame::Frame | ( | uint32_t | session_id, |
std::shared_ptr< FileLoader > | loader, | ||
const std::string & | hdu, | ||
int | default_z = DEFAULT_Z , |
||
bool | load_image_cache = true |
||
) |
|
inline |
|
protected |
AxesInfo carta::Frame::Axes | ( | ) |
void carta::Frame::CacheCubeHistogram | ( | int | stokes, |
Histogram & | hist | ||
) |
void carta::Frame::CacheCubeStats | ( | int | stokes, |
BasicStats< float > & | stats | ||
) |
|
inlineprotected |
bool carta::Frame::CalculateHistogram | ( | int | region_id, |
int | z, | ||
int | stokes, | ||
int | num_bins, | ||
const HistogramBounds & | bounds, | ||
Histogram & | hist | ||
) |
bool carta::Frame::CalculateMoments | ( | int | file_id, |
GeneratorProgressCallback | progress_callback, | ||
const StokesRegion & | stokes_region, | ||
const CARTA::MomentRequest & | moment_request, | ||
CARTA::MomentResponse & | moment_response, | ||
std::vector< GeneratedImage > & | collapse_results, | ||
RegionState | region_state = RegionState() |
||
) |
bool carta::Frame::CalculateVectorField | ( | const std::function< void(CARTA::VectorOverlayTileData &)> & | callback | ) |
|
protected |
|
protected |
void carta::Frame::CloseCachedImage | ( | const std::string & | file | ) |
bool carta::Frame::ContourImage | ( | ContourCallback & | partial_contour_callback, |
int | channel | ||
) |
std::shared_ptr< casacore::CoordinateSystem > carta::Frame::CoordinateSystem | ( | const StokesSource & | stokes_source = StokesSource() | ) |
int carta::Frame::CurrentStokes | ( | ) |
int carta::Frame::CurrentZ | ( | ) |
size_t carta::Frame::Depth | ( | ) |
DimsInfo carta::Frame::Dims | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool carta::Frame::FillRasterTileData | ( | CARTA::RasterTileData & | raster_tile_data, |
const Tile & | tile, | ||
int | z, | ||
int | stokes, | ||
CARTA::CompressionType | compression_type, | ||
float | compression_quality, | ||
bool | is_current_z | ||
) |
bool carta::Frame::FillRegionHistogramData | ( | std::function< void(CARTA::RegionHistogramData histogram_data)> | region_histogram_callback, |
int | region_id, | ||
int | file_id, | ||
bool | channel_changed | ||
) |
bool carta::Frame::FillRegionStatsData | ( | std::function< void(CARTA::RegionStatsData stats_data)> | stats_data_callback, |
int | region_id, | ||
int | file_id | ||
) |
bool carta::Frame::FillSpatialProfileData | ( | PointXy | point, |
std::vector< CARTA::SetSpatialRequirements_SpatialConfig > | spatial_configs, | ||
std::vector< CARTA::SpatialProfileData > & | spatial_data_vec | ||
) |
bool carta::Frame::FillSpatialProfileData | ( | std::vector< CARTA::SpatialProfileData > & | spatial_data_vec | ) |
bool carta::Frame::FillSpectralProfileData | ( | std::function< void(CARTA::SpectralProfileData profile_data)> | cb, |
int | region_id, | ||
bool | stokes_changed | ||
) |
bool carta::Frame::FitImage | ( | const CARTA::FittingRequest & | fitting_request, |
CARTA::FittingResponse & | fitting_response, | ||
GeneratedImage & | model_image, | ||
GeneratedImage & | residual_image, | ||
GeneratorProgressCallback | progress_callback, | ||
StokesRegion * | stokes_region = nullptr |
||
) |
std::shared_mutex & carta::Frame::GetActiveTaskMutex | ( | ) |
|
inline |
bool carta::Frame::GetBasicStats | ( | int | z, |
int | stokes, | ||
BasicStats< float > & | stats | ||
) |
bool carta::Frame::GetBeams | ( | std::vector< CARTA::Beam > & | beams | ) |
|
protected |
|
protected |
|
inline |
bool carta::Frame::GetCubeHistogramConfig | ( | HistogramConfig & | config | ) |
bool carta::Frame::GetDownsampledRasterData | ( | std::vector< float > & | data, |
int & | downsampled_width, | ||
int & | downsampled_height, | ||
int | z, | ||
int | stokes, | ||
CARTA::ImageBounds & | bounds, | ||
int | mip | ||
) |
std::string carta::Frame::GetErrorMessage | ( | ) |
|
protected |
|
protected |
std::string carta::Frame::GetFileName | ( | ) |
|
inline |
bool carta::Frame::GetImageRegion | ( | int | file_id, |
const AxisRange & | z_range, | ||
int | stokes, | ||
StokesRegion & | stokes_region | ||
) |
std::shared_ptr< casacore::LCRegion > carta::Frame::GetImageRegion | ( | int | file_id, |
std::shared_ptr< Region > | region, | ||
const StokesSource & | stokes_source = StokesSource() , |
||
bool | report_error = true |
||
) |
StokesSlicer carta::Frame::GetImageSlicer | ( | const AxisRange & | x_range, |
const AxisRange & | y_range, | ||
const AxisRange & | z_range, | ||
int | stokes | ||
) |
StokesSlicer carta::Frame::GetImageSlicer | ( | const AxisRange & | z_range, |
int | stokes | ||
) |
bool carta::Frame::GetLoaderPointSpectralData | ( | std::vector< float > & | profile, |
int | stokes, | ||
CARTA::Point & | point | ||
) |
bool carta::Frame::GetLoaderSpectralData | ( | int | region_id, |
const AxisRange & | z_range, | ||
int | stokes, | ||
const casacore::ArrayLattice< casacore::Bool > & | mask, | ||
const casacore::IPosition & | origin, | ||
std::map< CARTA::StatsType, std::vector< double > > & | results, | ||
float & | progress | ||
) |
|
protected |
|
protected |
bool carta::Frame::GetRegionData | ( | const StokesRegion & | stokes_region, |
std::vector< float > & | data, | ||
bool | report_performance = true |
||
) |
casacore::IPosition carta::Frame::GetRegionShape | ( | const StokesRegion & | stokes_region | ) |
bool carta::Frame::GetRegionStats | ( | const StokesRegion & | stokes_region, |
const std::vector< CARTA::StatsType > & | required_stats, | ||
bool | per_z, | ||
std::map< CARTA::StatsType, std::vector< double > > & | stats_values | ||
) |
bool carta::Frame::GetRegionSubImage | ( | const StokesRegion & | stokes_region, |
casacore::SubImage< float > & | sub_image | ||
) |
bool carta::Frame::GetSlicerData | ( | const StokesSlicer & | stokes_slicer, |
float * | data | ||
) |
bool carta::Frame::GetSlicerStats | ( | const StokesSlicer & | stokes_slicer, |
std::vector< CARTA::StatsType > & | required_stats, | ||
bool | per_z, | ||
std::map< CARTA::StatsType, std::vector< double > > & | stats_values | ||
) |
bool carta::Frame::GetSlicerSubImage | ( | const StokesSlicer & | stokes_slicer, |
casacore::SubImage< float > & | sub_image | ||
) |
std::string carta::Frame::GetStokesType | ( | int | stokes_index | ) |
bool carta::Frame::GetStokesTypeIndex | ( | const string & | coordinate, |
int & | stokes_index | ||
) |
|
protected |
|
protected |
size_t carta::Frame::Height | ( | ) |
casacore::IPosition carta::Frame::ImageShape | ( | const StokesSource & | stokes_source = StokesSource() | ) |
|
protected |
bool carta::Frame::IsConnected | ( | ) |
bool carta::Frame::IsCurrentZStokes | ( | const StokesSource & | stokes_source | ) |
bool carta::Frame::IsValid | ( | ) |
size_t carta::Frame::NumStokes | ( | ) |
void carta::Frame::SaveFile | ( | const std::string & | root_folder, |
const CARTA::SaveFile & | save_file_msg, | ||
CARTA::SaveFileAck & | save_file_ack, | ||
std::shared_ptr< Region > | image_region | ||
) |
|
inline |
bool carta::Frame::SetContourParameters | ( | const CARTA::SetContourParameters & | message | ) |
bool carta::Frame::SetCursor | ( | float | x, |
float | y | ||
) |
bool carta::Frame::SetHistogramRequirements | ( | int | region_id, |
const std::vector< CARTA::HistogramConfig > & | histogram_configs | ||
) |
bool carta::Frame::SetImageChannels | ( | int | new_z, |
int | new_stokes, | ||
std::string & | message | ||
) |
void carta::Frame::SetSpatialRequirements | ( | const std::vector< CARTA::SetSpatialRequirements_SpatialConfig > & | spatial_profiles | ) |
bool carta::Frame::SetSpectralRequirements | ( | int | region_id, |
const std::vector< CARTA::SetSpectralRequirements_SpectralConfig > & | spectral_configs | ||
) |
bool carta::Frame::SetStatsRequirements | ( | int | region_id, |
const std::vector< CARTA::SetStatsRequirements_StatsConfig > & | stats_configs | ||
) |
bool carta::Frame::SetVectorOverlayParameters | ( | const CARTA::SetVectorOverlayParameters & | message | ) |
int carta::Frame::SpectralAxis | ( | ) |
int carta::Frame::StokesAxis | ( | ) |
void carta::Frame::StopFitting | ( | ) |
void carta::Frame::StopMomentCalc | ( | ) |
bool carta::Frame::UseLoaderSpectralData | ( | const casacore::IPosition & | region_shape | ) |
|
protected |
void carta::Frame::WaitForTaskCancellation | ( | ) |
size_t carta::Frame::Width | ( | ) |
int carta::Frame::XAxis | ( | ) |
int carta::Frame::YAxis | ( | ) |
int carta::Frame::ZAxis | ( | ) |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |