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

#include <RegionConverter.h>

Collaboration diagram for carta::RegionConverter:
[legend]

Public Member Functions

 RegionConverter (const RegionState &state, std::shared_ptr< casacore::CoordinateSystem > csys)
 
std::shared_ptr< casacore::LCRegion > GetCachedLCRegion (int file_id, bool use_approx_polygon=true)
 
std::shared_ptr< casacore::LCRegion > GetImageRegion (int file_id, std::shared_ptr< casacore::CoordinateSystem > csys, const casacore::IPosition &shape, const StokesSource &stokes_source=StokesSource(), bool report_error=true)
 
casacore::TableRecord GetImageRegionRecord (int file_id, std::shared_ptr< casacore::CoordinateSystem > csys, const casacore::IPosition &shape)
 

Private Member Functions

void SetReferenceWCRegion ()
 
bool ReferenceRegionValid ()
 
bool RectangleControlPointsToWorld (std::vector< casacore::Quantity > &wcs_points)
 
bool EllipseControlPointsToWorld (std::vector< casacore::Quantity > &wcs_points, float &ellipse_rotation)
 
bool CartaPointToWorld (const CARTA::Point &point, std::vector< casacore::Quantity > &world_point)
 
std::shared_ptr< casacore::LCRegion > GetConvertedLCRegion (int file_id, std::shared_ptr< casacore::CoordinateSystem > output_csys, const casacore::IPosition &output_shape, const StokesSource &stokes_source=StokesSource(), bool report_error=true)
 
bool UseApproximatePolygon (std::shared_ptr< casacore::CoordinateSystem > output_csys)
 
std::vector< CARTA::Point > GetRectangleMidpoints ()
 
std::shared_ptr< casacore::LCRegion > GetAppliedPolygonRegion (int file_id, std::shared_ptr< casacore::CoordinateSystem > output_csys, const casacore::IPosition &output_shape, bool has_distortion)
 
std::vector< std::vector< CARTA::Point > > GetReferencePolygonPoints (int num_vertices, bool has_distortion)
 
std::vector< std::vector< CARTA::Point > > GetApproximatePolygonPoints (int num_vertices, bool has_distortion)
 
std::vector< CARTA::Point > GetApproximateEllipsePoints (int num_vertices)
 
double GetTotalSegmentLength (std::vector< CARTA::Point > &points)
 
void RemoveHorizontalPolygonPoints (casacore::Vector< casacore::Double > &x, casacore::Vector< casacore::Double > &y)
 
bool ValuesNear (float val1, float val2)
 
casacore::TableRecord GetRegionPointsRecord (std::shared_ptr< casacore::CoordinateSystem > output_csys, const casacore::IPosition &output_shape)
 
void CompleteLCRegionRecord (casacore::TableRecord &record, const casacore::IPosition &shape)
 
casacore::TableRecord GetPointRecord (std::shared_ptr< casacore::CoordinateSystem > output_csys, const casacore::IPosition &output_shape)
 
casacore::TableRecord GetLineRecord (std::shared_ptr< casacore::CoordinateSystem > image_csys)
 
casacore::TableRecord GetPolygonRecord (std::shared_ptr< casacore::CoordinateSystem > output_csys)
 
casacore::TableRecord GetRotboxRecord (std::shared_ptr< casacore::CoordinateSystem > output_csys)
 
casacore::TableRecord GetEllipseRecord (std::shared_ptr< casacore::CoordinateSystem > output_csys)
 
bool PointsToImagePixels (const std::vector< CARTA::Point > &points, std::shared_ptr< casacore::CoordinateSystem > output_csys, casacore::Vector< casacore::Double > &x, casacore::Vector< casacore::Double > &y)
 
bool WorldPointToImagePixels (std::vector< casacore::Quantity > &world_point, std::shared_ptr< casacore::CoordinateSystem > output_csys, casacore::Vector< casacore::Double > &pixel_point)
 

Private Attributes

RegionState _region_state
 
std::shared_ptr< casacore::CoordinateSystem > _reference_coord_sys
 
std::vector< casacore::Quantity > _wcs_control_points
 
std::shared_ptr< casacore::WCRegion > _reference_region
 
bool _reference_region_set
 
std::mutex _region_mutex
 
std::unordered_map< int, std::shared_ptr< casacore::LCRegion > > _converted_regions
 
std::unordered_map< int, std::shared_ptr< casacore::LCRegion > > _polygon_regions
 

Constructor & Destructor Documentation

◆ RegionConverter()

RegionConverter::RegionConverter ( const RegionState state,
std::shared_ptr< casacore::CoordinateSystem >  csys 
)

Member Function Documentation

◆ CartaPointToWorld()

bool RegionConverter::CartaPointToWorld ( const CARTA::Point &  point,
std::vector< casacore::Quantity > &  world_point 
)
private
Here is the caller graph for this function:

◆ CompleteLCRegionRecord()

void carta::RegionConverter::CompleteLCRegionRecord ( casacore::TableRecord &  record,
const casacore::IPosition &  shape 
)
private

◆ EllipseControlPointsToWorld()

