spatialdata.transformations.get_transformation(element, to_coordinate_system=None, get_all=False)#

Get the transformation/s of an element.

  • element (Union[SpatialImage, MultiscaleSpatialImage, GeoDataFrame, DataFrame]) – The element.

  • to_coordinate_system (Optional[str] (default: None)) –

    The coordinate system to which the transformation should be returned.

    • If None and get_all=False returns the transformation from the ‘global’ coordinate system (default system).

    • If None and get_all=True returns all transformations.

  • get_all (bool (default: False)) – If True, all transformations are returned. If True, to_coordinate_system needs to be None.

Return type:

Union[BaseTransformation, dict[str, BaseTransformation]]


: The transformation, if to_coordinate_system is not None, otherwise a dictionary of transformations to all the coordinate systems.