diff --git a/pom.xml b/pom.xml index 0d19f2283..9decce59f 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.embl.mobie mobie-viewer-fiji - 5.0.6-SNAPSHOT + 5.0.6 diff --git a/src/main/java/org/embl/mobie/command/open/OpenHCSDatasetCommand.java b/src/main/java/org/embl/mobie/command/open/OpenHCSDatasetCommand.java index 133bbb432..057ca17fe 100644 --- a/src/main/java/org/embl/mobie/command/open/OpenHCSDatasetCommand.java +++ b/src/main/java/org/embl/mobie/command/open/OpenHCSDatasetCommand.java @@ -33,6 +33,7 @@ import org.embl.mobie.MoBIESettings; import org.embl.mobie.command.CommandConstants; import org.embl.mobie.io.util.IOHelper; +import org.embl.mobie.lib.MoBIEHelper; import org.embl.mobie.lib.hcs.OMEXMLParser; import org.scijava.command.Command; import org.scijava.plugin.Parameter; @@ -50,8 +51,8 @@ public class OpenHCSDatasetCommand implements Command { static { net.imagej.patcher.LegacyInjector.preinit(); } - @Parameter ( label = "HCS Plate Directory" ) // , style = "directory" - public String hcsDirectory; // changed to String, because otherwise S3 addresses do not work + @Parameter ( label = "HCS Plate Directory", style = "directory") + public File hcsDirectory; @Parameter ( label = "Relative Well Margin" ) public double wellMargin = 0.1; @@ -84,7 +85,7 @@ public void run() try { - new MoBIE( hcsDirectory, new MoBIESettings(), wellMargin, siteMargin, voxelDimensions ); + new MoBIE( MoBIEHelper.toURI( hcsDirectory ), new MoBIESettings(), wellMargin, siteMargin, voxelDimensions ); } catch ( IOException e ) { diff --git a/src/main/java/org/embl/mobie/lib/hcs/Plate.java b/src/main/java/org/embl/mobie/lib/hcs/Plate.java index 25773c886..d9db995e5 100644 --- a/src/main/java/org/embl/mobie/lib/hcs/Plate.java +++ b/src/main/java/org/embl/mobie/lib/hcs/Plate.java @@ -38,6 +38,7 @@ import mpicbg.spim.data.sequence.FinalVoxelDimensions; import mpicbg.spim.data.sequence.VoxelDimensions; import net.imglib2.RandomAccessibleInterval; +import net.thisptr.jackson.jq.internal.misc.Strings; import org.embl.mobie.io.ImageDataFormat; import org.embl.mobie.io.ImageDataOpener; import org.embl.mobie.io.imagedata.ImageData; @@ -403,7 +404,13 @@ private HCSPattern determineHCSPattern( String hcsDirectory, List< String > path } } - throw new RuntimeException( "Could not determine HCSPattern for " + hcsDirectory ); + ArrayList< String > messages = new ArrayList<>(); + messages.add( "Could not determine HCSPattern for " + hcsDirectory ); + messages.add( "Examined paths:" ); + messages.addAll( paths ); + String join = Strings.join( "\n", messages ); + + throw new RuntimeException( join ); } public Set< Channel > getChannels() diff --git a/src/test/java/debug/DebugIssue1044.java b/src/test/java/debug/DebugIssue1044.java deleted file mode 100644 index b5d601901..000000000 --- a/src/test/java/debug/DebugIssue1044.java +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * #%L - * Fiji viewer for MoBIE projects - * %% - * Copyright (C) 2018 - 2024 EMBL - * %% - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * #L% - */ -package debug; - -import net.imagej.ImageJ; -import org.embl.mobie.MoBIE; -import org.embl.mobie.MoBIESettings; - -import java.io.IOException; - -public class DebugIssue1044 -{ - public static void main( String[] args ) throws IOException - { - final ImageJ imageJ = new ImageJ(); - imageJ.ui().showUI(); - - new MoBIE("/Users/tischer/Downloads/minimal-mobie/minimal-mobie-project", MoBIESettings.settings().view( "segmentations" ) );// .getViewManager().show( "cell-segmentation" ); - - } -} diff --git a/src/test/java/debug/DebugIssue1056.java b/src/test/java/debug/DebugIssue1056.java deleted file mode 100644 index c417d68a7..000000000 --- a/src/test/java/debug/DebugIssue1056.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * #%L - * Fiji viewer for MoBIE projects - * %% - * Copyright (C) 2018 - 2024 EMBL - * %% - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * #L% - */ -package debug; - -import net.imagej.ImageJ; -import org.embl.mobie.command.open.OpenHCSDatasetCommand; - -public class DebugIssue1056 -{ - public static void main( String[] args ) - { - new ImageJ().ui().showUI(); - final OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); - command.hcsDirectory = "/Users/tischer/Downloads/TBO-Test31-01-2024-10x-TL-DAPI_Plate_260/TimePoint_1"; - command.run(); - } -} diff --git a/src/test/java/debug/DebugIssue1066.java b/src/test/java/debug/DebugIssue1066.java deleted file mode 100644 index 8e3ea8e27..000000000 --- a/src/test/java/debug/DebugIssue1066.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * #%L - * Fiji viewer for MoBIE projects - * %% - * Copyright (C) 2018 - 2024 EMBL - * %% - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * #L% - */ -package debug; - -import net.imagej.ImageJ; -import org.embl.mobie.MoBIE; -import org.embl.mobie.MoBIESettings; -import org.embl.mobie.command.open.OpenHCSDatasetCommand; - -import java.io.IOException; - -public class DebugIssue1066 -{ - public static void main( String[] args ) throws IOException - { - final ImageJ imageJ = new ImageJ(); - imageJ.ui().showUI(); - - OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); - //command.hcsDirectory = "/Users/tischer/Downloads/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr"; - - // https://forum.image.sc/t/ome-zarr-hcs-with-labels-on-s3/97327/3 - command.hcsDirectory = "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0001A/2551.zarr"; - - command.run(); - } -} diff --git a/src/test/java/develop/OpenOMEZarrHCSWithLabelsFromS3.java b/src/test/java/develop/OpenOMEZarrHCSWithLabelsFromS3.java index fd62220f1..27dbf3df8 100644 --- a/src/test/java/develop/OpenOMEZarrHCSWithLabelsFromS3.java +++ b/src/test/java/develop/OpenOMEZarrHCSWithLabelsFromS3.java @@ -31,6 +31,8 @@ import net.imagej.ImageJ; import org.embl.mobie.command.open.OpenHCSDatasetCommand; +import java.io.File; + public class OpenOMEZarrHCSWithLabelsFromS3 { public static void main( String[] args ) @@ -40,7 +42,7 @@ public static void main( String[] args ) OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); // Does this really have labels? - command.hcsDirectory = "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0001A/2551.zarr"; + command.hcsDirectory = new File("https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0001A/2551.zarr"); command.run(); } } diff --git a/src/test/java/develop/hcs/HCSInCarta.java b/src/test/java/develop/hcs/HCSInCarta.java index c4289624b..49d3a5abb 100644 --- a/src/test/java/develop/hcs/HCSInCarta.java +++ b/src/test/java/develop/hcs/HCSInCarta.java @@ -31,6 +31,8 @@ import net.imagej.ImageJ; import org.embl.mobie.command.open.OpenHCSDatasetCommand; +import java.io.File; + public class HCSInCarta { public static void main( String[] args ) @@ -39,7 +41,8 @@ public static void main( String[] args ) imageJ.ui().showUI(); OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); - command.hcsDirectory = "/Users/tischer/Downloads/timepoint0"; + command.hcsDirectory = new File( "/Users/tischer/Downloads/timepoint0" ); + //command.hcsDirectory = new File( "/Users/tischer/Downloads/demo_data/Sample_005/Sample_005_images_20240202_1659_30/00000000" ); command.run(); } } diff --git a/src/test/java/issues/Issue1066.java b/src/test/java/issues/Issue1066.java index 6c3cfe3af..f2ce4f599 100644 --- a/src/test/java/issues/Issue1066.java +++ b/src/test/java/issues/Issue1066.java @@ -3,6 +3,8 @@ import net.imagej.ImageJ; import org.embl.mobie.command.open.OpenHCSDatasetCommand; +import java.io.File; + public class Issue1066 { public static void main( String[] args ) @@ -17,7 +19,7 @@ public static void main( String[] args ) // Open local HCS Plate // - does not open the labels...why? - command.hcsDirectory = "/Users/tischer/Downloads/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr"; + command.hcsDirectory = new File( "/Users/tischer/Downloads/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr" ); command.run(); } } diff --git a/src/test/java/org/embl/mobie/command/open/OpenOMEZarrHCSDatasetCommandTest.java b/src/test/java/org/embl/mobie/command/open/OpenOMEZarrHCSDatasetCommandTest.java index 6eeba4ed3..862853153 100644 --- a/src/test/java/org/embl/mobie/command/open/OpenOMEZarrHCSDatasetCommandTest.java +++ b/src/test/java/org/embl/mobie/command/open/OpenOMEZarrHCSDatasetCommandTest.java @@ -3,6 +3,8 @@ import net.imagej.ImageJ; import org.junit.jupiter.api.Test; +import java.io.File; + class OpenOMEZarrHCSDatasetCommandTest { static { net.imagej.patcher.LegacyInjector.preinit(); } @@ -13,7 +15,7 @@ public void test( ) new ImageJ().ui().showUI(); // initialise SciJava Services final OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); - command.hcsDirectory = "src/test/resources/single-plane-hcs.zarr"; + command.hcsDirectory = new File( "src/test/resources/single-plane-hcs.zarr" ); command.run(); // TODO: add a test assertion for ensuring the the number of channels is correct. diff --git a/src/test/java/projects/OpenLocalThomasMolDev.java b/src/test/java/projects/OpenLocalThomasMolDev.java index 75c091842..e45a3cf09 100644 --- a/src/test/java/projects/OpenLocalThomasMolDev.java +++ b/src/test/java/projects/OpenLocalThomasMolDev.java @@ -33,6 +33,7 @@ import org.embl.mobie.MoBIESettings; import org.embl.mobie.command.open.OpenHCSDatasetCommand; +import java.io.File; import java.io.IOException; public class OpenLocalThomasMolDev @@ -43,7 +44,7 @@ public static void main( String[] args ) imageJ.ui().showUI(); OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); - command.hcsDirectory = "/Users/tischer/Downloads/TBO-Test31-01-2024-10x-TL-DAPI_Plate_260/TimePoint_1"; + command.hcsDirectory = new File( "/Users/tischer/Downloads/TBO-Test31-01-2024-10x-TL-DAPI_Plate_260/TimePoint_1" ); command.run(); } } diff --git a/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSData.java b/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSData.java index 18084de45..8ec6ca3d1 100644 --- a/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSData.java +++ b/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSData.java @@ -31,13 +31,15 @@ import net.imagej.ImageJ; import org.embl.mobie.command.open.OpenHCSDatasetCommand; +import java.io.File; + public class OpenAnavoHCSData { public static void main( String[] args ) { new ImageJ().ui().showUI(); final OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); - command.hcsDirectory = "/Users/tischer/Desktop/moritz/U2OS_subset"; + command.hcsDirectory = new File( "/Users/tischer/Desktop/moritz/U2OS_subset" ); //command.hcsDirectory = "/Users/tischer/Desktop/moritz/CQ1_testfiles"; command.run(); } diff --git a/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java b/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java index f942bfd84..a72534969 100644 --- a/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java +++ b/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java @@ -39,7 +39,7 @@ public static void main( String[] args ) { new ImageJ().ui().showUI(); final OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); - command.hcsDirectory = "/Users/tischer/Desktop/moritz/U2OS_subset"; + command.hcsDirectory = new File( "/Users/tischer/Desktop/moritz/U2OS_subset" ); command.voxelDimensionFetching = OpenHCSDatasetCommand.VoxelDimensionFetching.FromOMEXML; command.omeXML = new File("/Users/tischer/Desktop/moritz/MeasurementResult.ome.xml"); command.run();