From 7692bf2f677df8648b1193288f7c4d9c36494e2b Mon Sep 17 00:00:00 2001 From: Christian Tischer Date: Mon, 4 Mar 2024 17:11:18 +0100 Subject: [PATCH] Implement reading pixel calibration from OME-XML --- src/main/java/org/embl/mobie/MoBIE.java | 14 ++--- src/main/java/org/embl/mobie/cmd/HCSCmd.java | 2 +- .../command/open/OpenHCSDatasetCommand.java | 33 ++++++++++- .../java/org/embl/mobie/lib/ThreadHelper.java | 4 +- .../org/embl/mobie/lib/hcs/OMEXMLParser.java | 5 +- .../java/org/embl/mobie/lib/hcs/Plate.java | 58 ++++++++++--------- src/test/java/develop/MergedGrid3D.java | 3 +- src/test/java/develop/hcs/HCS.java | 12 ++-- .../develop/hcs/HCSInCellAnalyzer6000.java | 2 +- src/test/java/develop/hcs/HCSIncuyte.java | 12 ++-- src/test/java/develop/hcs/HCSIncuyteRaw.java | 4 +- src/test/java/develop/hcs/HCSOMEZarr.java | 6 +- src/test/java/develop/hcs/HCSOMEZarrS3.java | 6 +- src/test/java/develop/hcs/HCSOperetta4.java | 2 +- src/test/java/develop/hcs/HCSOperetta5.java | 2 +- src/test/java/develop/hcs/HCSYokogawaCQ1.java | 2 +- .../projects/OpenLocalJulianNoTables.java | 3 +- src/test/java/projects/OpenLocalKarel.java | 3 +- src/test/java/projects/OpenLocalMarianne.java | 3 +- src/test/java/projects/OpenLocalShila.java | 3 +- src/test/java/projects/OpenLocalXRay.java | 3 +- .../java/projects/OpenRemoteArabidopsis.java | 3 +- .../projects/OpenRemoteDynoflagellate.java | 3 +- .../java/projects/OpenRemoteZebrafish.java | 3 +- .../OpenAnavoHCSDataWithVoxelDimensions.java | 19 ++++++ .../platybrowser/OpenLocalPlatynereis.java | 3 +- .../platybrowser/OpenRemotePlatynereis.java | 3 +- .../projects/rafael/CreateRafaelProject.java | 4 +- 28 files changed, 141 insertions(+), 79 deletions(-) create mode 100644 src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java diff --git a/src/main/java/org/embl/mobie/MoBIE.java b/src/main/java/org/embl/mobie/MoBIE.java index e6872cb9d..29e8fbdbd 100644 --- a/src/main/java/org/embl/mobie/MoBIE.java +++ b/src/main/java/org/embl/mobie/MoBIE.java @@ -36,6 +36,7 @@ import loci.common.DebugTools; import mpicbg.spim.data.generic.AbstractSpimData; import mpicbg.spim.data.sequence.ImgLoader; +import mpicbg.spim.data.sequence.VoxelDimensions; import net.imagej.ImageJ; import org.embl.mobie.io.ImageDataFormat; import org.embl.mobie.io.ome.zarr.loaders.N5OMEZarrImageLoader; @@ -118,11 +119,6 @@ public class MoBIE private HashMap< String, ImgLoader > sourceNameToImgLoader; private final ArrayList< String > projectCommands = new ArrayList<>(); - public MoBIE( String projectLocation ) throws IOException - { - this( projectLocation, new MoBIESettings() ); - } - public MoBIE( String projectLocation, MoBIESettings settings ) throws IOException { this.settings = settings; @@ -144,7 +140,7 @@ public static MoBIE getInstance() return moBIE; } - public MoBIE( String hcsDataLocation, MoBIESettings settings, double relativeWellMargin, double relativeSiteMargin ) throws IOException + public MoBIE( String hcsDataLocation, MoBIESettings settings, double relativeWellMargin, double relativeSiteMargin, @Nullable VoxelDimensions voxelDimensions ) throws IOException { this.settings = settings; this.projectLocation = hcsDataLocation; @@ -154,7 +150,7 @@ public MoBIE( String hcsDataLocation, MoBIESettings settings, double relativeWel IJ.log("\n# MoBIE" ); IJ.log("Opening: " + hcsDataLocation ); - openHCSDataset( relativeWellMargin, relativeSiteMargin ); + openHCSDataset( relativeWellMargin, relativeSiteMargin, voxelDimensions ); } public MoBIE( List< String > imagePaths, List< String > labelPaths, List< String > labelTablePaths, String root, GridType grid, MoBIESettings settings ) throws IOException @@ -261,10 +257,10 @@ private void initImageJAndMoBIE() moBIE = this; } - private void openHCSDataset( double wellMargin, double siteMargin ) throws IOException + private void openHCSDataset( double wellMargin, double siteMargin, @Nullable VoxelDimensions voxelDimensions ) throws IOException { initProject( "HCS" ); - final Plate plate = new Plate( projectLocation ); + final Plate plate = new Plate( projectLocation, voxelDimensions ); new HCSDataAdder( plate, wellMargin, siteMargin ).addData( dataset ); initUIandShowView( dataset.views().keySet().iterator().next() ); } diff --git a/src/main/java/org/embl/mobie/cmd/HCSCmd.java b/src/main/java/org/embl/mobie/cmd/HCSCmd.java index e06fc088a..37e4bcac7 100644 --- a/src/main/java/org/embl/mobie/cmd/HCSCmd.java +++ b/src/main/java/org/embl/mobie/cmd/HCSCmd.java @@ -60,7 +60,7 @@ public Void call() throws Exception { .openedFromCLI( true ) .removeSpatialCalibration( removeSpatialCalibration ); - new MoBIE( hcs, settings, wellMargin, siteMargin ); + new MoBIE( hcs, settings, wellMargin, siteMargin, null ); return null; } 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 1c49b3ff0..8b81bbfc9 100644 --- a/src/main/java/org/embl/mobie/command/open/OpenHCSDatasetCommand.java +++ b/src/main/java/org/embl/mobie/command/open/OpenHCSDatasetCommand.java @@ -28,15 +28,18 @@ */ package org.embl.mobie.command.open; +import mpicbg.spim.data.sequence.VoxelDimensions; import org.embl.mobie.MoBIE; import org.embl.mobie.MoBIESettings; import org.embl.mobie.command.CommandConstants; import org.embl.mobie.io.util.IOHelper; +import org.embl.mobie.lib.hcs.OMEXMLParser; import org.scijava.command.Command; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.widget.Button; +import java.io.File; import java.io.IOException; @@ -57,16 +60,42 @@ public class OpenHCSDatasetCommand implements Command @Parameter ( label = "Help", callback = "help") public Button help; + public enum VoxelDimensionFetching + { + FromImageFiles, + FromOMEXML + } + + @Parameter ( label = "Voxel Dimensions" ) + public VoxelDimensionFetching voxelDimensionFetching = VoxelDimensionFetching.FromImageFiles; + + @Parameter ( label = "OME-XML (optional)", required = false ) + public File omeXML; + @Override public void run() { + VoxelDimensions voxelDimensions = initVoxelDimensions(); + try { - new MoBIE( hcsDirectory, new MoBIESettings(), wellMargin, siteMargin ); + new MoBIE( hcsDirectory, new MoBIESettings(), wellMargin, siteMargin, voxelDimensions ); } catch ( IOException e ) { - e.printStackTrace(); + throw new RuntimeException( e ); + } + } + + private VoxelDimensions initVoxelDimensions() + { + if ( voxelDimensionFetching.equals( VoxelDimensionFetching.FromOMEXML ) ) + { + return OMEXMLParser.readVoxelDimensions( omeXML ); + } + else + { + return null; } } diff --git a/src/main/java/org/embl/mobie/lib/ThreadHelper.java b/src/main/java/org/embl/mobie/lib/ThreadHelper.java index e81c489d1..18c9a65bc 100644 --- a/src/main/java/org/embl/mobie/lib/ThreadHelper.java +++ b/src/main/java/org/embl/mobie/lib/ThreadHelper.java @@ -51,7 +51,9 @@ public class ThreadHelper public static ExecutorService ioExecutorService = Executors.newFixedThreadPool( N_IO_THREADS ); - public static final SharedQueue sharedQueue = new SharedQueue( N_IO_THREADS ); + public static final int NUM_PRIORITIES = 6; // https://imagesc.zulipchat.com/#narrow/stream/327326-BigDataViewer/topic/SharedQueue + + public static final SharedQueue sharedQueue = new SharedQueue( N_IO_THREADS, NUM_PRIORITIES ); public static ExecutorService executorService = Executors.newFixedThreadPool( N_THREADS ); diff --git a/src/main/java/org/embl/mobie/lib/hcs/OMEXMLParser.java b/src/main/java/org/embl/mobie/lib/hcs/OMEXMLParser.java index cefc4d736..24d9f594a 100644 --- a/src/main/java/org/embl/mobie/lib/hcs/OMEXMLParser.java +++ b/src/main/java/org/embl/mobie/lib/hcs/OMEXMLParser.java @@ -14,13 +14,12 @@ public class OMEXMLParser { - public static VoxelDimensions readVoxelDimensions( String filePath ) + public static VoxelDimensions readVoxelDimensions( File omeXml ) { try { - File inputFile = new File(filePath); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(inputFile); + Document doc = dBuilder.parse(omeXml); doc.getDocumentElement().normalize(); // Assuming VoxelDimensions is a class you have that can store these values 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 fd50eed57..134bda942 100644 --- a/src/main/java/org/embl/mobie/lib/hcs/Plate.java +++ b/src/main/java/org/embl/mobie/lib/hcs/Plate.java @@ -51,6 +51,7 @@ import ch.epfl.biop.bdv.img.bioformats.entity.SeriesIndex; import org.embl.mobie.lib.hcs.omezarr.OMEZarrHCSHelper; +import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -82,14 +83,16 @@ public class Plate private boolean siteIDsAreOneBased = true; private boolean is2d = true; private int numSlices; + private boolean fetchSpatialMetadata = true; - public Plate( String hcsDirectory ) throws IOException + public Plate( String hcsDirectory, @Nullable VoxelDimensions voxelDimensions ) throws IOException { this.hcsDirectory = hcsDirectory; + this.voxelDimensions = voxelDimensions; - // FIXME: fetch operetta paths from XML?! - // FIXME: fetch OME-Zarr paths entry point JSON?! + // TODO: fetch operetta paths from XML?! + // TODO: fetch OME-Zarr paths entry point JSON?! IJ.log( "Looking for image files..." ); long start = System.currentTimeMillis(); @@ -217,10 +220,10 @@ private void buildPlateMap( List< String > imagePaths ) channel.setContrastLimits( contrastLimits ); } - // determine spatial metadata (for all channels the same) - // - if ( voxelDimensions == null ) + if ( fetchSpatialMetadata ) { + fetchSpatialMetadata= false; // should be the same for all files and channels + if ( operettaMetadata != null ) { voxelDimensions = operettaMetadata.getVoxelDimensions( imagePath ); @@ -230,27 +233,30 @@ private void buildPlateMap( List< String > imagePaths ) { final Calibration calibration = singleChannelImagePlus.getCalibration(); - if ( hcsPattern.hasZ() ) - { - /* - If the z-positions are distributed over multiple files - typically the z-calibration metadata in the individual files is wrong. - We thus just put something sensible here such that browsing in BDV along the - z-axis is convenient - */ - voxelDimensions = new FinalVoxelDimensions( - calibration.getUnit(), - calibration.pixelWidth, - calibration.pixelHeight, - 10 * calibration.pixelHeight ); - } - else + if ( voxelDimensions == null ) { - voxelDimensions = new FinalVoxelDimensions( - calibration.getUnit(), - calibration.pixelWidth, - calibration.pixelHeight, - calibration.pixelDepth ); + if ( hcsPattern.hasZ() ) + { + /* + If the z-positions are distributed over multiple files + typically the z-calibration metadata in the individual files is wrong. + We thus just put something sensible here such that browsing in BDV along the + z-axis is convenient + */ + voxelDimensions = new FinalVoxelDimensions( + calibration.getUnit(), + calibration.pixelWidth, + calibration.pixelHeight, + 10 * calibration.pixelHeight ); + } + else + { + voxelDimensions = new FinalVoxelDimensions( + calibration.getUnit(), + calibration.pixelWidth, + calibration.pixelHeight, + calibration.pixelDepth ); + } } siteDimensions = new int[]{ singleChannelImagePlus.getWidth(), singleChannelImagePlus.getHeight() }; diff --git a/src/test/java/develop/MergedGrid3D.java b/src/test/java/develop/MergedGrid3D.java index 5879ba736..6e2a63713 100644 --- a/src/test/java/develop/MergedGrid3D.java +++ b/src/test/java/develop/MergedGrid3D.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -41,7 +42,7 @@ public static void main( String[] args ) imageJ.ui().showUI(); try { - new MoBIE("/Users/tischer/Downloads/example/mobie-example-project" );//.getViewManager().show( "cell-segmentation" ); + new MoBIE("/Users/tischer/Downloads/example/mobie-example-project", new MoBIESettings() );//.getViewManager().show( "cell-segmentation" ); } catch ( IOException e) { e.printStackTrace(); } diff --git a/src/test/java/develop/hcs/HCS.java b/src/test/java/develop/hcs/HCS.java index 04af09037..1e82e5cbb 100644 --- a/src/test/java/develop/hcs/HCS.java +++ b/src/test/java/develop/hcs/HCS.java @@ -41,16 +41,16 @@ public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - //new MoBIE( "/Users/tischer/Downloads/Operetta", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Downloads/Operetta", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/Users/tischer/Downloads/IncuCyte", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Downloads/IncuCyte", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/Users/tischer/Downloads/incu2/", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Downloads/incu2/", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/g/cba/exchange/mobie-data/incucyte-drug-screen/images", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/g/cba/exchange/mobie-data/incucyte-drug-screen/images", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/Users/tischer/Documents/faim-hcs/resources/MIP-2P-2sub/2022-07-05/1075", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Documents/faim-hcs/resources/MIP-2P-2sub/2022-07-05/1075", new MoBIESettings(), 0.1, 0.0, null ); - new MoBIE( "/Volumes/cba/exchange/hcs-test/Samples", new MoBIESettings(), 0.1, 0.0 ); + new MoBIE( "/Volumes/cba/exchange/hcs-test/Samples", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSInCellAnalyzer6000.java b/src/test/java/develop/hcs/HCSInCellAnalyzer6000.java index 34f333fad..5990be487 100644 --- a/src/test/java/develop/hcs/HCSInCellAnalyzer6000.java +++ b/src/test/java/develop/hcs/HCSInCellAnalyzer6000.java @@ -42,6 +42,6 @@ public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - new MoBIE( "/Users/tischer/Downloads/incell", new MoBIESettings(), 0.1, 0.0 ); + new MoBIE( "/Users/tischer/Downloads/incell", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSIncuyte.java b/src/test/java/develop/hcs/HCSIncuyte.java index 9b6a4ab1f..750d1a418 100644 --- a/src/test/java/develop/hcs/HCSIncuyte.java +++ b/src/test/java/develop/hcs/HCSIncuyte.java @@ -41,16 +41,16 @@ public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - //new MoBIE( "/Users/tischer/Downloads/Operetta", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Downloads/Operetta", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/Users/tischer/Downloads/IncuCyte", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Downloads/IncuCyte", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/Users/tischer/Downloads/incu2/", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Downloads/incu2/", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/g/cba/exchange/mobie-data/incucyte-drug-screen/images", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/g/cba/exchange/mobie-data/incucyte-drug-screen/images", new MoBIESettings(), 0.1, 0.0, null ); - //new MoBIE( "/Users/tischer/Documents/faim-hcs/resources/MIP-2P-2sub/2022-07-05/1075", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Documents/faim-hcs/resources/MIP-2P-2sub/2022-07-05/1075", new MoBIESettings(), 0.1, 0.0, null ); - new MoBIE( "/Volumes/cba/exchange/hcs-test/Samples", new MoBIESettings(), 0.1, 0.0 ); + new MoBIE( "/Volumes/cba/exchange/hcs-test/Samples", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSIncuyteRaw.java b/src/test/java/develop/hcs/HCSIncuyteRaw.java index 61972a28c..3f9f75192 100644 --- a/src/test/java/develop/hcs/HCSIncuyteRaw.java +++ b/src/test/java/develop/hcs/HCSIncuyteRaw.java @@ -41,7 +41,7 @@ class HCSIncuyteRaw public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - //new MoBIE( "/Users/tischer/Downloads/incu-test-data/2207/19", new MoBIESettings(), 0.1, 0.0 ); - new MoBIE( "https://s3.embl.de/i2k-2020/incu-test-data/2207/19", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Users/tischer/Downloads/incu-test-data/2207/19", new MoBIESettings(), 0.1, 0.0, null ); + new MoBIE( "https://s3.embl.de/i2k-2020/incu-test-data/2207/19", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSOMEZarr.java b/src/test/java/develop/hcs/HCSOMEZarr.java index 8e9d7ccc1..066ed6aef 100644 --- a/src/test/java/develop/hcs/HCSOMEZarr.java +++ b/src/test/java/develop/hcs/HCSOMEZarr.java @@ -41,8 +41,8 @@ public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - //new MoBIE( "/Volumes/cba/exchange/ome-zarr/bugra/HCS/testdata.zarr", new MoBIESettings(), 0.1, 0.0 ); - //new MoBIE( "/Users/tischer/Downloads/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr", new MoBIESettings(), 0.1, 0.0 ); - new MoBIE( "/Users/tischer/Downloads/test-plate.zarr", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "/Volumes/cba/exchange/ome-zarr/bugra/HCS/testdata.zarr", new MoBIESettings(), 0.1, 0.0, null ); + //new MoBIE( "/Users/tischer/Downloads/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr", new MoBIESettings(), 0.1, 0.0, null ); + new MoBIE( "/Users/tischer/Downloads/test-plate.zarr", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSOMEZarrS3.java b/src/test/java/develop/hcs/HCSOMEZarrS3.java index b05f992db..b26223c92 100644 --- a/src/test/java/develop/hcs/HCSOMEZarrS3.java +++ b/src/test/java/develop/hcs/HCSOMEZarrS3.java @@ -41,8 +41,8 @@ public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - //new MoBIE( "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/5966.zarr", new MoBIESettings(), 0.1, 0.0 ); - //new MoBIE( "https://radosgw.public.os2.wwu.de/ngff/test.zarr", new MoBIESettings(), 0.1, 0.0 ); - new MoBIE( "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/2551.zarr", new MoBIESettings(), 0.1, 0.0 ); + //new MoBIE( "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/5966.zarr", new MoBIESettings(), 0.1, 0.0, null ); + //new MoBIE( "https://radosgw.public.os2.wwu.de/ngff/test.zarr", new MoBIESettings(), 0.1, 0.0, null ); + new MoBIE( "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/2551.zarr", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSOperetta4.java b/src/test/java/develop/hcs/HCSOperetta4.java index 4c5c350b3..94d6fadaf 100644 --- a/src/test/java/develop/hcs/HCSOperetta4.java +++ b/src/test/java/develop/hcs/HCSOperetta4.java @@ -40,6 +40,6 @@ class HCSOperetta4 public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - new MoBIE( "/Volumes/cba/exchange/hcs-test/operetta4/Samples", new MoBIESettings(), 0.1, 0.0 ); + new MoBIE( "/Volumes/cba/exchange/hcs-test/operetta4/Samples", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSOperetta5.java b/src/test/java/develop/hcs/HCSOperetta5.java index d0783b7ad..894863a95 100644 --- a/src/test/java/develop/hcs/HCSOperetta5.java +++ b/src/test/java/develop/hcs/HCSOperetta5.java @@ -40,6 +40,6 @@ class HCSOperetta5 public static void main( String[] args ) throws SpimDataException, IOException { new ImageJ().ui().showUI(); - new MoBIE( "/Volumes/cba/exchange/hcs-test/operetta5/CLSsamples", new MoBIESettings(), 0.1, 0.0 ); + new MoBIE( "/Volumes/cba/exchange/hcs-test/operetta5/CLSsamples", new MoBIESettings(), 0.1, 0.0, null ); } } diff --git a/src/test/java/develop/hcs/HCSYokogawaCQ1.java b/src/test/java/develop/hcs/HCSYokogawaCQ1.java index 9b98dd6da..eaa56297f 100644 --- a/src/test/java/develop/hcs/HCSYokogawaCQ1.java +++ b/src/test/java/develop/hcs/HCSYokogawaCQ1.java @@ -23,6 +23,6 @@ public static void main( String[] args ) throws SpimDataException, IOException new MoBIE( "/Users/tischer/Desktop/moritz/CQ1_testfiles", new MoBIESettings().removeSpatialCalibration( true ), // TODO: what is the z-spacing, how to add this? 0.1, - 0.0 ); + 0.0, null ); } } diff --git a/src/test/java/projects/OpenLocalJulianNoTables.java b/src/test/java/projects/OpenLocalJulianNoTables.java index 126972287..0943be882 100644 --- a/src/test/java/projects/OpenLocalJulianNoTables.java +++ b/src/test/java/projects/OpenLocalJulianNoTables.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -39,7 +40,7 @@ public static void main( String[] args ) throws IOException { final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - final MoBIE moBIE = new MoBIE("/Volumes/emcf/hennies/for_constantin/mobie_no_table_test/" ); + final MoBIE moBIE = new MoBIE("/Volumes/emcf/hennies/for_constantin/mobie_no_table_test/", new MoBIESettings() ); moBIE.getViewManager().show( "seg-test" ); } } diff --git a/src/test/java/projects/OpenLocalKarel.java b/src/test/java/projects/OpenLocalKarel.java index 51179c93c..3d833969e 100644 --- a/src/test/java/projects/OpenLocalKarel.java +++ b/src/test/java/projects/OpenLocalKarel.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -38,6 +39,6 @@ public class OpenLocalKarel public static void main(String[] args) throws IOException { final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - new MoBIE( "/Volumes/schwab/Karel/MOBIE/MOBIE1_bc"); + new MoBIE( "/Volumes/schwab/Karel/MOBIE/MOBIE1_bc", new MoBIESettings() ); } } diff --git a/src/test/java/projects/OpenLocalMarianne.java b/src/test/java/projects/OpenLocalMarianne.java index 7a553c91c..49454b253 100644 --- a/src/test/java/projects/OpenLocalMarianne.java +++ b/src/test/java/projects/OpenLocalMarianne.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -38,6 +39,6 @@ public class OpenLocalMarianne public static void main(String[] args) throws IOException { final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - new MoBIE( "/Volumes/cba/exchange/marianne-beckwidth/220509_MSB26_sample2_MoBIE"); + new MoBIE( "/Volumes/cba/exchange/marianne-beckwidth/220509_MSB26_sample2_MoBIE", new MoBIESettings() ); } } diff --git a/src/test/java/projects/OpenLocalShila.java b/src/test/java/projects/OpenLocalShila.java index 5900b1a9e..7994c4ee5 100644 --- a/src/test/java/projects/OpenLocalShila.java +++ b/src/test/java/projects/OpenLocalShila.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -40,7 +41,7 @@ public static void main( String[] args ) final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); try { - new MoBIE("/Volumes/kreshuk/data/marioni/shila/mouse-atlas-2020/ngff/" ); + new MoBIE("/Volumes/kreshuk/data/marioni/shila/mouse-atlas-2020/ngff/", new MoBIESettings() ); } catch (IOException e) { e.printStackTrace(); } diff --git a/src/test/java/projects/OpenLocalXRay.java b/src/test/java/projects/OpenLocalXRay.java index 221583312..613db0659 100644 --- a/src/test/java/projects/OpenLocalXRay.java +++ b/src/test/java/projects/OpenLocalXRay.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -38,6 +39,6 @@ public class OpenLocalXRay public static void main(String[] args) throws IOException { final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - new MoBIE( "/Volumes/emcf/Hamburg_XRay/20220522/mobie_demo"); + new MoBIE( "/Volumes/emcf/Hamburg_XRay/20220522/mobie_demo", new MoBIESettings() ); } } diff --git a/src/test/java/projects/OpenRemoteArabidopsis.java b/src/test/java/projects/OpenRemoteArabidopsis.java index 792bc2fca..50823a5ff 100644 --- a/src/test/java/projects/OpenRemoteArabidopsis.java +++ b/src/test/java/projects/OpenRemoteArabidopsis.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -39,6 +40,6 @@ public static void main( String[] args ) throws IOException { final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - new MoBIE("https://github.com/mobie/arabidopsis-root-lm-datasets"); + new MoBIE("https://github.com/mobie/arabidopsis-root-lm-datasets", new MoBIESettings() ); } } diff --git a/src/test/java/projects/OpenRemoteDynoflagellate.java b/src/test/java/projects/OpenRemoteDynoflagellate.java index 1850a765e..898071eda 100644 --- a/src/test/java/projects/OpenRemoteDynoflagellate.java +++ b/src/test/java/projects/OpenRemoteDynoflagellate.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -39,6 +40,6 @@ public static void main( String[] args ) throws IOException { final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - new MoBIE( "https://github.com/mobie/environmental-dinoflagellate-vCLEM" ); + new MoBIE( "https://github.com/mobie/environmental-dinoflagellate-vCLEM", new MoBIESettings() ); } } diff --git a/src/test/java/projects/OpenRemoteZebrafish.java b/src/test/java/projects/OpenRemoteZebrafish.java index 8ba052223..78b2f0177 100644 --- a/src/test/java/projects/OpenRemoteZebrafish.java +++ b/src/test/java/projects/OpenRemoteZebrafish.java @@ -30,6 +30,7 @@ import org.embl.mobie.MoBIE; import net.imagej.ImageJ; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -39,6 +40,6 @@ public static void main( String[] args ) throws IOException { final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - new MoBIE("https://github.com/mobie/zebrafish-lm-datasets" ); + new MoBIE("https://github.com/mobie/zebrafish-lm-datasets", new MoBIESettings() ); } } diff --git a/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java b/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java new file mode 100644 index 000000000..8fc7751ac --- /dev/null +++ b/src/test/java/projects/colony_detection_anavo/OpenAnavoHCSDataWithVoxelDimensions.java @@ -0,0 +1,19 @@ +package projects.colony_detection_anavo; + +import net.imagej.ImageJ; +import org.embl.mobie.command.open.OpenHCSDatasetCommand; + +import java.io.File; + +public class OpenAnavoHCSDataWithVoxelDimensions +{ + public static void main( String[] args ) + { + new ImageJ().ui().showUI(); + final OpenHCSDatasetCommand command = new OpenHCSDatasetCommand(); + command.hcsDirectory = "/Users/tischer/Desktop/moritz/U2OS_subset"; + command.voxelDimensionFetching = OpenHCSDatasetCommand.VoxelDimensionFetching.FromOMEXML; + command.omeXML = new File("/Users/tischer/Desktop/moritz/MeasurementResult.ome.xml"); + command.run(); + } +} diff --git a/src/test/java/projects/platybrowser/OpenLocalPlatynereis.java b/src/test/java/projects/platybrowser/OpenLocalPlatynereis.java index 6c6091b33..998b3ed43 100644 --- a/src/test/java/projects/platybrowser/OpenLocalPlatynereis.java +++ b/src/test/java/projects/platybrowser/OpenLocalPlatynereis.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -40,6 +41,6 @@ public static void main( String[] args ) throws IOException final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - final MoBIE moBIE = new MoBIE( "/Volumes/cba/exchange/buglakova/platybrowser-smfish-project"); + final MoBIE moBIE = new MoBIE( "/Volumes/cba/exchange/buglakova/platybrowser-smfish-project", new MoBIESettings() ); } } diff --git a/src/test/java/projects/platybrowser/OpenRemotePlatynereis.java b/src/test/java/projects/platybrowser/OpenRemotePlatynereis.java index 59df81ce7..01d89d6ff 100644 --- a/src/test/java/projects/platybrowser/OpenRemotePlatynereis.java +++ b/src/test/java/projects/platybrowser/OpenRemotePlatynereis.java @@ -30,6 +30,7 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; +import org.embl.mobie.MoBIESettings; import java.io.IOException; @@ -40,7 +41,7 @@ public static void main( String[] args ) throws IOException final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); - final MoBIE moBIE = new MoBIE( "https://github.com/mobie/platybrowser-project"); + final MoBIE moBIE = new MoBIE( "https://github.com/mobie/platybrowser-project", new MoBIESettings() ); moBIE.getViewManager().show( "cells" ); } } diff --git a/src/test/java/projects/rafael/CreateRafaelProject.java b/src/test/java/projects/rafael/CreateRafaelProject.java index 94fe02ca6..9a8f35e3f 100644 --- a/src/test/java/projects/rafael/CreateRafaelProject.java +++ b/src/test/java/projects/rafael/CreateRafaelProject.java @@ -34,11 +34,11 @@ import ij.plugin.ChannelSplitter; import ij.plugin.Duplicator; import ij.plugin.frame.RoiManager; -import io.scif.img.IO; import mpicbg.spim.data.SpimDataException; import net.imagej.ImageJ; import net.imagej.patcher.LegacyInjector; import net.imglib2.realtransform.AffineTransform3D; +import org.embl.mobie.MoBIESettings; import org.embl.mobie.io.ImageDataFormat; import org.embl.mobie.MoBIE; import org.embl.mobie.io.util.IOHelper; @@ -110,7 +110,7 @@ public static void main( String[] args ) throws IOException, SpimDataException } // Show the project in MoBIE - new MoBIE( projectDirectory); + new MoBIE( projectDirectory, new MoBIESettings() ); } private static ImagePlus cropAndClearOutside( ImagePlus imp, Roi roi )