Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5826fe8
start woprking on OME-ZARR GUI and export
StephanPreibisch Nov 14, 2024
a855ae5
basic infrastructure for omezarr is there, needs final push
StephanPreibisch Dec 3, 2024
b99a6cf
Merge branch 'master' into omezarr
StephanPreibisch Dec 6, 2024
e402393
fix command in plugins.config
StephanPreibisch Dec 14, 2024
3778046
OME-Zarr is slowly getting there ...
StephanPreibisch Dec 14, 2024
959c0cc
change Group to be of type ViewDescription since it anyways is; for o…
StephanPreibisch Dec 20, 2024
59c495c
first testable ome-zarr implementation (channels & timepoints into si…
StephanPreibisch Dec 20, 2024
c660a2f
finished first version that hopefully saves proper 5D OME-ZARR's
StephanPreibisch Jan 13, 2025
3b63cbd
use the 5D-downsampling code ...
StephanPreibisch Jan 13, 2025
63d8cf7
fix bug that dimensions can be 5D, first test with 3-channel export (…
StephanPreibisch Jan 14, 2025
a0b2f01
remove unnecessary if statement
StephanPreibisch Jan 14, 2025
0d2042b
fix GUI for OME-ZARR
StephanPreibisch Jan 16, 2025
582cef8
set OME-ZARR as default
StephanPreibisch Jan 16, 2025
e837c60
fix transformation bug
StephanPreibisch Jan 17, 2025
70c6700
fix base path
StephanPreibisch Jan 17, 2025
9a31c9c
first version of saving OME-ZARR attributes
StephanPreibisch Jan 17, 2025
c47be5f
add methods to return absolute downsampling as int[] and double[]
StephanPreibisch Jan 17, 2025
cf62ebd
create multiresolution pyramid by default
StephanPreibisch Jan 17, 2025
80d2b19
take downsampling and anisotropy into account...
StephanPreibisch Jan 17, 2025
850590a
add output and comments
StephanPreibisch Jan 18, 2025
b6a2f51
little cleanup
StephanPreibisch Jan 18, 2025
2e1fd3c
add method for computing resolution of s0 from metadata
StephanPreibisch Jan 18, 2025
b78c481
add support for writing many 3D OME-ZARR's
StephanPreibisch Jan 18, 2025
ed8eee6
fix OME-ZARR gui
StephanPreibisch Jan 18, 2025
b8f1064
fixed some bugs in 3D OME-ZARR export
StephanPreibisch Jan 18, 2025
3205504
slight fix in GUI
StephanPreibisch Jan 18, 2025
ed05b5b
fix imports
StephanPreibisch Jan 18, 2025
e756695
fix order of channels/timeseries
StephanPreibisch Jan 19, 2025
fad3629
simplify N5 export as well (not much choices for dataset structure le…
StephanPreibisch Jan 20, 2025
9ad812b
replace unit with "micrometer", to be supported across the board
StephanPreibisch Jan 20, 2025
03abcc8
use 0, 1, 2... instead of s0, s1, s2 ... for OME-ZARR
StephanPreibisch Jan 20, 2025
b89f853
use "/" as dimension-separator for ZARR
StephanPreibisch Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@
package net.preibisch.mvrecon.fiji.spimdata.imgloaders;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.function.Function;

import org.janelia.saalfeldlab.n5.DatasetAttributes;
import org.janelia.saalfeldlab.n5.N5Reader;
import org.janelia.saalfeldlab.n5.universe.N5Factory;
import org.janelia.saalfeldlab.n5.universe.N5Factory.StorageFormat;
import org.janelia.saalfeldlab.n5.universe.metadata.axes.Axis;
import org.janelia.saalfeldlab.n5.universe.metadata.ome.ngff.v04.OmeNgffMultiScaleMetadata;
Expand All @@ -36,6 +39,7 @@
import org.janelia.saalfeldlab.n5.universe.metadata.ome.ngff.v04.coordinateTransformations.ScaleCoordinateTransformation;
import org.janelia.saalfeldlab.n5.universe.metadata.ome.ngff.v04.coordinateTransformations.TranslationCoordinateTransformation;

import mpicbg.spim.data.sequence.VoxelDimensions;
import net.imglib2.realtransform.AffineTransform3D;
import util.URITools;

Expand All @@ -59,7 +63,7 @@ public static OmeNgffMultiScaleMetadata[] createOMEZarrMetadata(
final OmeNgffMultiScaleMetadata[] meta = new OmeNgffMultiScaleMetadata[ 1 ];

// dataset name and co
final String path = null;
final String path = "";
final String type = null;

// axis descriptions
Expand Down Expand Up @@ -102,7 +106,7 @@ public static OmeNgffMultiScaleMetadata[] createOMEZarrMetadata(
// if 4d and 5d, add 1's for C and T
for ( int d = 3; d < n; ++d )
{
translation[ d ] = 1.0;
translation[ d ] = 0.0;
scale[ d ] = 1.0;
}

Expand All @@ -126,6 +130,22 @@ public static OmeNgffMultiScaleMetadata[] createOMEZarrMetadata(
return meta;
}

// TODO: this is inaccurate, we should actually estimate it from the final transformn that is applied
public static double[] getResolutionS0( final VoxelDimensions vx, final double anisoF, final double downsamplingF )
{
final double[] resolutionS0 = vx.dimensionsAsDoubleArray();

// not preserving anisotropy
if ( Double.isNaN( anisoF ) )
resolutionS0[ 2 ] = resolutionS0[ 0 ];

// downsampling
if ( !Double.isNaN( downsamplingF ) )
Arrays.setAll( resolutionS0, d -> resolutionS0[ d ] * downsamplingF );

return resolutionS0;
}

public static void loadOMEZarr( final N5Reader n5, final String dataset )
{
//org.janelia.saalfeldlab.n5.universe.metadata.ome.ngff.v04.OmeNgffMetadata
Expand All @@ -151,8 +171,19 @@ public static void loadOMEZarr( final N5Reader n5, final String dataset )
}
}

public static void main( String[] args )
public static void main( String[] args ) throws URISyntaxException
{
final URI uri2 = URITools.toURI("https://keller-data.int.janelia.org/s12a/samples_for_stitching/Live%20zebra%20fish%20stitched/Live%20zebra%20plane%206/dataset.n5");///setup0/time;t0/");
System.out.println( uri2.toString() );

//FileSystemKeyValueAccess kva = new FileSystemKeyValueAccess( FileSystems.getDefault() );

String s = uri2.toString();
N5Factory f = new N5Factory();
N5Reader r = f.openFileSystemReader( s );
r.close();
System.exit( 0 );

//final URI uri = URITools.toURI( "https://storage.googleapis.com/jax-public-ngff/KOMP/adult_lacZ/ndp/Moxd1/23420_K35061_FGut.zarr/0/" );
//final String dataset = "/";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import fiji.util.gui.GenericDialogPlus;
import ij.ImagePlus;
import ij.gui.GenericDialog;
import mpicbg.spim.data.sequence.ViewId;
import mpicbg.spim.data.sequence.ViewDescription;
import net.imglib2.Interval;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.exception.ImgLibException;
Expand Down Expand Up @@ -90,7 +90,7 @@ public < T extends RealType< T > & NativeType< T > > boolean exportImage(
final double downsampling,
final double anisoF,
final String title,
final Group< ? extends ViewId > fusionGroup )
final Group< ? extends ViewDescription > fusionGroup )
{
// do nothing in case the image is null
if ( img == null )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@
import ch.epfl.biop.kheops.ometiff.OMETiffPyramidizerExporter;
import fiji.util.gui.GenericDialogPlus;
import mpicbg.spim.data.sequence.ViewDescription;
import mpicbg.spim.data.sequence.ViewId;
import net.imglib2.FinalInterval;
import net.imglib2.Interval;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.converter.ColorChannelOrder;
import net.imglib2.converter.Converters;
import net.imglib2.img.display.imagej.ImageJFunctions;
import net.imglib2.multithreading.SimpleMultiThreading;
import net.imglib2.position.FunctionRandomAccessible;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.type.NativeType;
Expand Down Expand Up @@ -99,7 +97,7 @@ public <T extends RealType<T> & NativeType<T>> boolean exportImage(
final double downsampling,
final double anisoF,
final String title,
final Group<? extends ViewId> fusionGroup )
final Group<? extends ViewDescription> fusionGroup )
{
// hack to make the interval divisable by 16 (see https://imagesc.zulipchat.com/#narrow/stream/212929-general/topic/Writing.20large.202D.20TIFFs)
if ( imgInterval.dimension( 0 ) % 16 != 0 || imgInterval.dimension( 1 ) % 16 != 0 )
Expand Down
Loading
Loading