From cee34a24e95df8ca3e9d526a266e8969818fe490 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Thu, 26 Oct 2023 14:30:30 -0500 Subject: [PATCH 1/7] Allow BioTek plates to be split across multiple subdirectories --- .../bioformats2raw/BioTekReader.java | 96 ++++++++++++++++--- .../bioformats2raw/test/BioTekTest.java | 74 ++++++++------ 2 files changed, 125 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java index b201a6d4..3ee3d77a 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java @@ -212,17 +212,53 @@ protected void initFile(String id) throws FormatException, IOException { String[] files = parent.list(true); Arrays.sort(files); + + // is there only one well in the directory? + // compare the well identifiers (relative file name up to first _) + boolean sameWell = true; + int endIndex = files[0].indexOf("_"); + if (endIndex > 0) { + String wellCheck = files[0].substring(0, endIndex); + LOGGER.debug("well check string = {}", wellCheck); + for (int i=0; i allFiles = new ArrayList(); + for (String well : wellDirs) { + Location wellDir = new Location(plateDir, well).getAbsoluteFile(); + LOGGER.debug("looking in well directory = {}", wellDir); + String[] f = wellDir.list(true); + for (String file : f) { + LOGGER.debug(" adding well file {}", file); + allFiles.add(new Location(wellDir, file).getAbsolutePath()); + } + } + LOGGER.debug("found files = {}", allFiles); + files = allFiles.toArray(new String[allFiles.size()]); + Arrays.sort(files); + } + Pattern regexA = Pattern.compile(TIFF_REGEX_A); Pattern regexB = Pattern.compile(TIFF_REGEX_B); Pattern regexZ = Pattern.compile(TIFF_REGEX_Z); + ArrayList validWellRowCol = new ArrayList(); int maxRow = 0; - int minRow = Integer.MAX_VALUE; int maxCol = 0; - int minCol = Integer.MAX_VALUE; int maxPlateAcq = 0; Map maxField = new HashMap(); - for (String f : files) { + for (String absolutePath : files) { + String f = new Location(absolutePath).getName(); Matcher m = regexA.matcher(f); int rowIndex = -1; int colIndex = -1; @@ -269,20 +305,17 @@ protected void initFile(String id) throws FormatException, IOException { well.setFieldCount(fieldIndex + 1); } int c = well.addChannelName(fieldIndex, channelName); - well.addFile(new PlaneIndex(fieldIndex, z, c, t), - new Location(parent, f).getAbsolutePath()); + well.addFile(new PlaneIndex(fieldIndex, z, c, t), absolutePath); if (rowIndex > maxRow) { maxRow = rowIndex; } - if (rowIndex < minRow) { - minRow = rowIndex; - } if (colIndex > maxCol) { maxCol = colIndex; } - if (colIndex < minCol) { - minCol = colIndex; + WellIndex rowColPair = new WellIndex(rowIndex, colIndex); + if (!validWellRowCol.contains(rowColPair)) { + validWellRowCol.add(rowColPair); } Integer maxFieldIndex = maxField.get(0); if (maxFieldIndex == null) { @@ -292,6 +325,7 @@ protected void initFile(String id) throws FormatException, IOException { } } wells.sort(null); + validWellRowCol.sort(null); // split brightfield channels into a separate plate acquisition maxField.put(1, -1); @@ -443,12 +477,14 @@ else if (pa == 1) { int nextImage = 0; int[] nextWellSample = new int[(maxRow + 1) * (maxCol + 1)]; - int totalColumns = (maxCol - minCol) + 1; for (int w=0; w { + public int row; + public int col; + + public WellIndex(int r, int c) { + this.row = r; + this.col = c; + } + + @Override + public int compareTo(WellIndex w) { + if (this.row != w.row) { + return this.row - w.row; + } + return this.col - w.col; + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof WellIndex)) { + return false; + } + return compareTo((WellIndex) o) == 0; + } + + @Override + public int hashCode() { + // this would need fixing if we had more than 65535 rows or columns + return (row & 0xffff) << 16 | (col & 0xffff); + } + } + } diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java index cae226ef..290c9354 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java @@ -71,7 +71,12 @@ void createPlate(String[] filenames) throws IOException { Path testTiff = getTestFile("test.tiff"); for (String f : filenames) { - Files.copy(testTiff, input.resolve(f)); + Path copyLocation = input.resolve(f); + if (!input.equals(copyLocation.getParent())) { + // supplied file path includes a subdirectory + copyLocation.getParent().toFile().mkdirs(); + } + Files.copy(testTiff, copyLocation); } // reset the input path to the first file in the list @@ -80,16 +85,15 @@ void createPlate(String[] filenames) throws IOException { } /** - * Create an artificial single well BioTek plate with the given - * list of file names. + * Create an artificial BioTek plate with the given list of file names. * Checks that the correct well row/column and ZCT sizes are detected. * * This test will be run once for each Arguments object * returned by getTestCases below. * * @param paths path to each file in the plate - * @param wellRow well row index (from 0) - * @param wellColumn well column index (from 0) + * @param wellRow row index for each well (from 0) + * @param wellColumn column index for each well (from 0) * @param fields number of fields in the well * @param sizeZ number of Z sections * @param sizeC number of channels @@ -97,7 +101,7 @@ void createPlate(String[] filenames) throws IOException { */ @ParameterizedTest @MethodSource("getTestCases") - public void testBioTek(String[] paths, int wellRow, int wellColumn, + public void testBioTek(String[] paths, int[] wellRow, int[] wellColumn, int fields, int sizeZ, int sizeC, int sizeT) throws Exception { // set up the artificial plate @@ -112,29 +116,33 @@ public void testBioTek(String[] paths, int wellRow, int wellColumn, // an exception which would fail the test reader.setId(input.toString()); - // the number of OME Images should match the expected field count + // the number of OME Images should match the expected well * field count // this should be the same as the series count - assertEquals(metadata.getImageCount(), fields); + assertEquals(metadata.getImageCount(), fields * wellRow.length); assertEquals(metadata.getImageCount(), reader.getSeriesCount()); - // there should be exactly one plate, with exactly one well + // there should be exactly one plate assertEquals(metadata.getPlateCount(), 1); - assertEquals(metadata.getWellCount(0), 1); + assertEquals(metadata.getWellCount(0), wellRow.length); // the well's row and column indexes should match expectations // this is especially important for "sparse" plates where the first // row and/or column in the plate are missing - assertEquals(metadata.getWellRow(0, 0).getValue(), wellRow); - assertEquals(metadata.getWellColumn(0, 0).getValue(), wellColumn); - // all of the Images should be linked to the well - assertEquals(metadata.getWellSampleCount(0, 0), fields); - for (int f=0; f getTestCases() { return Stream.of( Arguments.of(new String[] { "A1_-1_1_1_Tsf[Phase Contrast]_001.tif" - }, 0, 0, 1, 1, 1, 1), + }, new int[] {0}, new int[] {0}, 1, 1, 1, 1), Arguments.of(new String[] { "A1_01_1_1_Phase Contrast_001.tif", "A1_01_1_2_Phase Contrast_001.tif", @@ -186,33 +194,37 @@ static Stream getTestCases() { "A1_01_1_7_Phase Contrast_001.tif", "A1_01_1_8_Phase Contrast_001.tif", "A1_01_1_9_Phase Contrast_001.tif", - }, 0, 0, 9, 1, 1, 1), + }, new int[] {0}, new int[] {0}, 9, 1, 1, 1), Arguments.of(new String[] { "P24_1_Bright Field_1_001_02.tif" - }, 15, 23, 1, 1, 1, 1), + }, new int[] {15}, new int[] {23}, 1, 1, 1, 1), Arguments.of(new String[] { "B2_1_Bright Field_1_001_02.tif" - }, 1, 1, 1, 1, 1, 1), + }, new int[] {1}, new int[] {1}, 1, 1, 1, 1), Arguments.of(new String[] { "A1_1_Stitched[AandB_Phase Contrast]_1_001_-1.tif" - }, 0, 0, 1, 1, 1, 1), + }, new int[] {0}, new int[] {0}, 1, 1, 1, 1), Arguments.of(new String[] { "A1_1Z0_DAPI_1_001_.tif", "A1_1Z1_DAPI_1_001_.tif", "A1_1Z2_DAPI_1_001_.tif", "A1_1Z3_DAPI_1_001_.tif", "A1_1Z4_DAPI_1_001_.tif" - }, 0, 0, 1, 5, 1, 1), + }, new int[] {0}, new int[] {0}, 1, 5, 1, 1), Arguments.of(new String[] { "A1_-1_1_1_Stitched[Channel1 300,400]_001.tif", "A1_-1_2_1_Stitched[Channel2 500,600]_001.tif", "A1_-1_3_1_Stitched[Channel 3 600,650]_001.tif" - }, 0, 0, 1, 1, 3, 1), + }, new int[] {0}, new int[] {0}, 1, 1, 3, 1), Arguments.of(new String[] { "A1_-2_1_1_Tsf[Stitched[Channel1 300,400]]_001.tif", "A1_-2_2_1_Tsf[Stitched[Channel2 500,600]]_001.tif", "A1_-2_3_1_Tsf[Stitched[Channel 3 600,650]]_001.tif" - }, 0, 0, 1, 1, 3, 1) + }, new int[] {0}, new int[] {0}, 1, 1, 3, 1), + Arguments.of(new String[] { + "B2/B2_1_Bright Field_1_001_02.tif", + "D3/D3_1_Bright Field_1_001_02.tif", + }, new int[] {1, 3}, new int[] {1, 2}, 1, 1, 1, 1) ); } From c2a359b093527e6a85c1b752b0a73b099994ed8e Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Wed, 24 Jan 2024 16:45:29 -0600 Subject: [PATCH 2/7] Log each TIFF file's path and well/field indexes at TRACE --- .../java/com/glencoesoftware/bioformats2raw/BioTekReader.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java index 3ee3d77a..e9cd6cf1 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java @@ -337,6 +337,8 @@ protected void initFile(String id) throws FormatException, IOException { for (int f=0; f Date: Wed, 24 Jan 2024 18:27:34 -0600 Subject: [PATCH 3/7] Add basic detection of ROI indexes --- .../bioformats2raw/BioTekReader.java | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java index e9cd6cf1..e29dd2a2 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java @@ -70,6 +70,9 @@ public class BioTekReader extends FormatReader { private static final String TIFF_REGEX_Z = WELL_REGEX + "_.+\\[(.+)_" + ALPHANUM + "\\]_(\\d+)_(\\d+)_([0-9-]+)?" + SUFFIX; + private static final String TIFF_REGEX_ROI = + "([A-Z]{1,2})(\\d{1,2})ROI(\\d+)_(\\d+)_(\\d+)_(\\d+)(Z(\\d+))?_" + + ALPHANUM + "_(-?\\d+)" + SUFFIX; private static final String DATE_FORMAT = "MM/dd/yy HH:mm:ss"; // -- Fields -- @@ -211,6 +214,9 @@ protected void initFile(String id) throws FormatException, IOException { findXPTFiles(parent); String[] files = parent.list(true); + for (int i=0; i validWellRowCol = new ArrayList(); int maxRow = 0; int maxCol = 0; int maxPlateAcq = 0; Map maxField = new HashMap(); + int matchingROI = -1; + String matchingPath = new Location(currentId).getAbsolutePath(); + LOGGER.trace("matching path = {}", matchingPath); + for (String absolutePath : files) { String f = new Location(absolutePath).getName(); Matcher m = regexA.matcher(f); int rowIndex = -1; int colIndex = -1; int fieldIndex = -1; + int roiIndex = -1; int z = 0; int t = 0; String channelName = ""; @@ -297,9 +309,41 @@ protected void initFile(String id) throws FormatException, IOException { t = (int) Math.max(0, Integer.parseInt(m.group(8)) - 1); channelName += m.group(6); } + else { + m = regexROI.matcher(f); + if (m.matches()) { + rowIndex = getWellRow(m.group(1)); + colIndex = Integer.parseInt(m.group(2)) - 1; + roiIndex = Integer.parseInt(m.group(3)) - 1; + + LOGGER.trace("absolutePath = {}, roiIndex = {}", + absolutePath, roiIndex); + if (matchingROI < 0 && absolutePath.equals(matchingPath)) { + matchingROI = roiIndex; + LOGGER.trace("matchingROI = {}, absolutePath = {}", + matchingROI, absolutePath); + } + + int channelIndex = Integer.parseInt(m.group(5)) - 1; + fieldIndex = Integer.parseInt(m.group(6)) - 1; + try { + z = Integer.parseInt(m.group(8)); + // can have two channels with same name + // one with Z stack and one without + channelName = "Z"; + } + catch (NumberFormatException e) { + } + channelName += m.group(9); + // recorded T index may be negative if no timepoints + t = (int) Math.max(0, Integer.parseInt(m.group(10)) - 1); + } + } } - if (rowIndex >= 0 && colIndex >= 0 && fieldIndex >= 0) { + if (rowIndex >= 0 && colIndex >= 0 && fieldIndex >= 0 && + matchingROI == roiIndex) + { BioTekWell well = lookupWell(0, rowIndex, colIndex); if (fieldIndex >= well.getFieldCount()) { well.setFieldCount(fieldIndex + 1); From b7d3286ea62c55ad60a3d5a19bd7923bf2c40f21 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Sun, 21 Jul 2024 14:09:56 -0500 Subject: [PATCH 4/7] Fix for true single well plates, add one more test for multiple directories --- .../bioformats2raw/BioTekReader.java | 27 ++++++++++++++----- .../bioformats2raw/test/BioTekTest.java | 16 ++++++++++- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java index e29dd2a2..d4405866 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java @@ -240,18 +240,31 @@ protected void initFile(String id) throws FormatException, IOException { LOGGER.debug("plate directory = {}", plateDir); String[] wellDirs = plateDir.list(true); ArrayList allFiles = new ArrayList(); + boolean multipleDirs = true; for (String well : wellDirs) { Location wellDir = new Location(plateDir, well).getAbsoluteFile(); LOGGER.debug("looking in well directory = {}", wellDir); - String[] f = wellDir.list(true); - for (String file : f) { - LOGGER.debug(" adding well file {}", file); - allFiles.add(new Location(wellDir, file).getAbsolutePath()); + if (wellDir == null) { + multipleDirs = false; } + else { + String[] f = wellDir.list(true); + if (f == null) { + multipleDirs = false; + } + else { + for (String file : f) { + LOGGER.debug(" adding well file {}", file); + allFiles.add(new Location(wellDir, file).getAbsolutePath()); + } + } + } + } + if (multipleDirs) { + LOGGER.debug("found files = {}", allFiles); + files = allFiles.toArray(new String[allFiles.size()]); + Arrays.sort(files); } - LOGGER.debug("found files = {}", allFiles); - files = allFiles.toArray(new String[allFiles.size()]); - Arrays.sort(files); } Pattern regexA = Pattern.compile(TIFF_REGEX_A); diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java index 290c9354..46339a84 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java @@ -224,7 +224,21 @@ static Stream getTestCases() { Arguments.of(new String[] { "B2/B2_1_Bright Field_1_001_02.tif", "D3/D3_1_Bright Field_1_001_02.tif", - }, new int[] {1, 3}, new int[] {1, 2}, 1, 1, 1, 1) + }, new int[] {1, 3}, new int[] {1, 2}, 1, 1, 1, 1), + Arguments.of(new String[] { + "ID_A9 info/A9_-1_1_1_Phase Contrast_001.tif", + "ID_A9 info/A9_-1_2_1_GFP_001.tif", + "ID_A9 info/A9_-1_3_1_DAPI_001.tif", + "ID_A10 info/A10_-1_1_1_Phase Contrast_001.tif", + "ID_A10 info/A10_-1_2_1_GFP_001.tif", + "ID_A10 info/A10_-1_3_1_DAPI_001.tif", + "ID_E9 info/E9_-1_1_1_Phase Contrast_001.tif", + "ID_E9 info/E9_-1_2_1_GFP_001.tif", + "ID_E9 info/E9_-1_3_1_DAPI_001.tif", + "ID_E10 info/E10_-1_1_1_Phase Contrast_001.tif", + "ID_E10 info/E10_-1_2_1_GFP_001.tif", + "ID_E10 info/E10_-1_3_1_DAPI_001.tif", + }, new int[] {0, 0, 4, 4}, new int[] {8, 9, 8, 9}, 1, 1, 3, 1) ); } From a67e18e285fa4319a8f860be08517678f6701a21 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Sun, 21 Jul 2024 14:50:04 -0500 Subject: [PATCH 5/7] Detect all ROIs, and treat each as a well sample (like fields) Multiple ROIs combined with multiple fields are supported, as indicated in the test. --- .../bioformats2raw/BioTekReader.java | 48 ++++++++++++++----- .../bioformats2raw/test/BioTekTest.java | 30 +++++++++++- 2 files changed, 64 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java index d4405866..79628f58 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/BioTekReader.java @@ -277,10 +277,11 @@ protected void initFile(String id) throws FormatException, IOException { int maxPlateAcq = 0; Map maxField = new HashMap(); - int matchingROI = -1; String matchingPath = new Location(currentId).getAbsolutePath(); LOGGER.trace("matching path = {}", matchingPath); + ArrayList foundWellSamples = new ArrayList(); + for (String absolutePath : files) { String f = new Location(absolutePath).getName(); Matcher m = regexA.matcher(f); @@ -331,11 +332,6 @@ protected void initFile(String id) throws FormatException, IOException { LOGGER.trace("absolutePath = {}, roiIndex = {}", absolutePath, roiIndex); - if (matchingROI < 0 && absolutePath.equals(matchingPath)) { - matchingROI = roiIndex; - LOGGER.trace("matchingROI = {}, absolutePath = {}", - matchingROI, absolutePath); - } int channelIndex = Integer.parseInt(m.group(5)) - 1; fieldIndex = Integer.parseInt(m.group(6)) - 1; @@ -354,9 +350,25 @@ protected void initFile(String id) throws FormatException, IOException { } } - if (rowIndex >= 0 && colIndex >= 0 && fieldIndex >= 0 && - matchingROI == roiIndex) + if (rowIndex >= 0 && colIndex >= 0 && + (fieldIndex >= 0 || roiIndex >= 0)) { + // collapse field and ROI index into single field index + if (roiIndex >= 0) { + if (fieldIndex < 0) { + // only ROIs, no field + fieldIndex = roiIndex; + } + else { + // both fields and ROIs + String key = fieldIndex + "," + roiIndex; + if (!foundWellSamples.contains(key)) { + foundWellSamples.add(key); + } + fieldIndex = foundWellSamples.indexOf(key); + } + } + BioTekWell well = lookupWell(0, rowIndex, colIndex); if (fieldIndex >= well.getFieldCount()) { well.setFieldCount(fieldIndex + 1); @@ -494,14 +506,26 @@ protected void initFile(String id) throws FormatException, IOException { setSeries(s); int wellIndex = getWellIndex(s); - int field = getFieldIndex(s) + 1; + int field = getFieldIndex(s); BioTekWell well = wells.get(wellIndex); int row = well.getRowIndex(); int column = well.getColumnIndex(); - store.setImageName( - getWellName(row, column) + " #" + field, s); - List channels = well.getChannels(field - 1); + String fieldName = " #" + (field + 1); + if (field < foundWellSamples.size()) { + // unpack the field/ROI indexes and store both + // in the image name + + String[] indexes = foundWellSamples.get(field).split(","); + if (indexes.length == 2) { + fieldName = " Field #" + (Integer.parseInt(indexes[0]) + 1) + + ", ROI #" + (Integer.parseInt(indexes[1]) + 1); + } + } + + store.setImageName(getWellName(row, column) + fieldName, s); + + List channels = well.getChannels(field); for (int c=0; c getTestCases() { "ID_E9 info/E9_-1_3_1_DAPI_001.tif", "ID_E10 info/E10_-1_1_1_Phase Contrast_001.tif", "ID_E10 info/E10_-1_2_1_GFP_001.tif", - "ID_E10 info/E10_-1_3_1_DAPI_001.tif", - }, new int[] {0, 0, 4, 4}, new int[] {8, 9, 8, 9}, 1, 1, 3, 1) + "ID_E10 info/E10_-1_3_1_DAPI_001.tif" + }, new int[] {0, 0, 4, 4}, new int[] {8, 9, 8, 9}, 1, 1, 3, 1), + Arguments.of(new String[] { + "A1ROI1_01_1_1Z0_Confocal DAPI_001.tif", + "A1ROI1_01_1_1Z1_Confocal DAPI_001.tif", + "A1ROI1_01_1_1Z2_Confocal DAPI_001.tif", + "A1ROI1_01_1_1Z0_Confocal RFP_001.tif", + "A1ROI1_01_1_1Z1_Confocal RFP_001.tif", + "A1ROI1_01_1_1Z2_Confocal RFP_001.tif", + "A1ROI1_01_1_2Z0_Confocal DAPI_001.tif", + "A1ROI1_01_1_2Z1_Confocal DAPI_001.tif", + "A1ROI1_01_1_2Z2_Confocal DAPI_001.tif", + "A1ROI1_01_1_2Z0_Confocal RFP_001.tif", + "A1ROI1_01_1_2Z1_Confocal RFP_001.tif", + "A1ROI1_01_1_2Z2_Confocal RFP_001.tif", + "A1ROI2_01_1_1Z0_Confocal DAPI_001.tif", + "A1ROI2_01_1_1Z1_Confocal DAPI_001.tif", + "A1ROI2_01_1_1Z2_Confocal DAPI_001.tif", + "A1ROI2_01_1_1Z0_Confocal RFP_001.tif", + "A1ROI2_01_1_1Z1_Confocal RFP_001.tif", + "A1ROI2_01_1_1Z2_Confocal RFP_001.tif", + "A1ROI2_01_1_2Z0_Confocal DAPI_001.tif", + "A1ROI2_01_1_2Z1_Confocal DAPI_001.tif", + "A1ROI2_01_1_2Z2_Confocal DAPI_001.tif", + "A1ROI2_01_1_2Z0_Confocal RFP_001.tif", + "A1ROI2_01_1_2Z1_Confocal RFP_001.tif", + "A1ROI2_01_1_2Z2_Confocal RFP_001.tif" + }, new int[] {0}, new int[] {0}, 4, 3, 2, 1) ); } From fe077cbb92b5df0062f62de1fcb98bb3b8ae4a00 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Sun, 21 Jul 2024 14:56:33 -0500 Subject: [PATCH 6/7] Add test for multiple ROIs with just one field --- .../bioformats2raw/test/BioTekTest.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java index 1907130c..9b688c9e 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java @@ -264,7 +264,27 @@ static Stream getTestCases() { "A1ROI2_01_1_2Z0_Confocal RFP_001.tif", "A1ROI2_01_1_2Z1_Confocal RFP_001.tif", "A1ROI2_01_1_2Z2_Confocal RFP_001.tif" - }, new int[] {0}, new int[] {0}, 4, 3, 2, 1) + }, new int[] {0}, new int[] {0}, 4, 3, 2, 1), + Arguments.of(new String[] { + "A1ROI1_01_1_1Z0_Confocal DAPI_001.tif", + "A1ROI1_01_1_1Z1_Confocal DAPI_001.tif", + "A1ROI1_01_1_1Z2_Confocal DAPI_001.tif", + "A1ROI1_01_1_1Z0_Confocal RFP_001.tif", + "A1ROI1_01_1_1Z1_Confocal RFP_001.tif", + "A1ROI1_01_1_1Z2_Confocal RFP_001.tif", + "A1ROI2_01_1_1Z0_Confocal DAPI_001.tif", + "A1ROI2_01_1_1Z1_Confocal DAPI_001.tif", + "A1ROI2_01_1_1Z2_Confocal DAPI_001.tif", + "A1ROI2_01_1_1Z0_Confocal RFP_001.tif", + "A1ROI2_01_1_1Z1_Confocal RFP_001.tif", + "A1ROI2_01_1_1Z2_Confocal RFP_001.tif", + "A1ROI3_01_1_1Z0_Confocal DAPI_001.tif", + "A1ROI3_01_1_1Z1_Confocal DAPI_001.tif", + "A1ROI3_01_1_1Z2_Confocal DAPI_001.tif", + "A1ROI3_01_1_1Z0_Confocal RFP_001.tif", + "A1ROI3_01_1_1Z1_Confocal RFP_001.tif", + "A1ROI3_01_1_1Z2_Confocal RFP_001.tif", + }, new int[] {0}, new int[] {0}, 3, 3, 2, 1) ); } From 7650721fbeabb01bf0d5ebc56f3734f72b14e850 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Sun, 21 Jul 2024 16:50:45 -0500 Subject: [PATCH 7/7] Add one more test for default file name format --- .../bioformats2raw/test/BioTekTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java index 9b688c9e..2f96b1ba 100644 --- a/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java +++ b/src/test/java/com/glencoesoftware/bioformats2raw/test/BioTekTest.java @@ -284,7 +284,21 @@ static Stream getTestCases() { "A1ROI3_01_1_1Z0_Confocal RFP_001.tif", "A1ROI3_01_1_1Z1_Confocal RFP_001.tif", "A1ROI3_01_1_1Z2_Confocal RFP_001.tif", - }, new int[] {0}, new int[] {0}, 3, 3, 2, 1) + }, new int[] {0}, new int[] {0}, 3, 3, 2, 1), + Arguments.of(new String[] { + "A1_01_3_4_Blue_001.tif", + "A1_01_3_3_Blue_001.tif", + "A1_01_3_2_Blue_001.tif", + "A1_01_3_1_Blue_001.tif", + "A1_01_2_4_Green_001.tif", + "A1_01_2_3_Green_001.tif", + "A1_01_2_2_Green_001.tif", + "A1_01_2_1_Green_001.tif", + "A1_01_1_4_Red_001.tif", + "A1_01_1_3_Red_001.tif", + "A1_01_1_2_Red_001.tif", + "A1_01_1_1_Red_001.tif" + }, new int[] {0}, new int[] {0}, 4, 1, 3, 1) ); }