Skip to content

Instantly share code, notes, and snippets.

@bogovicj
Created March 19, 2021 21:48
Show Gist options
  • Save bogovicj/01431efb9fe5701da1a40ca4c756f2d4 to your computer and use it in GitHub Desktop.
Save bogovicj/01431efb9fe5701da1a40ca4c756f2d4 to your computer and use it in GitHub Desktop.
Read a zarr volume and display with bigdataviewer
import net.imglib2.*;
import bdv.util.*;
import org.janelia.saalfeldlab.n5.zarr.*;
import org.janelia.saalfeldlab.n5.imglib2.*;
/*
* A groovy script for Fiji that reads a zarr volume and displays it using BigDataViewer
*
* John Bogovic
*/
try
{
RandomAccessibleInterval img = N5Utils.open( new N5ZarrReader( "/path/to/my.zarr" ), "/dataset" );
BdvFunctions.show( img, "a-descriptive-name" );
}
catch ( Exception e )
{
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment