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
In this issue ome/ngff#146 I discuss a case in which affine transformations needed to be aware of the input and output coordinate systems in order to be specified, and I propose a solution to avoid this need and maintain the decoupling between coordinate systems and transformations.
Unfortunately this decoupling is not possible for those transformations types whose storage is not a description of the affine matrix itself (as it happens for instance for Affine, Translation, Scale, Rotation). Examples are Identity, MapIndex, MapAxis, Sequence.
Since for the visualization with napari we need an affine matrix, we need:
to define a .to_affine() abstract method for the Transformation class and implement it to all the transformation types;
pass input and output to .to_affine(), whenever this is necessary
I have addressed this. Now transformations have two more attributes: input_coordinate_system and output_coordinate_system. They can be None, but for calling to_affine() and transform_points() they need to be specified.
Some transformations could operate even when the input and output coordinate systems are not specified, like Identity, Translation, Scale, Rotation, but we enforce the explicit definition of input and output spaces.
Nevertheless, an edge cases from the specs allow the specification of transformations without making input and output spaces explicit when the transformations are part of a Sequence transformation. In the code, inside the Sequence, we are more restrictive: we try to infer the transformation, like if we combine Translation and Scale we know that we are operating all the time in the same input coordinate system of the Sequence transformation, but if we use Affine transformation inside the Sequence, we trigger an error since it's not clear which input and output axes are present. Same for MapAxis, input and output are required in order to know how it operates.
In this issue ome/ngff#146 I discuss a case in which affine transformations needed to be aware of the input and output coordinate systems in order to be specified, and I propose a solution to avoid this need and maintain the decoupling between coordinate systems and transformations.
Unfortunately this decoupling is not possible for those transformations types whose storage is not a description of the affine matrix itself (as it happens for instance for
Affine
,Translation
,Scale
,Rotation
). Examples areIdentity
,MapIndex
,MapAxis
,Sequence
.Since for the visualization with napari we need an affine matrix, we need:
.to_affine()
abstract method for theTransformation
class and implement it to all the transformation types;.to_affine()
, whenever this is necessaryThe signature will be
The text was updated successfully, but these errors were encountered: