- java.lang.Object
-
- bdv.export.ProposeMipmaps
-
public class ProposeMipmaps extends Object
Propose number of mipmap levels, as well subsampling factors and chunk size for each level.Choice of proposed chunksize is not based on any hard benchmark data currently. Chunk sizes are proposed such that chunks have power-of-two side lengths, are roughly square in world space, and contain close to (but not more than) a specified number of elements (4096 by default). It is very likely that more efficient choices can be found by manual tuning, depending on hardware and use case.
- Author:
- Tobias Pietzsch
-
-
Constructor Summary
Constructors Constructor Description ProposeMipmaps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetArrayString(int[][] resolutions)Formatin[][]array, such as resolutions or chunksizes definition, as a String (to be used in export dialog textfields).static voidnormalizeVoxelSize(double[] size)Adjust voxelSize such that the smallest dimension is 1.0static Map<Integer,ExportMipmapInfo>proposeMipmaps(mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> seq)Propose number of mipmap levels as well subsampling factors and chunk size for each level, for each setup of the given sequence.static ExportMipmapInfoproposeMipmaps(mpicbg.spim.data.generic.sequence.BasicViewSetup setup)Propose number of mipmap levels as well subsampling factors and chunk size for each level, based on the image and voxel size of the given setup.static ExportMipmapInfoproposeMipmaps(mpicbg.spim.data.generic.sequence.BasicViewSetup setup, int maxNumElements)Propose number of mipmap levels as well subsampling factors and chunk size for each level, based on the image and voxel size of the given setup.static int[]suggestPoTBlockSize(double[] voxelSize, int maxNumElements)Propose block size such that each dimension is power-of-two, number of elements is as big as possible, but not larger thanmaxNumElementsand the block (scaled by thevoxelSize) is as close to square as possible given constraints 1 and 2.static int[]suggestPoTBlockSize(double[] voxelSize, long[] size, int maxNumElements)Propose block size such that each dimension is power-of-two, number of elements is as big as possible, but not larger thanmaxNumElementsand the block (scaled by thevoxelSize) is as close to square as possible given constraints 1 and 2. Additionally, the fullsize[]of the image limits the number of bits spent in a particular dimension.
-
-
-
Method Detail
-
proposeMipmaps
public static Map<Integer,ExportMipmapInfo> proposeMipmaps(mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> seq)
Propose number of mipmap levels as well subsampling factors and chunk size for each level, for each setup of the given sequence.- Parameters:
seq-- Returns:
- map from setup id to proposed mipmap settings
-
proposeMipmaps
public static ExportMipmapInfo proposeMipmaps(mpicbg.spim.data.generic.sequence.BasicViewSetup setup)
Propose number of mipmap levels as well subsampling factors and chunk size for each level, based on the image and voxel size of the given setup. Chunks contain close to (but not more than) 4096 elements.- Parameters:
setup-- Returns:
- proposed mipmap settings
-
proposeMipmaps
public static ExportMipmapInfo proposeMipmaps(mpicbg.spim.data.generic.sequence.BasicViewSetup setup, int maxNumElements)
Propose number of mipmap levels as well subsampling factors and chunk size for each level, based on the image and voxel size of the given setup. Chunk sizes are proposed such that chunks have power-of-two side lengths, are roughly square in world space, and contain close to (but not more than)maxNumElements.- Parameters:
setup-maxNumElements-- Returns:
- proposed mipmap settings
-
getArrayString
public static String getArrayString(int[][] resolutions)
Formatin[][]array, such as resolutions or chunksizes definition, as a String (to be used in export dialog textfields).
-
normalizeVoxelSize
public static void normalizeVoxelSize(double[] size)
Adjust voxelSize such that the smallest dimension is 1.0- Parameters:
size-
-
suggestPoTBlockSize
public static int[] suggestPoTBlockSize(double[] voxelSize, int maxNumElements)Propose block size such that- each dimension is power-of-two,
- number of elements is as big as possible, but not larger than
maxNumElements - and the block (scaled by the
voxelSize) is as close to square as possible given constraints 1 and 2.
-
suggestPoTBlockSize
public static int[] suggestPoTBlockSize(double[] voxelSize, long[] size, int maxNumElements)Propose block size such that- each dimension is power-of-two,
- number of elements is as big as possible, but not larger than
maxNumElements - and the block (scaled by the
voxelSize) is as close to square as possible given constraints 1 and 2.
size[]of the image limits the number of bits spent in a particular dimension. For example, ifsize[2] = 3, then resulting block size will not exceed 4 in the Z dimension.
-
-