            [org.micromanager.acquisition AcquisitionWrapperEngine LiveAcqDisplay]
            [org.micromanager.acquisition.engine SequenceSettings]
            [org.micromanager.navigation MultiStagePosition StagePosition]
-           [mmcorej TaggedImage]
+           [mmcorej TaggedImage Configuration]
            [java.util.prefs Preferences]
-           [org.micromanager.utils ChannelSpec]
+           [org.micromanager.utils ChannelSpec MDUtils]
            [org.json JSONObject]
            [java.util.concurrent LinkedBlockingQueue]))
 

   :xy-stage        (. mmc getXYStageDevice)
   :autofocus       (. mmc getAutoFocusDevice)
   :image-processor (. mmc getImageProcessorDevice)})

(defn get-config [group config]
  (let [data (. mmc getConfigData group config)

    (. mmc setShutterOpen false))
    (. mmc waitForDevice (. mmc getShutterDevice)))

(defn annotate-image [img event]
  (TaggedImage. img
    (JSONObject. (merge
      (map-config (. mmc getSystemStateCache))
      (generate-metadata event)
      {"ElapsedTime-ms" (clock-ms)}))))

(defn collect-image [event out-queue]
    (.add out-queue (annotate-image (. mmc getImage) event)))
  
(defn run-event [event last-wake-time out-queue]
  (run-actions (create-presnap-actions event))
