Skip to content

How do I decide orientation for background image import?

Use xy.png from sge_convert as your orientation reference. Compare your raw background image against this xy.png to determine whether your image needs rotation and/or flips before import_image.

Reference xy.png

Ensure xy.png is already georeferenced in a north-up view (see --north-up in sge_convert )

  1. Generate SGE reference image:
  2. Run sge_convert with --sge-visual --north-up.
  3. Locate xy.png in the SGE output directory.
  4. Open your background image and xy.png side by side.
  5. Match major landmarks (tissue outline, empty corners, distinctive structures).
  6. Infer transform for import_image:
  7. Rotation: --rotate 90, --rotate 180, or --rotate 270
  8. Flips: --flip-horizontal and/or --flip-vertical
  9. Run a quick trial import and verify overlap in the viewer.
  10. If needed, adjust transform and rerun.

Practical tips

  • Start with rotation only; add flips only if left/right or up/down are mirrored.
  • Rotation is applied before flips in import_image.
  • Keep one transform per image source and reuse it for consistency.

See also: