[ome-devel] ScanR dataset failed to load

Rubén Muñoz ruben.munoz at embl.de
Wed Aug 22 12:17:51 BST 2012


Hi Melissa,

I have obtained an ScanR dataset from a collaborator that failed to open with LOCI tools.
The error reads as follows:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
	at loci.formats.in.ScanrReader.initFile(ScanrReader.java:591)
	at loci.formats.FormatReader.setId(FormatReader.java:1091)
	at loci.plugins.in.ImportProcess.initializeFile(ImportProcess.java:480)
	at loci.plugins.in.ImportProcess.execute(ImportProcess.java:144)
	at loci.plugins.in.Importer.showDialogs(Importer.java:139)
	at loci.plugins.in.Importer.run(Importer.java:77)
	at loci.plugins.LociImporter.run(LociImporter.java:79)
	at ij.IJ.runUserPlugIn(IJ.java:183)
	at ij.IJ.runPlugIn(IJ.java:150)

The example has been uploaded as 'TestPlate_Mock_01_001.zip' to your FTP if you would like to have a look.
The cause is that in this particular experiment some (inner) fields were software-disabled. That was not tested with the importer before.

One can identify these cases and correct the number of fields during conversion.

A patch suggestion based on the current ScanrReader trunk version follows. 

In my opinion, the ScanR format defines in 'subposition list'  the 'set of fields that are *really* acquired, whereas 'rows/well' and 'columns/well' are the the number of fields that are available. 

Please let me know if I can help with some information, 

Best regards,

Rubén
 

---------------------------------------

diff --git a/components/bio-formats/src/loci/formats/in/ScanrReader.java b/components/bio-formats/src/loci/formats/in/Scanr
index ff7e627..46bc53e 100644
--- a/components/bio-formats/src/loci/formats/in/ScanrReader.java
+++ b/components/bio-formats/src/loci/formats/in/ScanrReader.java
@@ -92,6 +92,7 @@ public class ScanrReader extends FormatReader {
   private String[] tiffs;
   private MinimalTiffReader reader;
 
+  private boolean foundPositions = false;
   private double[] fieldPositionX;
   private double[] fieldPositionY;
   private Vector<Double> exposures = new Vector<Double>();
@@ -358,7 +359,11 @@ public class ScanrReader extends FormatReader {
     int nSlices = getSizeZ() == 0 ? 1 : getSizeZ();
     int nTimepoints = getSizeT();
     int nWells = wellCount;
-    int nPos = fieldRows * fieldColumns;
+    int nPos = 0;
+    if (foundPositions)
+        nPos = fieldPositionX.length;
+    else
+        nPos = fieldRows * fieldColumns;
     if (nPos == 0) nPos = 1;
 
     // get list of TIFF files
@@ -555,7 +560,11 @@ public class ScanrReader extends FormatReader {
     String plateAcqID = MetadataTools.createLSID("PlateAcquisition", 0, 0);
     store.setPlateAcquisitionID(plateAcqID, 0, 0);
 
-    int nFields = fieldRows * fieldColumns;
+    int nFields = 0;
+    if (foundPositions)
+        nFields = fieldPositionX.length;
+    else
+        nFields = fieldRows * fieldColumns;
 
     if (nFields > 0) {
       store.setPlateAcquisitionMaximumFieldCount(
@@ -653,7 +662,6 @@ public class ScanrReader extends FormatReader {
     private String wellIndex;
 
     private boolean validChannel = false;
-    private boolean foundPositions = false;
     private boolean foundPlateLayout = false;
     private int nextXPos = 0;
     private int nextYPos = 0;


More information about the ome-devel mailing list