Skip to content

Commit

Permalink
CV7000/8000: fix used files list when TIFFs are in a subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed Jun 26, 2024
1 parent 7ca9980 commit d830388
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions components/formats-gpl/src/loci/formats/in/CV7000Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class CV7000Reader extends FormatReader {

// -- Fields --

private String[] allFiles;
private List<String> allFiles = new ArrayList<String>();
private MinimalTiffReader reader;
private String wppPath;
private String detailPath;
Expand Down Expand Up @@ -223,6 +223,7 @@ public void close(boolean fileOnly) throws IOException {
reversePlaneLookup = null;
extraFiles = null;
acquiredWells.clear();
allFiles.clear();
}
}

Expand Down Expand Up @@ -269,15 +270,12 @@ protected void initFile(String id) throws FormatException, IOException {
XMLTools.parseXML(wpiXML, plate);

Location parent = new Location(id).getAbsoluteFile().getParentFile();
allFiles = parent.list(true);
Arrays.sort(allFiles);
for (int i=0; i<allFiles.length; i++) {
Location file = new Location(parent, allFiles[i]);
String[] listedFiles = parent.list(true);
Arrays.sort(listedFiles);
for (int i=0; i<listedFiles.length; i++) {
Location file = new Location(parent, listedFiles[i]);
if (!file.isDirectory() && file.canRead()) {
allFiles[i] = file.getAbsolutePath();
}
else {
allFiles[i] = null;
allFiles.add(file.getAbsolutePath());
}
}
Location measurementData = new Location(parent, MEASUREMENT_FILE);
Expand Down Expand Up @@ -346,6 +344,9 @@ public int compare(Channel c1, Channel c2) {
if (!isWellAcquired(p.field.row, p.field.column)) {
continue;
}
if (!allFiles.contains(p.file)) {
allFiles.add(p.file);
}

p.channelIndex = getChannelIndex(p);

Expand Down

0 comments on commit d830388

Please sign in to comment.