           (mm/core waitForDevice (mm/core getXYStageDevice))
           (let [acq-settings (create-acquisition-settings)
                 affine-stage-to-pixel (origin-here-stage-to-pixel-transform)
-                z-origin (mm/core getPosition (mm/core getFocusDevice))
+                z-origin (if-let [z-drive (focus-device)]
+                           (mm/core getPosition z-drive)
+                           0 )
                 first-seq (acquire-at (affine/inverse-transform
                                         (Point. 0 0) affine-stage-to-pixel)
                                       z-origin

(defn pixel-size-um
  "Compute the pixel size from a stage-to-pixel transform."
  [stage-to-pixel-transform]
  (Math/pow (.getDeterminant stage-to-pixel-transform) -1/2))

;; tagged image stuff



(defn set-z-position
  [z]
  (when-let [stage (focus-device)]
    (when (not= z (@current-z-positions stage))
      (mm/core setPosition stage z)
      (mm/core waitForDevice stage))
