 (defstruct acq-settings :frames :positions :channels :slices :slices-first
   :time-first :keep-shutter-open-slices :keep-shutter-open-channels
   :use-autofocus :autofocus-skip :relative-slices :exposure :interval-ms)
+
+(defn pairs [x]
+  (partition 2 1 (concat x [nil])))
 
 (defn first-not-nil [& args]
   (first (filter (comp not nil?) args)))

        b [[frames :frame] [positions :position]]
        b (if time-first b (reverse b))]
    (concat a b)))

(defn create-loops [dimensions]
  (reduce #(apply (partial nest-loop %1) %2) [{:task :snap}] dimensions))

(defn get-use-z-stack [channel]
  (first-not-nil (:use-z-stack channel) (.doZStack_ channel)))

(defn make-dimensions [settings]
  (let [{:keys [slices channels frames positions
                slices-first time-first]} settings
