diff --git a/src/main/java/org/embl/mobie/command/open/OpenCollectionTableCommand.java b/src/main/java/org/embl/mobie/command/open/OpenCollectionTableCommand.java index 5224ee107..25ebf0ab8 100644 --- a/src/main/java/org/embl/mobie/command/open/OpenCollectionTableCommand.java +++ b/src/main/java/org/embl/mobie/command/open/OpenCollectionTableCommand.java @@ -54,7 +54,6 @@ public class OpenCollectionTableCommand implements Command { @Parameter( label = "Table Path", required = true ) public File table; - @Override public void run() { @@ -62,30 +61,6 @@ public void run() final MoBIESettings settings = new MoBIESettings(); - spatialCalibration.setVoxelDimensions( settings, table != null ? table.getAbsolutePath() : null ); - - List< String > imageList = new ArrayList<>(); - if ( images != null && ! images.equals( "" ) ) - { - imageList = Arrays.asList( images.split( "," ) ); - imageList = imageList.stream().map( s -> s.trim() ).collect( Collectors.toList() ); - } - - List< String > labelList = new ArrayList<>(); - if ( labels != null && ! labels.equals( "" ) ) - { - labelList = Arrays.asList( labels.split( "," ) ); - labelList = labelList.stream().map( s -> s.trim() ).collect( Collectors.toList() ); - } - - try - { - String rootPath = root == null ? null : root.getAbsolutePath(); - new MoBIE( table.getAbsolutePath(), imageList, labelList, rootPath, pathMapping ,gridType, settings ); - } - catch ( IOException e ) - { - e.printStackTrace(); - } + new MoBIE( MoBIEHelper.toURI( table ), settings, true ); } } diff --git a/src/main/java/org/embl/mobie/lib/table/columns/CollectionTableConstants.java b/src/main/java/org/embl/mobie/lib/table/columns/CollectionTableConstants.java index 22d347a6a..2dcc04f61 100644 --- a/src/main/java/org/embl/mobie/lib/table/columns/CollectionTableConstants.java +++ b/src/main/java/org/embl/mobie/lib/table/columns/CollectionTableConstants.java @@ -77,8 +77,9 @@ public class CollectionTableConstants * correspondingly many table rows with the *same URI* and the respective * different value in the "channel" column. * - * Notes: - * - One could consider to encode the channel directly within the URI: FIXME add link + * Discussion points: + * - One could consider to encode the channel directly within the URI + * - see: https://forum.image.sc/t/loading-only-one-channel-from-an-ome-zarr/97798 * * Supported values: * - Zero based positive integers @@ -123,6 +124,10 @@ public class CollectionTableConstants * No transformation will be applied if * - this column is absent. * - the given value cannot be parsed. + * + * Discussion points: + * - If one would not have commas to separate the values also CSV would be fine as a table format + * - For instance, we could use space as a separator instead of comma */ public static final String AFFINE = "affine"; diff --git a/src/test/java/examples/OpenCollectionTable.java b/src/test/java/examples/OpenCollectionTable.java index c6665397a..d80b0741c 100644 --- a/src/test/java/examples/OpenCollectionTable.java +++ b/src/test/java/examples/OpenCollectionTable.java @@ -3,6 +3,9 @@ import net.imagej.ImageJ; import org.embl.mobie.MoBIE; import org.embl.mobie.MoBIESettings; +import org.embl.mobie.command.open.OpenCollectionTableCommand; + +import java.io.File; public class OpenCollectionTable { @@ -11,9 +14,11 @@ public static void main( String[] args ) final ImageJ imageJ = new ImageJ(); imageJ.ui().showUI(); -// String tablePath = "src/test/resources/project-tables/clem-table.txt"; - String tablePath = "src/test/resources/project-tables/blobs-table.txt"; + String tablePath = "src/test/resources/collections/blobs-table.txt"; + File tableFile = new File( tablePath ); - new MoBIE( tablePath, new MoBIESettings(), true ); + OpenCollectionTableCommand command = new OpenCollectionTableCommand(); + command.table = tableFile; + command.run(); } } diff --git a/src/test/resources/project-tables/blobs-labels.tif b/src/test/resources/collections/blobs-labels.tif similarity index 100% rename from src/test/resources/project-tables/blobs-labels.tif rename to src/test/resources/collections/blobs-labels.tif diff --git a/src/test/resources/collections/blobs-table.txt b/src/test/resources/collections/blobs-table.txt new file mode 100644 index 000000000..793e72e62 --- /dev/null +++ b/src/test/resources/collections/blobs-table.txt @@ -0,0 +1,4 @@ +uri name type affine color view +/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/collections/blobs.tif shifted blobs intensities (1,0,0,-80,0,1,0,0,0,0,1,0) green +/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/collections/blobs.tif intensities segmented blobs +/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/collections/blobs-labels.tif labels segmented blobs \ No newline at end of file diff --git a/src/test/resources/project-tables/blobs.tif b/src/test/resources/collections/blobs.tif similarity index 100% rename from src/test/resources/project-tables/blobs.tif rename to src/test/resources/collections/blobs.tif diff --git a/src/test/resources/project-tables/clem-table.txt b/src/test/resources/collections/clem-table.txt similarity index 100% rename from src/test/resources/project-tables/clem-table.txt rename to src/test/resources/collections/clem-table.txt diff --git a/src/test/resources/project-tables/blobs-table.txt b/src/test/resources/project-tables/blobs-table.txt deleted file mode 100644 index b2eed9d9f..000000000 --- a/src/test/resources/project-tables/blobs-table.txt +++ /dev/null @@ -1,4 +0,0 @@ -uri name type affine color view -/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/project-tables/blobs.tif shifted blobs intensities (1, 0, 0, 80, 0, 1, 0, 30, 0, 0, 1, 0) green -/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/project-tables/blobs.tif intensities segmented blobs -/Users/tischer/Documents/mobie-viewer-fiji/src/test/resources/project-tables/blobs-labels.tif labels segmented blobs \ No newline at end of file