Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Region conversions for matched images to a new class #1347

Closed
pford opened this issue Dec 6, 2023 · 0 comments · Fixed by #1352
Closed

Move Region conversions for matched images to a new class #1347

pford opened this issue Dec 6, 2023 · 0 comments · Fixed by #1352
Assignees
Labels
code maintenance For issues relating to code maintenance and quality performance
Milestone

Comments

@pford
Copy link
Collaborator

pford commented Dec 6, 2023

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.

@pford pford added performance code maintenance For issues relating to code maintenance and quality labels Dec 6, 2023
@pford pford added this to the v5.0-beta milestone Dec 6, 2023
@pford pford self-assigned this Dec 6, 2023
@pford pford linked a pull request Jan 23, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code maintenance For issues relating to code maintenance and quality performance
Projects
No open projects
Status: PR test and review
Development

Successfully merging a pull request may close this issue.

1 participant