 (defn stop []
   (when-let [acq-thread (:acq-thread (.state last-acq))]
     (.stop acq-thread)))
-

  (doseq [[[d p] vals] property-sequences]
    (core startPropertySequence d p)
    (swap! state assoc-in [:last-property-settings d p] (last vals))))
          
(defn start-slice-sequence [slices]
  (let [z-stage (core getFocusDevice)]
    (core startStageSequence z-stage)

    (let [n (long (core getNumberOfComponents))]
      (set-property default-cam)
      (get {1 1 , 4 3} n))))

(defn super-channels [simple-channel camera-channel-names]
  (if (< 1 (count camera-channel-names))
    (map #(update-in simple-channel [:name] super-channel-name %)
         camera-channel-names)
    simple-channel))

(defn all-super-channels [simple-channels camera-channel-names]
  (flatten (map #(super-channels % camera-channel-names) simple-channels)))

(defn channel-colors [simple-channels super-channels channel-names]
  (if (= (count simple-channels) (count super-channels))
    (map #(.getRGB (:color %)) super-channels)
    (map #(. MMAcquisition getMultiCamDefaultChannelColor % (channel-names %))
         (range (count super-channels)))))

(defn make-summary-metadata [settings]
  (let [depth (core getBytesPerPixel)
        channels (:channels settings)
        num-camera-channels (core getNumberOfCameraChannels)
        simple-channels (if-not (empty? channels)
                          channels
                          [{:name "Default" :color java.awt.Color/WHITE}])
        super-channels (all-super-channels simple-channels 
                                           (get-camera-channel-names))
        ch-names (vec (map :name super-channels))]
     (JSONObject. {
      "BitDepth" (core getImageBitDepth)
