Skip to content

Commit

Permalink
WIP open collection table
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Jun 26, 2024
1 parent e95e1e5 commit 3c4e13c
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,40 @@ public void addToDataset( Dataset dataset )
storageLocation.absolutePath = getUri( row );
ImageDataFormat imageDataFormat = ImageDataFormat.fromPath( storageLocation.absolutePath );
storageLocation.setChannel( getChannel( row ) ); // TODO: Fetch from table or URI? https://forum.image.sc/t/loading-only-one-channel-from-an-ome-zarr/97798
String name = getName( row );
String imageName = getName( row );
String pixelType = getPixelType( row );

Display< ? > display;

if ( pixelType.equals( CollectionTableConstants.LABELS ) )
{
// TODO: label table path could be fetched from collection table
final TableSource tableSource = null;

SegmentationDataSource segmentationDataSource =
SegmentationDataSource.create(
name,
imageName,
imageDataFormat,
storageLocation,
tableSource );

segmentationDataSource.preInit( false );
dataset.addDataSource( segmentationDataSource );

final SegmentationDisplay< ? > display = createLabelsDisplay( dataName );
addDisplayToViews( dataset, display, row );
display = createLabelsDisplay( imageName );
}
else // intensities
{
final ImageDataSource imageDataSource = new ImageDataSource( name, imageDataFormat, storageLocation );
final ImageDataSource imageDataSource = new ImageDataSource( imageName, imageDataFormat, storageLocation );
imageDataSource.preInit( false );
dataset.addDataSource( imageDataSource );

ImageDisplay< ? > imageDisplay = createImageDisplay( name, row );
addDisplayToViews( dataset, imageDisplay, row );
display = createImageDisplay( imageName, row );
}

IJ.log("## " + name );
addDisplayToViews( dataset, display, row );

IJ.log("## " + imageName );
IJ.log("URI: " + storageLocation.absolutePath );
IJ.log("Format: " + imageDataFormat );
IJ.log("Type: " + pixelType );
Expand Down

0 comments on commit 3c4e13c

Please sign in to comment.