                 :snap (collect-snap-image)
                 :init-burst (collect-burst-image)
                 :collect-burst (collect-burst-image))]
-    (.put out-queue (annotate-image image event @state))))
+    (.put out-queue (make-TaggedImage (annotate-image image event @state)))))
 
 (defn compute-z-position [event]
   (if-let [z-drive (:z-drive event)]


;; acquire button

(def current-acquire-win (atom nil))

(defn acquire-single [position-index]
  (core snapImage)
  (let [w (core getImageWidth)
        h (core getImageHeight)
        summary {:interval-ms 0.0, :use-autofocus false, :autofocus-skip 0,
                 :relative-slices true, :keep-shutter-open-slices false, :comment "",
                 :prefix "Untitled", :root "/Users/arthur/AcquisitionData",
                 :time-first false, :positions (), :channels (), :slices-first true,
                 :slices nil, :numFrames 0, :keep-shutter-open-channels false,
                 :zReference 0.0, :frames (), :save false}
        event   {:position-index position-index, :position -1,
                 :frame-index 0, :slice 0.0, :channel-index 0, :slice-index 0, :frame 0
                 :channel {:name (core getCurrentConfig (core getChannelGroup))},
                 :exposure (core getExposure), :relative-z true,
                 :task :snap, :z-drive (core getFocusDevice), :wait-time-ms 0}
        state   {:init-width w :init-height h}
        summary-metadata (make-summary-metadata summary)
        tagged-image (annotate-image (collect-snap-image) event state)]
	  (if-not @current-acquire-win
	    (let [cache (MMImageCache. (TaggedImageStorageRam. summary-metadata))
	          display (doto (VirtualAcquisitionDisplay. "" true false)
	                        (.setCache cache) .initialize)]
	          (reset! current-acquire-win {:cache cache :display display})))
	  (let [{:keys [display cache]} @current-acquire-win]
      (.putImage cache tagged-image)
      (doto display (.showImage tagged-image)))))

;; java interop


       "UUID" (UUID/randomUUID)
       "Width"  (state :init-width)
       "ZPositionUm" (state :last-z-position)
      })})

(defn make-TaggedImage [annotated-img]
  (TaggedImage. (:pix annotated-img) (JSONObject. (:tags annotated-img))))

;; acq-engine

