Skip to content

Commit d830388

Browse files
CV7000/8000: fix used files list when TIFFs are in a subdirectory
1 parent 7ca9980 commit d830388

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

components/formats-gpl/src/loci/formats/in/CV7000Reader.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public class CV7000Reader extends FormatReader {
8181

8282
// -- Fields --
8383

84-
private String[] allFiles;
84+
private List<String> allFiles = new ArrayList<String>();
8585
private MinimalTiffReader reader;
8686
private String wppPath;
8787
private String detailPath;
@@ -223,6 +223,7 @@ public void close(boolean fileOnly) throws IOException {
223223
reversePlaneLookup = null;
224224
extraFiles = null;
225225
acquiredWells.clear();
226+
allFiles.clear();
226227
}
227228
}
228229

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

271272
Location parent = new Location(id).getAbsoluteFile().getParentFile();
272-
allFiles = parent.list(true);
273-
Arrays.sort(allFiles);
274-
for (int i=0; i<allFiles.length; i++) {
275-
Location file = new Location(parent, allFiles[i]);
273+
String[] listedFiles = parent.list(true);
274+
Arrays.sort(listedFiles);
275+
for (int i=0; i<listedFiles.length; i++) {
276+
Location file = new Location(parent, listedFiles[i]);
276277
if (!file.isDirectory() && file.canRead()) {
277-
allFiles[i] = file.getAbsolutePath();
278-
}
279-
else {
280-
allFiles[i] = null;
278+
allFiles.add(file.getAbsolutePath());
281279
}
282280
}
283281
Location measurementData = new Location(parent, MEASUREMENT_FILE);
@@ -346,6 +344,9 @@ public int compare(Channel c1, Channel c2) {
346344
if (!isWellAcquired(p.field.row, p.field.column)) {
347345
continue;
348346
}
347+
if (!allFiles.contains(p.file)) {
348+
allFiles.add(p.file);
349+
}
349350

350351
p.channelIndex = getChannelIndex(p);
351352

0 commit comments

Comments
 (0)