Class DownsampleTools
java.lang.Object
net.preibisch.mvrecon.process.downsampling.DownsampleTools
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]availableDownsamplings(mpicbg.spim.data.generic.AbstractSpimData<?> data, mpicbg.spim.data.sequence.ViewId viewId) static voidstatic intdownsampleFactor(int downsampleXY, int downsampleZ, mpicbg.spim.data.sequence.VoxelDimensions v) static intfindLowestResolutionLevel(mpicbg.spim.data.sequence.MultiResolutionImgLoader mrImgLoader, mpicbg.spim.data.sequence.ViewId view) getMipMapTransform(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId vd, long[] downsampleFactors) Returns the mipmap transform if you were to open that ViewId with this ImgLoader at the specified downsample factorsstatic net.imglib2.util.Pair<net.imglib2.RandomAccessibleInterval, net.imglib2.realtransform.AffineTransform3D> openAndDownsample(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId vd, long[] downsampleFactors, boolean virtualDownsampling) Opens the image at a specified downsampling level (e.g. 4,4,1).openAtLowestLevel(mpicbg.spim.data.sequence.ImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId view) openAtLowestLevel(mpicbg.spim.data.sequence.ImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId view, net.imglib2.realtransform.AffineTransform3D t) openDownsampled(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId viewId, net.imglib2.realtransform.AffineTransform3D m) Opens the image at an appropriate resolution for the provided transformation and concatenates an extra transformopenDownsampled(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId viewId, net.imglib2.realtransform.AffineTransform3D m, double[] usedDownsampleFactors) Opens the image at an appropriate resolution for the provided transformation and concatenates an extra transformstatic net.imglib2.util.Pair<net.imglib2.RandomAccessibleInterval, net.imglib2.realtransform.AffineTransform3D> openDownsampled2(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId viewId, net.imglib2.realtransform.AffineTransform3D m, double[] usedDownsampleFactors) Opens the image at an appropriate resolution for the provided transformation and concatenates an extra transformstatic long[]parseDownsampleChoice(String dsChoice) static StringprintDownsampling(double downsampling) For double-based downsampling Double.NaN means no downsampling to avoid unnecessary computations, here we return a String for that number that says "None" if it is Double.NaN
-
Field Details
-
ds
protected static final int[] ds
-
-
Constructor Details
-
DownsampleTools
public DownsampleTools()
-
-
Method Details
-
openDownsampled
public static net.imglib2.RandomAccessibleInterval openDownsampled(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId viewId, net.imglib2.realtransform.AffineTransform3D m) Opens the image at an appropriate resolution for the provided transformation and concatenates an extra transform- Parameters:
imgLoader- - the img loaderviewId- - the view idm- - WILL BE MODIFIED IF OPENED DOWNSAMPLED- Returns:
- - opened image
-
openDownsampled
public static net.imglib2.RandomAccessibleInterval openDownsampled(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId viewId, net.imglib2.realtransform.AffineTransform3D m, double[] usedDownsampleFactors) Opens the image at an appropriate resolution for the provided transformation and concatenates an extra transform- Parameters:
imgLoader- - the img loaderviewId- - the view idm- - WILL BE MODIFIED IF OPENED DOWNSAMPLEDusedDownsampleFactors- - which downsample factors were used to open the image (important for weights etc)- Returns:
- - opened image
-
openDownsampled2
public static net.imglib2.util.Pair<net.imglib2.RandomAccessibleInterval,net.imglib2.realtransform.AffineTransform3D> openDownsampled2(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId viewId, net.imglib2.realtransform.AffineTransform3D m, double[] usedDownsampleFactors) Opens the image at an appropriate resolution for the provided transformation and concatenates an extra transform- Parameters:
imgLoader- - the img loaderviewId- - the view idm- - NOT modifiedusedDownsampleFactors- - which downsample factors were used to open the image (important for weights etc)- Returns:
- - opened image and the affine transform that needs to be concatenated
-
printDownsampling
For double-based downsampling Double.NaN means no downsampling to avoid unnecessary computations, here we return a String for that number that says "None" if it is Double.NaN- Parameters:
downsampling- - the downsampling, Double.NaN means 1.0- Returns:
- - a String describing it
-
availableDownsamplings
public static String[] availableDownsamplings(mpicbg.spim.data.generic.AbstractSpimData<?> data, mpicbg.spim.data.sequence.ViewId viewId) -
parseDownsampleChoice
-
correctForDownsampling
public static void correctForDownsampling(List<InterestPoint> ips, net.imglib2.realtransform.AffineTransform3D t) -
downsampleFactor
public static int downsampleFactor(int downsampleXY, int downsampleZ, mpicbg.spim.data.sequence.VoxelDimensions v) -
openAtLowestLevel
public static net.imglib2.RandomAccessibleInterval openAtLowestLevel(mpicbg.spim.data.sequence.ImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId view) -
openAtLowestLevel
public static net.imglib2.RandomAccessibleInterval openAtLowestLevel(mpicbg.spim.data.sequence.ImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId view, net.imglib2.realtransform.AffineTransform3D t) -
findLowestResolutionLevel
public static int findLowestResolutionLevel(mpicbg.spim.data.sequence.MultiResolutionImgLoader mrImgLoader, mpicbg.spim.data.sequence.ViewId view) -
getMipMapTransform
public static net.imglib2.realtransform.AffineTransform3D getMipMapTransform(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId vd, long[] downsampleFactors) Returns the mipmap transform if you were to open that ViewId with this ImgLoader at the specified downsample factors- Parameters:
imgLoader- the imgloadervd- the view iddownsampleFactors- - specify which downsampling in each dimension (e.g. 1,2,4,8 )- Returns:
- the mipmap transform
-
openAndDownsample
public static net.imglib2.util.Pair<net.imglib2.RandomAccessibleInterval,net.imglib2.realtransform.AffineTransform3D> openAndDownsample(mpicbg.spim.data.generic.sequence.BasicImgLoader imgLoader, mpicbg.spim.data.sequence.ViewId vd, long[] downsampleFactors, boolean virtualDownsampling) Opens the image at a specified downsampling level (e.g. 4,4,1). It finds the closest available mipmap level and then downsamples to reach the target level- Parameters:
imgLoader- the imgloadervd- the view iddownsampleFactors- - specify which downsampling in each dimension (e.g. 1,2,4,8 )virtualDownsampling- - use virtual downsampling if the requested downsamplefactors are not precomputed- Returns:
- opened image and the mipmap transform
-