libCZI
Reading and Writing CZI documents made easy
|
As far as libCZI is concerned, there are two coordinate systems that are of interest:
libCZI at this point is using the raw-subblock-coordinate-system for all its operations. There are only a few operations where the choice of coordinate system is relevant: the accessor-functions which give tile-compositions.
This includes:
The coordinates of the ROIs passed in here are in the raw-subblock-coordinate-system.
The primary source of information regarding the "placement of subblocks on the XY-plane" is the method ISubBlockRepository::GetStatistics().
The structure SubBlockStatistics contains two rectangles:
property | description |
---|---|
boundingBox | The minimal AABB (= axis-aligned-bounding-box) of the logicalRects of all subblocks (in all pyramid-layers). |
boundingBoxLayer0Only | The minimal AABB of the logicalRects of all subblocks in pyramid-layer 0. |
Converting from the raw-subblock-coordinate-system to the CZI-Pixel-Coordinate-System is now straightforward: subtract the top-left point of the boundingBoxLayer0Only rectangle. The translation vector between the coordinate systems is then given by the top-left point of the boundingBoxLayer0Only rectangle.
Translating between both coordinate systems might be necessary when coordinate information is given from an external source (or by information embedded in the CZI itself). Since the CZI-Pixel-Coordinate-System is the recommended way to relate to spatial positions in a CZI, such external data will most likely be given in this coordinate system.
Within libCZI itself, no coordinate transformation is taking place so far, so all operations are consistently done in the raw-subblock-coordinate-system.