Skip to content

Commit

Permalink
removing outdated HDF5-int16 export (bigdataviewer/bigdataviewer-core…
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Oct 6, 2023
1 parent fff10f9 commit 3ca54a3
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,18 @@
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;
import org.janelia.saalfeldlab.n5.zarr.N5ZarrWriter;

import bdv.export.ExportMipmapInfo;
import bdv.export.ProposeMipmaps;
import fiji.util.gui.GenericDialogPlus;
import ij.gui.GenericDialog;
import mpicbg.spim.data.SpimDataException;
import mpicbg.spim.data.generic.sequence.BasicViewSetup;
import mpicbg.spim.data.sequence.DefaultVoxelDimensions;
import mpicbg.spim.data.sequence.FinalVoxelDimensions;
import mpicbg.spim.data.sequence.ViewDescription;
import mpicbg.spim.data.sequence.ViewId;
import mpicbg.spim.data.sequence.VoxelDimensions;
import net.imglib2.FinalDimensions;
import net.imglib2.FinalInterval;
import net.imglib2.Interval;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.converter.Converters;
import net.imglib2.img.display.imagej.ImageJFunctions;
import net.imglib2.multithreading.SimpleMultiThreading;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;
import net.imglib2.type.numeric.integer.ShortType;
import net.imglib2.type.numeric.integer.UnsignedByteType;
import net.imglib2.type.numeric.integer.UnsignedShortType;
import net.imglib2.type.numeric.real.FloatType;
Expand All @@ -71,7 +62,6 @@
import net.preibisch.legacy.io.IOFunctions;
import net.preibisch.mvrecon.fiji.plugin.fusion.FusionExportInterface;
import net.preibisch.mvrecon.fiji.plugin.resave.PluginHelper;
import net.preibisch.mvrecon.fiji.plugin.resave.Resave_HDF5;
import net.preibisch.mvrecon.fiji.plugin.util.GUIHelper;
import net.preibisch.mvrecon.process.deconvolution.DeconViews;
import net.preibisch.mvrecon.process.downsampling.lazy.LazyHalfPixelDownsample2x;
Expand Down Expand Up @@ -200,15 +190,16 @@ else if ( storageType == StorageType.HDF5 )

if ( UnsignedByteType.class.isInstance( type ) )
dataType = DataType.UINT8;
else if ( UnsignedShortType.class.isInstance( type ) && bdv && storageType == StorageType.HDF5 )
// can be removed because: https://github.com/bigdataviewer/bigdataviewer-core/pull/157
/*else if ( UnsignedShortType.class.isInstance( type ) && bdv && storageType == StorageType.HDF5 )
{
// Tobias: unfortunately I store as short and treat it as unsigned short in Java.
// The reason is, that when I wrote this, the jhdf5 library did not support unsigned short. It's terrible and should be fixed.
// https://github.com/bigdataviewer/bigdataviewer-core/issues/154
// https://imagesc.zulipchat.com/#narrow/stream/327326-BigDataViewer/topic/XML.2FHDF5.20specification
imgInterval = (RandomAccessibleInterval)Converters.convertRAI( (RandomAccessibleInterval<UnsignedShortType>)(Object)imgInterval, (i,o)->o.set( i.getShort() ), new ShortType() );
dataType = DataType.INT16;
}
}*/
else if ( UnsignedShortType.class.isInstance( type ) )
dataType = DataType.UINT16;
else if ( FloatType.class.isInstance( type ) )
Expand Down Expand Up @@ -471,6 +462,8 @@ else if ( dataType == DataType.FLOAT32 )
final RandomAccessibleInterval<FloatType> sourceGridBlock = Views.offsetInterval(downsampled, gridBlock[0], gridBlock[1]);
N5Utils.saveNonEmptyBlock(sourceGridBlock, driverVolumeWriter, datasetDownsampling, gridBlock[2], new FloatType());
}
// this can be removed because of: https://github.com/bigdataviewer/bigdataviewer-core/pull/157
/*
else if ( dataType == DataType.INT16 )
{
// Tobias: unfortunately I store as short and treat it as unsigned short in Java.
Expand All @@ -495,7 +488,7 @@ else if ( dataType == DataType.INT16 )
final RandomAccessibleInterval<ShortType> sourceGridBlock =
Converters.convertRAI( Views.offsetInterval(downsampled, gridBlock[0], gridBlock[1]), (i,o)->o.set( i.getShort() ), new ShortType() );
N5Utils.saveNonEmptyBlock(sourceGridBlock, driverVolumeWriter, datasetDownsampling, gridBlock[2], new ShortType());
}
}*/
else
{
IOFunctions.println( "Unsupported pixel type: " + dataType );
Expand Down

0 comments on commit 3ca54a3

Please sign in to comment.