Search in sources :

Example 1 with ImageDisplay

use of net.imagej.display.ImageDisplay in project vcell by virtualcell.

the class CompareView method getDatasetOverlayMap.

public HashMap<Dataset, List<Overlay>> getDatasetOverlayMap(OverlayService overlayService) {
    HashMap<Dataset, List<Overlay>> result = new HashMap<>();
    for (Dataset dataset : datasetImagePanelMap.keySet()) {
        ImageDisplay display = datasetImagePanelMap.get(dataset);
        // Bug in ImageJ that returns two of each overlay, so must refrain from adding duplicates
        List<Overlay> overlays = new ArrayList<>();
        for (Overlay overlay : overlayService.getOverlays(display)) {
            if (!overlays.contains(overlay)) {
                overlays.add(overlay);
            }
        }
        result.put(dataset, overlays);
    }
    return result;
}
Also used : HashMap(java.util.HashMap) Dataset(net.imagej.Dataset) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Overlay(net.imagej.overlay.Overlay) ImageDisplay(net.imagej.display.ImageDisplay)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Dataset (net.imagej.Dataset)1 ImageDisplay (net.imagej.display.ImageDisplay)1 Overlay (net.imagej.overlay.Overlay)1