                   1 [(.x stage-pos)]
                   2 [(.x stage-pos) (.y stage-pos)])])))}))
 
-(defn get-msp [idx]
+(defn get-msp
+  "Get a MultiStagePosition object from the Position List with the specified
+   index number."
+  [idx]
   (when idx
     (let [p-list (. gui getPositionList)]
       (when (pos? (. p-list getNumberOfPositions))
         (.getPosition p-list idx)))))
 
-(defn get-msp-z-position [idx z-stage]
+(defn get-msp-z-position
+  "Get the z position for a given z-stage from the MultiStagePosition
+   with the given index in the Position List."
+  [idx z-stage]
   (if-let [msp (get-msp idx)]
     (if-let [stage-pos (. msp get z-stage)]
       (. stage-pos x))))
 
-(defn set-msp-z-position [idx z-stage z]
+(defn set-msp-z-position
+  "Set the z position for a given z-stage from the MultiStagePosition
+   with the given index in the Position List."
+  [idx z-stage z]
   (when-let [msp (get-msp idx)]
     (when-let [stage-pos (. msp (get z-stage))]
       (set! (. stage-pos x) z))))
 
-(defn str-vector [str-seq]
+(defn str-vector
+  "Convert a sequence of strings into a Micro-Manager StrVector."
+  [str-seq]
   (let [v (StrVector.)]
     (doseq [item str-seq]
       (.add v item))
     v))
 
 (defn double-vector [doubles]
+  "Convert a sequence of numbers to a Micro-Manager DoubleVector."
   (let [v (DoubleVector.)]
     (doseq [item doubles]
       (.add v item))

    (do ~@body)
    (when different# (~setter perm#)))))
    
(defmacro with-core-setting [gst & body]
  (let [[getter setter temp] gst]
    `(with-setting [#(core ~getter) #(core ~setter %) ~temp] ~@body)))


          (core defineStateLabel dev i (get state-labels i)))))
    (log "...reloading of " dev " has apparently succeeded.")))

(defn json-to-data
  "Take a JSON object and convert it to a clojure data object."
  [json]
  (condp #(isa? (type %2) %1) json
    JSONObject
      (let [keys (iterator-seq (.keys json))]
