Skip to content

Commit

Permalink
Cache well acquisition status
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed May 16, 2023
1 parent bea3294 commit 8e1dac2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/formats-gpl/src/loci/formats/in/CV7000Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public class CV7000Reader extends FormatReader {
private String startTime, endTime;
private ArrayList<String> extraFiles;

private transient Map<String, Boolean> acquiredWells = new HashMap<String, Boolean>();

// -- Constructor --

/** Constructs a new Yokogawa CV7000 reader. */
Expand Down Expand Up @@ -206,6 +208,7 @@ public void close(boolean fileOnly) throws IOException {
endTime = null;
reversePlaneLookup = null;
extraFiles = null;
acquiredWells.clear();
}
}

Expand Down Expand Up @@ -646,13 +649,19 @@ private String readSanitizedXML(String filename) throws IOException {
}

private boolean isWellAcquired(int row, int col) {
String key = row + "-" + col;
if (acquiredWells.containsKey(key)) {
return acquiredWells.get(key);
}
if (planeData != null) {
for (Plane p : planeData) {
if (p != null && p.file != null && p.field.row == row && p.field.column == col) {
acquiredWells.put(key, true);
return true;
}
}
}
acquiredWells.put(key, false);
return false;
}

Expand Down

0 comments on commit 8e1dac2

Please sign in to comment.