You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regions are set using their control points (in pixel coordinates) and reference image coordinate system. When the Region needs to be expressed as a casacore::LCRegion (lattice coordinates, i.e. pixel) for analytics or export, its control points are converted to world coordinates to create a casacore::WCRegion, which can be converted to LCRegion in any image using its coordinate system and shape. This common code is used for matched and reference images, so even for the reference image the coordinates are converted pixel->world->pixel. In this case, it would be faster to create the LCRegion from the pixel coordinates.
I propose creating a RegionConverter class to handle the matched image case, so that the Region code only handles pixel coordinates, simplifying this class. RegionConverter will only be created and used in Region when needed for a matched image.
This issue was found while investigating the line spatial profiles performance (#1339) (where many LCRegions are created along the line), but should also improve the performance of other features using regions in the reference image. I am creating a separate issue because of the size of this change. As part of this development, Region tests will also be created to improve the code coverage metrics.
The text was updated successfully, but these errors were encountered:
Regions are set using their control points (in pixel coordinates) and reference image coordinate system. When the Region needs to be expressed as a casacore::LCRegion (lattice coordinates, i.e. pixel) for analytics or export, its control points are converted to world coordinates to create a casacore::WCRegion, which can be converted to LCRegion in any image using its coordinate system and shape. This common code is used for matched and reference images, so even for the reference image the coordinates are converted pixel->world->pixel. In this case, it would be faster to create the LCRegion from the pixel coordinates.
I propose creating a RegionConverter class to handle the matched image case, so that the Region code only handles pixel coordinates, simplifying this class. RegionConverter will only be created and used in Region when needed for a matched image.
This issue was found while investigating the line spatial profiles performance (#1339) (where many LCRegions are created along the line), but should also improve the performance of other features using regions in the reference image. I am creating a separate issue because of the size of this change. As part of this development, Region tests will also be created to improve the code coverage metrics.
The text was updated successfully, but these errors were encountered: