From 00d15d2baef435e03235f60e8a6a2d68e5e42b7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Besson?= <sbesson@glencoesoftware.com>
Date: Mon, 22 Jul 2024 09:58:22 +0100
Subject: [PATCH 1/4] FujiReader: always list pixelsFile first

---
 components/formats-gpl/src/loci/formats/in/FujiReader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/formats-gpl/src/loci/formats/in/FujiReader.java b/components/formats-gpl/src/loci/formats/in/FujiReader.java
index 34eccf1d435..4240b4e1a59 100644
--- a/components/formats-gpl/src/loci/formats/in/FujiReader.java
+++ b/components/formats-gpl/src/loci/formats/in/FujiReader.java
@@ -118,7 +118,7 @@ public String[] getSeriesUsedFiles(boolean noPixels) {
     if (noPixels) {
       return new String[] {infFile};
     }
-    return new String[] {infFile, pixelsFile};
+    return new String[] {pixelsFile, infFile};
   }
 
   /* @see loci.formats.IFormatReader#fileGroupOption(String) */

From 7e9df63cfb24d7c315516b232f1a0b133ddf9835 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Besson?= <sbesson@glencoesoftware.com>
Date: Fri, 17 Jan 2025 09:25:49 +0000
Subject: [PATCH 2/4] Reinclude FujiReader in getCurrentFile/used files test

---
 .../test-suite/src/loci/tests/testng/FormatReaderTest.java       | 1 -
 1 file changed, 1 deletion(-)

diff --git a/components/test-suite/src/loci/tests/testng/FormatReaderTest.java b/components/test-suite/src/loci/tests/testng/FormatReaderTest.java
index 083a940e7cc..511ee5e372a 100644
--- a/components/test-suite/src/loci/tests/testng/FormatReaderTest.java
+++ b/components/test-suite/src/loci/tests/testng/FormatReaderTest.java
@@ -1871,7 +1871,6 @@ public void testSaneUsedFiles() {
           !(reader.getFormat().equals("Evotec Flex")) &&
           !(reader.getFormat().equals("CellSens VSI")) &&
           !(reader.getFormat().equals("PerkinElmer")) &&
-          !(reader.getFormat().equals("Fuji LAS 3000")) &&
           !(reader.getFormat().equals("Micro-Manager")) &&
           !(reader.getFormat().equals("BDV")) &&
           !(reader.getFormat().equals("Zeiss AxioVision TIFF")) &&

From 5a86e465f0bf209aa568a27839cae6c4d3ad922b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Besson?= <sbesson@glencoesoftware.com>
Date: Sun, 19 Jan 2025 21:37:48 +0000
Subject: [PATCH 3/4] FujiReader: also initialize the inf file as the current
 file

---
 .../src/loci/formats/in/FujiReader.java           | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/components/formats-gpl/src/loci/formats/in/FujiReader.java b/components/formats-gpl/src/loci/formats/in/FujiReader.java
index 4240b4e1a59..6981159ddf7 100644
--- a/components/formats-gpl/src/loci/formats/in/FujiReader.java
+++ b/components/formats-gpl/src/loci/formats/in/FujiReader.java
@@ -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) */
@@ -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]);

From f7230aea92b6e28176899776e33a406bf1dfd8cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Besson?= <sbesson@glencoesoftware.com>
Date: Mon, 20 Jan 2025 20:15:10 +0000
Subject: [PATCH 4/4] Remove unnecessary variable assignments

---
 components/formats-gpl/src/loci/formats/in/FujiReader.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/components/formats-gpl/src/loci/formats/in/FujiReader.java b/components/formats-gpl/src/loci/formats/in/FujiReader.java
index 6981159ddf7..5e981bda1bc 100644
--- a/components/formats-gpl/src/loci/formats/in/FujiReader.java
+++ b/components/formats-gpl/src/loci/formats/in/FujiReader.java
@@ -143,9 +143,7 @@ public void close(boolean fileOnly) throws IOException {
   @Override
   protected void initFile(String id) throws FormatException, IOException {
     if (!checkSuffix(id, "inf")) {
-      pixelsFile = new Location(id).getAbsolutePath();
-      infFile = pixelsFile.substring(0, pixelsFile.lastIndexOf(".")) + ".inf";
-      initFile(infFile);
+      initFile(id.substring(0, id.lastIndexOf(".")) + ".inf");
       return;
     }