            [org.micromanager.acquisition.engine SequenceSettings]
            [org.micromanager.navigation MultiStagePosition]
            [java.util.prefs Preferences]))
+
+
+
+;; java interop
+(defn data-object-to-map [obj]
+  (into {}
+    (for [f (.getFields (type obj))
+          :when (zero? (bit-and
+                         (.getModifiers f) java.lang.reflect.Modifier/STATIC))]
+      [(keyword (.getName f)) (.get f obj)])))
+
+;; utils
+(defn rekey
+  ([m kold knew]
+    (-> m (dissoc kold) (assoc knew (get m kold))))
+  ([m k1old k1new & ks]
+    (reduce #(rekey %1 (first %2) (second %2))
+      m (partition 2 (conj ks k1new k1old)))))
 
 
 ; engine

(defn run-acquisition [params] 
  (println params))

(defn compute-verbose-summary [params]
   "meh")

;; java interop
(defn data-object-to-map [obj]
  (into {}
    (for [f (.getFields (type obj))
          :when (zero? (bit-and
                         (.getModifiers f) java.lang.reflect.Modifier/STATIC))]
      [(keyword (.getName f)) (.get f obj)])))

;; utils
(defn rekey
  ([m kold knew]
    (-> m (dissoc kold) (assoc knew (get m kold))))
  ([m k1old k1new & ks]
    (reduce #(rekey %1 (first %2) (second %2))
      m (partition 2 (conj ks k1new k1old)))))


;; AcquisitionEngine implementation

  (doto
    (proxy [AcquisitionWrapperEngine] []
      (runPipeline [^SequenceSettings settings]
        (run-acquisition-from-settings settings)))
    (.setCore mmc (.getAutofocusManager gui))
    (.setParentGUI gui)))

