 (defn load-settings [dir]
   (read-string (slurp (io/file dir "metadata.txt"))))
 
+(defn pixels-not-calibrated []
+  (let [answer  (JOptionPane/showConfirmDialog
+                  nil
+                  "The current magnification setting needs to be calibrated.
+Would you like to run automatic pixel calibration?"
+                  "Pixel calibration required."
+                  JOptionPane/YES_NO_OPTION)]
+    (when (= answer JOptionPane/YES_OPTION)
+      (doto (eval '(org.micromanager.pixelcalibrator.PixelCalibratorPlugin.))
+        (.setApp (MMStudioMainFrame/getInstance));
+        .show))))
+
 ; Overall scheme
 ; the GUI is generally reactive.
 ; vars:

  "Set the current location to the origin of the 
   stage to pixel transform."
  []
  (affine/set-destination-origin
    (get-stage-to-pixel-transform)
    (.getXYStagePosition mm/gui)))

(defn pixel-size-um
  "Compute the pixel size from a stage-to-pixel transform."

           (java.awt.geom AffineTransform Point2D$Double)
           (java.util.prefs Preferences)
           (java.util.concurrent Executors)
           (javax.swing JOptionPane)
           (org.micromanager AcquisitionEngine2010 MMStudioMainFrame)
           (org.micromanager.utils ImageUtils JavaUtils)
           (org.micromanager.acquisition TaggedImageQueue))
