Skip to content

Commit

Permalink
FujiReader: also initialize the inf file as the current file
Browse files Browse the repository at this point in the history
  • Loading branch information
sbesson committed Jan 19, 2025
1 parent 7e9df63 commit 5a86e46
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions components/formats-gpl/src/loci/formats/in/FujiReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public String[] getSeriesUsedFiles(boolean noPixels) {
if (noPixels) {
return new String[] {infFile};
}
return new String[] {pixelsFile, infFile};
return new String[] {infFile, pixelsFile};
}

/* @see loci.formats.IFormatReader#fileGroupOption(String) */
Expand All @@ -142,17 +142,16 @@ public void close(boolean fileOnly) throws IOException {
/* @see loci.formats.FormatReader#initFile(String) */
@Override
protected void initFile(String id) throws FormatException, IOException {
super.initFile(id);

if (checkSuffix(id, "inf")) {
infFile = new Location(id).getAbsolutePath();
pixelsFile = infFile.substring(0, infFile.lastIndexOf(".")) + ".img";
}
else {
if (!checkSuffix(id, "inf")) {
pixelsFile = new Location(id).getAbsolutePath();
infFile = pixelsFile.substring(0, pixelsFile.lastIndexOf(".")) + ".inf";
initFile(infFile);
return;
}

super.initFile(id);
infFile = new Location(id).getAbsolutePath();
pixelsFile = infFile.substring(0, infFile.lastIndexOf(".")) + ".img";
String[] lines = DataTools.readFile(infFile).split("\r{0,1}\n");

int bits = Integer.parseInt(lines[5]);
Expand Down

0 comments on commit 5a86e46

Please sign in to comment.