Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce "frame-of-reference" (#123)
* Add coordinate systems documentation and diagram Added a new documentation file `coordinate_systems.markdown` to the Doxyfile's INPUT section. Introduced a "Coordinate Systems" section in the new file with a header and placeholder description for CZI and libCZI coordinate systems. Also, added a new diagram in `coordinate_systems.drawio` named "Page-1" that includes graphical elements representing a coordinate system with labeled axes. * Update coordinate systems documentation in libCZI * Improve documentation clarity for coordinate systems Rephrased a sentence in `coordinate_systems.markdown` for clarity. Updated comments in `libCZI.h` to clarify bounding boxes and coordinate systems. Enhanced `libCZI_Compositor.h` comments to specify ROI and positions in the 'raw-subblock-coordinate-system'. Removed summary tags and redundant information to streamline documentation. These changes provide clearer and more precise descriptions of coordinate systems and bounding boxes in libCZI. * Update project to version 0.62.7 Updated CMakeLists.txt to change project version from 0.62.6 to 0.62.7. Added a new entry in version-history.markdown for version 0.62.7, documenting a "documentation update" linked to pull request #122. * remove "high-res-bitmaps" * wip * fix table * cosmetic * Refactor coordinate transformation methods Added TransformPoint to CCZIReader for point transformations. Updated CZIReader.h to declare TransformPoint method. Modified CSingleChannelTileAccessor::Get to use TransformRectangle. Added TransformRectangle to ISubBlockRepository in libCZI.h. Introduced IntPoint and IntPointAndFrameOfReference structures. Removed ConvertToFrameOfReference function from libCZI_Utilities. Minor formatting changes in libCZI.h and libCZI_Utilities.h. Improved code design, readability, and maintainability. * Update TransformPoint to return IntPointAndFrameOfReference Updated TransformPoint method to return libCZI::IntPointAndFrameOfReference instead of libCZI::IntPoint. This change is reflected across various classes and interfaces, including CCZIReader, CziReaderWriter, and libCZI::ISubBlockRepository. Added a new member variable default_frame_of_reference to CCZIReader and libCZI::Options to handle cases where the frame of reference is set to Default. Updated TransformRectangle method to handle the new return type of TransformPoint. Implemented changes in test_TileAccessorCoverageOptimization.cpp to reflect the new return type. * Add frame of reference handling and related tests - Initialize `default_frame_of_reference` to `CZIFrameOfReference::Invalid` in `CCZIReader` constructor. - Update `CCZIReader::Open` to use a switch statement for `options->default_frame_of_reference`. - Modify `ISubBlockRepository::TransformRectangle` to return `IntRectAndFrameOfReference`. - Update `CSingleChannelTileAccessor::Get` to use the `rectangle` member of `IntRectAndFrameOfReference`. - Add `test_frame_of_reference_transform.cpp` with tests for point and rectangle transformations. - Include new test file in `libCZI_UnitTests` target in `CMakeLists.txt`. * linter * cosmetic * Refactor TransformPoint and add new tests Refactored `CCZIReader::TransformPoint` for robust frame-of-reference transformations. Updated `AccessorType` enum in `libCZI_Compositor.h` to use `std::uint8_t`. Corrected typo in `backGroundColor` comment. Added `Check2x2Gray8Bitmap` function and new tests in `test_frame_of_reference_transform.cpp` for point transformations and tile composite verification. * Add TransformPoint method and default frame of reference Implemented TransformPoint in CCziReaderWriter for frame-of-reference transformations. Added GetDefaultFrameOfReference method and updated ICziReaderWriterInfo interface. Fixed formatting issues and improved type safety. Added test case for TransformPoint. Updated documentation and constructor initialization. Handled unsupported transformations with exceptions. * Update bounding-box and transformation expectations Updated the comment to reflect the correct bounding-box (0, -1, 1, 1) and transformation result (0, -1) after removing subblocks. Adjusted the test assertion for the y-coordinate of the transformed point to expect -1 instead of 0. * Refactor and cleanup in SingleChannelTileAccessor Modified the constructor in SingleChannelTileAccessor.cpp to make roi_raw_sub_block_cs a const IntRect, ensuring immutability. Removed a commented-out Get method declaration in SingleChannelTileAccessor.h for improved readability. * Refactor to use IntPointAndFrameOfReference type Updated method signatures in SingleChannelTileAccessor.cpp and .h to use IntPointAndFrameOfReference instead of separate xPos and yPos parameters. Adjusted libCZI_Compositor.h to reflect these changes and added inline methods for backward compatibility. Updated ISingleChannelTileAccessor destructor to use override keyword for modern C++ standards adherence. * linter * Improve comment formatting in Z-order description Added a space after the period in the comment describing the Z-order behavior when `sortByM` is false. This change enhances readability and consistency of the comments in the codebase. * Refactor Get methods and update documentation - Updated `Get` methods in `CSingleChannelScalingTileAccessor` and `libCZI::ISingleChannelScalingTileAccessor` to use `IntRectAndFrameOfReference` instead of `IntRect`. - Added overloads to handle `IntRect` by converting to `IntRectAndFrameOfReference`. - Modified `InternalCalcSize` to use the transformed rectangle in the raw sub-block coordinate system. - Corrected typo in `Options` struct documentation ("back ground color" to "background color"). - Updated `SingleChannelScalingTileAccessorHandler` in `test_TileAccessorCoverageOptimization.cpp` to use a shared pointer to `ISingleChannelScalingTileAccessor`. - Added documentation to `libCZI::ISingleChannelScalingTileAccessor` interface for new `Get` methods and their parameters. * Refactor coordinate handling to use explicit frames Updated SingleChannelPyramidLevelTileAccessor to use IntRectAndFrameOfReference and IntPointAndFrameOfReference for coordinates, ensuring explicit frame of reference handling. Transformed input coordinates to RawSubBlockCoordinateSystem in Get methods for consistency. Updated InternalGet method accordingly. Modified libCZI_Compositor.h to reflect new method signatures and retained old methods with internal transformations. Improved clarity and correctness of coordinate handling. * Refactor ROI coordinate calculation and formatting Updated ROI calculation to use boundingBoxLayer0Only instead of boundingBox for relative coordinates in execute.cpp and executeBase.cpp. Applied consistent changes across multiple sections. Added spaces after commas in ROI initialization for better readability. * Update project to version 0.63.0 Updated CMakeLists.txt to change project version from 0.62.7 to 0.63.0. Added a new entry in version-history.markdown for version 0.63.0, documenting the introduction of "frames-of-reference". The entry for version 0.62.7 remains unchanged. * add documentation * fix typos * Update Src/CZICmd/execute.cpp Co-authored-by: m-aXimilian <[email protected]> * Update Src/libCZI/libCZI_ReadWrite.h Co-authored-by: m-aXimilian <[email protected]> * Simplify return statements with brace-enclosed initializer Simplified the return statements in two conditional blocks by removing the explicit type `libCZI::IntPointAndFrameOfReference` and using the brace-enclosed initializer list directly. This change makes the code more concise and leverages the compiler's ability to deduce the return type. --------- Co-authored-by: m-aXimilian <[email protected]>
- Loading branch information