    :tags (mm/json-to-data (.tags tagged-image))})
 
 ;; stage communications
+
+(defn non-empty [x]
+  (when-not (empty? x) x))
+
+(defn focus-device []
+  (non-empty (mm/core getFocusDevice)))
 
 (defn get-xy-position []
   (mm/core waitForDevice (mm/core getXYStageDevice))

(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


          (mm/core waitForDevice (mm/core getXYStageDevice))
          (let [acq-settings (create-acquisition-settings)
                affine-stage-to-pixel (origin-here-stage-to-pixel-transform)
                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
