Coordinate systems#

A CoordinateSystem is attached to every Image. It converts between voxel indices (row, column, …) and Cartesian coordinates (x, y in metres, with the origin and axis orientation fixed by the image metadata). This is what lets you say “give me the region between (0.1, 0.1) and (0.4, 0.3) metres” instead of counting pixels.

cs = image.coordinatesystem
voxel = cs.voxel([0.25, 0.1])        # Cartesian -> pixel index
xy = cs.coordinate([100, 250])       # pixel index -> Cartesian
# cs.voxels / cs.coordinates do the same for arrays of points

Points and arrays of points#

DarSIA distinguishes coordinate kinds explicitly so an accidental row/column vs x/y swap is caught early:

Constructors make_coordinate(), make_voxel() and the to_* converters move between them.

Regions and patches#

  • Image.subregion() – cut out a rectangular ROI, given in voxels or as a Coordinate pair.

  • ROI – a named rectangle in physical coordinates, reused across a workflow.

  • Patches – tile an image into a regular grid of sub-images, e.g. for patch-wise illumination correction or local translation estimation.

  • CoordinateTransformation – align two images that share a scene but have different relative coordinate systems (this changes metadata, not pixels; contrast with the geometric corrections in Shape correction).

See also#