Skip to content

Commit

Permalink
Compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Oct 26, 2023
1 parent a2c6c84 commit 112d546
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/main/java/org/embl/mobie/MoBIE.java
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,23 @@ private void initDataSource( DataSource dataSource, String log )
return new CachedCellImage<>( name, storageLocation.absolutePath, storageLocation.getChannel(), imageDataFormat, ThreadHelper.sharedQueue );
}

if ( storageLocation instanceof Site )
if ( storageLocation instanceof Site ) // HCS data
{
return new SpimDataImage( ( Site ) storageLocation, name, ThreadHelper.sharedQueue );
final Site site = ( Site ) storageLocation;

if ( site.getImageDataFormat().equals( ImageDataFormat.SpimData ) )
{
// the whole plate is already initialised as one big SpimData
// note that channel <=> setupID
return new SpimDataImage( site.getSpimData(), site.channel, name, false );
}

if ( site.getImageDataFormat().equals( ImageDataFormat.OmeZarr ) )
{
return new SpimDataImage( ImageDataFormat.OmeZarr, site.absolutePath, site.channel, name, ThreadHelper.sharedQueue, false );
}

return new SpimDataImage( site, name, ThreadHelper.sharedQueue );
}

final String imagePath = getImageLocation( imageDataFormat, storageLocation );
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/embl/mobie/lib/MoBIEHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,21 @@ public static Metadata getMetadataFromSource( ImageDataSource imageDataSource )
return metadata;
}

public static ImagePlus openOMEZarrAsImagePlus( String path, int setupID )
{
try
{
AbstractSpimData< ? > spimData = new SpimDataOpener().open( path, ImageDataFormat.OmeZarr );
final SpimSource< ? > spimSource = new SpimSource( spimData, setupID, "" );
final ImagePlus imagePlus = new SourceToImagePlusConverter<>( spimSource ).getImagePlus( 0 );
return imagePlus;
} catch ( SpimDataException e )
{
e.printStackTrace();
throw new RuntimeException( e );
}
}

public static String createAbsolutePath( String rootFolder, String fileName, String folderName )
{
// The "root" is AutoMic table specific
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/embl/mobie/lib/hcs/Plate.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.embl.mobie.io.ImageDataFormat;
import org.embl.mobie.io.SpimDataOpener;
import org.embl.mobie.io.toml.TPosition;
import org.embl.mobie.lib.MoBIEHelper;
import org.embl.mobie.lib.color.ColorHelper;

import ch.epfl.biop.bdv.img.bioformats.entity.SeriesIndex;
Expand Down Expand Up @@ -174,6 +175,7 @@ private void buildPlateMap( List< String > paths )
channel = new Channel( channelName );
channelWellSites.put( channel, new HashMap<>() );

// FIXME Replace with MoBIEHelper.getMetadataFromImageFile
ImagePlus singleChannelImagePlus = operettaMetadata == null ? openImagePlus( path, channelName ) : null;

// set channel metadata
Expand Down

0 comments on commit 112d546

Please sign in to comment.