   (let [f (File. data-set "display_and_comments.txt")]
     (if (.exists f) (read-json (slurp f) false) nil)))
 
-(defn read-summary-map [data-set]
-  (-> (->> (File. data-set "metadata.txt")
-           FileReader. BufferedReader. line-seq
-           (take-while #(not (.startsWith % "},")))
-           (apply str))
-      (.concat "}}") (read-json false) (get "Summary"))) 
+;(defn read-summary-map [data-set]
+;  (-> (->> (File. data-set "metadata.txt")
+;           FileReader. BufferedReader. line-seq
+;           (take-while #(not (.startsWith % "},")))
+;           (apply str))
+;      (.concat "}}") (read-json false) (get "Summary"))) 
+
+(defn read-summary-map [path]
+  (try
+  (-> gui
+      (.openAcquisitionData path false false)
+      .getImageCache
+      .getSummaryMetadata
+      json-to-data)
+  (catch Exception e nil)))
 
 (defn get-summary-map [data-set location]
-  (let [raw-summary-map (read-summary-map data-set)]
+  (println data-set)
+  (when-let [raw-summary-map (read-summary-map data-set)]
     (merge raw-summary-map
       (if-let [frames (count-frames data-set)]
         {"Frames" frames})

  (awt-event (update-browser-status)))

(defn find-data-sets [root-dir]
  (map #(.getParent %)
    (->> (File. root-dir)
      file-seq
      (filter #(= (.getName %) "metadata.txt")))))

(defn get-frame-index [file-name]
  (try (Integer/parseInt (second (.split file-name "_")))

                      (let [loc (second data-set)]
                        (when (or (= loc "") (contains? @current-locations loc))
                          (let [m (apply get-summary-map data-set)]
                            (add-data (map #(get m %) tags))
                            ;(remove-sibling-positions m)
                            (awt-event (update-browser-status))))
                        (recur))))))
              (catch Exception e (.printStackTrace e))
