Skip to content

Commit

Permalink
#1137, add examined paths to HCS error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Jun 18, 2024
1 parent a577faf commit 3145a99
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 155 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>org.embl.mobie</groupId>
<artifactId>mobie-viewer-fiji</artifactId>
<version>5.0.6-SNAPSHOT</version>
<version>5.0.6</version>

<!-- force javadoc generation to fetch errors: -->
<!-- mvn javadoc:javadoc | grep error -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 )
{
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/embl/mobie/lib/hcs/Plate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down
47 changes: 0 additions & 47 deletions src/test/java/debug/DebugIssue1044.java

This file was deleted.

43 changes: 0 additions & 43 deletions src/test/java/debug/DebugIssue1056.java

This file was deleted.

53 changes: 0 additions & 53 deletions src/test/java/debug/DebugIssue1066.java

This file was deleted.

4 changes: 3 additions & 1 deletion src/test/java/develop/OpenOMEZarrHCSWithLabelsFromS3.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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();
}
}
5 changes: 4 additions & 1 deletion src/test/java/develop/hcs/HCSInCarta.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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();
}
}
4 changes: 3 additions & 1 deletion src/test/java/issues/Issue1066.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/projects/OpenLocalThomasMolDev.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3145a99

Please sign in to comment.