Skip to content

How do I decide orientation for background image import?

Use the SGE visualization from sge_convert as your orientation reference. Compare your raw background image against it to determine whether the image needs rotation and/or flips before it is imported.

Use the north-up reference

sge_convert --sge-visual --north-up writes xy_northup.tif (next to xy.png), the SGE rendered in the north-up view that CartoScope displays. Compare against xy_northup.tif, not xy.png.

  1. Generate SGE reference image:
  2. Run sge_convert with --sge-visual --north-up.
  3. Locate xy_northup.tif in the SGE output directory.
  4. Open your background image and xy_northup.tif side by side.
  5. Match major landmarks (tissue outline, empty corners, distinctive structures).
  6. Infer the transform:
  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.

Applying the transform

  • import_image: --rotate 90|180|270, --flip-horizontal, --flip-vertical.
  • run_together: the same transform as the rotate, flip_horizontal, and flip_vertical keys of the image's entry (--image, the --images sheet, or the config). See Image Modalities for which image kinds honor them.

Practical tips

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

See also: