Skip to content

Commit

Permalink
Add tests for 2d and 3d spots opening
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Dec 2, 2024
1 parent 1d7c722 commit fc00784
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/embl/mobie/lib/table/saw/TableOpener.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ private static Table openTableFile( StorageLocation storageLocation, String chun
}
else
{
final String path = resolveTablePath( IOHelper.combinePath( storageLocation.absolutePath, chunk ) );
String tablePath = chunk != null ? IOHelper.combinePath( storageLocation.absolutePath, chunk ) : storageLocation.absolutePath;
final String path = resolveTablePath( tablePath );
final Character separator = tableDataFormat.getSeparator();
return openDelimitedTextFile( numSamples, path, separator );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class OpenCollectionTableCommandTest
static { net.imagej.patcher.LegacyInjector.preinit(); }

@Test
public void blobsTable( )
public void blobs( )
{
final ImageJ imageJ = new ImageJ();
imageJ.ui().showUI();
Expand All @@ -25,7 +25,7 @@ public void blobsTable( )
}

@Test
public void clemTable( )
public void clem( )
{
final ImageJ imageJ = new ImageJ();
imageJ.ui().showUI();
Expand All @@ -37,21 +37,52 @@ public void clemTable( )
}

@Test
public void gridTable( )
public void grid( )
{
final ImageJ imageJ = new ImageJ();
imageJ.ui().showUI();

OpenCollectionTableCommand command = new OpenCollectionTableCommand();
command.table = new File( "src/test/resources/collections/blobs-grid-table.txt" );
// FIXME: Make this work with relative paths
command.dataRoot = OpenCollectionTableCommand.DataRoot.UseBelowDataRootFolder;
command.dataRootFile = new File( "/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/collections" );
command.bdvViewingMode = BdvViewingMode.TwoDimensional;
command.run();
}

@Test
public void spots2D( )
{
final ImageJ imageJ = new ImageJ();
imageJ.ui().showUI();

OpenCollectionTableCommand command = new OpenCollectionTableCommand();
command.table = new File( "src/test/resources/collections/spots-2d-collection.txt" );
// FIXME: Make this work with relative paths
command.dataRoot = OpenCollectionTableCommand.DataRoot.UseBelowDataRootFolder;
command.dataRootFile = new File( "/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/collections" );
command.bdvViewingMode = BdvViewingMode.TwoDimensional;
command.run();
}

@Test
public void spots3D( )
{
final ImageJ imageJ = new ImageJ();
imageJ.ui().showUI();

OpenCollectionTableCommand command = new OpenCollectionTableCommand();
command.table = new File( "src/test/resources/collections/spots-3d-collection.txt" );
// FIXME: Make this work with relative paths
command.dataRoot = OpenCollectionTableCommand.DataRoot.UseBelowDataRootFolder;
command.dataRootFile = new File( "/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/collections" );
command.bdvViewingMode = BdvViewingMode.ThreeDimensional;
command.run();
}

public static void main( String[] args )
{
new OpenCollectionTableCommandTest().gridTable();
new OpenCollectionTableCommandTest().spots3D();
}
}
2 changes: 2 additions & 0 deletions src/test/resources/collections/spots-2d-collection.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uri name type
spots-2d.txt spots spots
5 changes: 5 additions & 0 deletions src/test/resources/collections/spots-2d.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
spot_id x y
1 10 0
2 0 10
3 0 0
4 10 10
2 changes: 2 additions & 0 deletions src/test/resources/collections/spots-3d-collection.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uri name type
spots-3d.txt spots spots
5 changes: 5 additions & 0 deletions src/test/resources/collections/spots-3d.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
spot_id x y z
1 10 0 0
2 0 10 0.25
3 0 0 0
4 10 10 0.25

0 comments on commit fc00784

Please sign in to comment.