bool RegionConverter::EllipseControlPointsToWorld ( std::vector< casacore::Quantity > &  wcs_points,
float &  ellipse_rotation 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAppliedPolygonRegion()

std::shared_ptr< casacore::LCRegion > RegionConverter::GetAppliedPolygonRegion ( int  file_id,
std::shared_ptr< casacore::CoordinateSystem >  output_csys,
const casacore::IPosition &  output_shape,
bool  has_distortion 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetApproximateEllipsePoints()

std::vector< CARTA::Point > RegionConverter::GetApproximateEllipsePoints ( int  num_vertices)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetApproximatePolygonPoints()

std::vector< std::vector< CARTA::Point > > RegionConverter::GetApproximatePolygonPoints ( int  num_vertices,
bool  has_distortion 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCachedLCRegion()

std::shared_ptr< casacore::LCRegion > RegionConverter::GetCachedLCRegion ( int  file_id,
bool  use_approx_polygon = true 
)
Here is the caller graph for this function:

◆ GetConvertedLCRegion()

std::shared_ptr< casacore::LCRegion > RegionConverter::GetConvertedLCRegion ( int  file_id,
std::shared_ptr< casacore::CoordinateSystem >  output_csys,
const casacore::IPosition &  output_shape,
const StokesSource stokes_source = StokesSource(),
bool  report_error = true 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEllipseRecord()

casacore::TableRecord RegionConverter::GetEllipseRecord ( std::shared_ptr< casacore::CoordinateSystem >  output_csys)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetImageRegion()

std::shared_ptr< casacore::LCRegion > RegionConverter::GetImageRegion ( int  file_id,
std::shared_ptr< casacore::CoordinateSystem >  csys,
const casacore::IPosition &  shape,
const StokesSource stokes_source = StokesSource(),
bool  report_error = true 
)
Here is the call graph for this function:

◆ GetImageRegionRecord()

casacore::TableRecord RegionConverter::GetImageRegionRecord ( int  file_id,
std::shared_ptr< casacore::CoordinateSystem >  csys,
const casacore::IPosition &  shape 
)
Here is the call graph for this function:

◆ GetLineRecord()

casacore::TableRecord RegionConverter::GetLineRecord ( std::shared_ptr< casacore::CoordinateSystem >  image_csys)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPointRecord()

casacore::TableRecord RegionConverter::GetPointRecord ( std::shared_ptr< casacore::CoordinateSystem >  output_csys,
const casacore::IPosition &  output_shape 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPolygonRecord()

casacore::TableRecord RegionConverter::GetPolygonRecord ( std::shared_ptr< casacore::CoordinateSystem >  output_csys)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRectangleMidpoints()

std::vector< CARTA::Point > RegionConverter::GetRectangleMidpoints ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetReferencePolygonPoints()

std::vector< std::vector< CARTA::Point > > RegionConverter::GetReferencePolygonPoints ( int  num_vertices,
bool  has_distortion 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRegionPointsRecord()

casacore::TableRecord RegionConverter::GetRegionPointsRecord ( std::shared_ptr< casacore::CoordinateSystem >  output_csys,
const casacore::IPosition &  output_shape 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRotboxRecord()

casacore::TableRecord RegionConverter::GetRotboxRecord ( std::shared_ptr< casacore::CoordinateSystem >  output_csys)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTotalSegmentLength()

double RegionConverter::GetTotalSegmentLength ( std::vector< CARTA::Point > &  points)
private
Here is the caller graph for this function:

◆ PointsToImagePixels()

bool RegionConverter::PointsToImagePixels ( const std::vector< CARTA::Point > &  points,
std::shared_ptr< casacore::CoordinateSystem >  output_csys,
casacore::Vector< casacore::Double > &  x,
casacore::Vector< casacore::Double > &  y 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RectangleControlPointsToWorld()

bool RegionConverter::RectangleControlPointsToWorld ( std::vector< casacore::Quantity > &  wcs_points)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReferenceRegionValid()

bool RegionConverter::ReferenceRegionValid ( )
private
Here is the caller graph for this function:

◆ RemoveHorizontalPolygonPoints()

void RegionConverter::RemoveHorizontalPolygonPoints ( casacore::Vector< casacore::Double > &  x,
casacore::Vector< casacore::Double > &  y 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetReferenceWCRegion()

void RegionConverter::SetReferenceWCRegion ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UseApproximatePolygon()

bool RegionConverter::UseApproximatePolygon ( std::shared_ptr< casacore::CoordinateSystem >  output_csys)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ValuesNear()

bool RegionConverter::ValuesNear ( float  val1,
float  val2 
)
private
Here is the caller graph for this function:

◆ WorldPointToImagePixels()

bool RegionConverter::WorldPointToImagePixels ( std::vector< casacore::Quantity > &  world_point,
std::shared_ptr< casacore::CoordinateSystem >  output_csys,
casacore::Vector< casacore::Double > &  pixel_point 
)
private
Here is the caller graph for this function:

Member Data Documentation

◆ _converted_regions

std::unordered_map<int, std::shared_ptr<casacore::LCRegion> > carta::RegionConverter::_converted_regions
private

◆ _polygon_regions

std::unordered_map<int, std::shared_ptr<casacore::LCRegion> > carta::RegionConverter::_polygon_regions
private

◆ _reference_coord_sys

std::shared_ptr<casacore::CoordinateSystem> carta::RegionConverter::_reference_coord_sys
private

◆ _reference_region

std::shared_ptr<casacore::WCRegion> carta::RegionConverter::_reference_region
private

◆ _reference_region_set

bool carta::RegionConverter::_reference_region_set
private

◆ _region_mutex

std::mutex carta::RegionConverter::_region_mutex
private

◆ _region_state

RegionState carta::RegionConverter::_region_state
private

◆ _wcs_control_points

std::vector<casacore::Quantity> carta::RegionConverter::_wcs_control_points
private

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