Skip to content

Commit

Permalink
Update CollectionTableConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Jun 26, 2024
1 parent 62defe5 commit 501e3a4
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,13 @@ public class OpenCollectionTableCommand implements Command {
@Parameter( label = "Table Path", required = true )
public File table;


@Override
public void run()
{
DebugTools.setRootLevel( "OFF" );

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 );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down
11 changes: 8 additions & 3 deletions src/test/java/examples/OpenCollectionTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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();
}
}
4 changes: 4 additions & 0 deletions src/test/resources/collections/blobs-table.txt
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
4 changes: 0 additions & 4 deletions src/test/resources/project-tables/blobs-table.txt

This file was deleted.

0 comments on commit 501e3a4

Please sign in to comment.