public class Downsample extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Downsample.ComputationType
Specify in which precision should intermediate values be computed.
|
static class |
Downsample.Offset
Specify where downsampled pixels should be placed.
|
| Constructor and Description |
|---|
Downsample() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends NativeType<T>> |
downsample(T type,
Downsample.ComputationType computationType,
Downsample.Offset offset,
boolean[] downsampleInDim)
Create a
UnaryBlockOperator to downsample (by factor 2) blocks of
the standard ImgLib2 RealType. |
static <T extends NativeType<T>> |
downsample(T type,
Downsample.ComputationType computationType,
Downsample.Offset offset,
int numDimensions)
Create a
UnaryBlockOperator to downsample (by factor 2, in all
dimensions) blocks of the standard ImgLib2 RealType. |
static <T extends NativeType<T>> |
downsample(T type,
Downsample.Offset offset,
int numDimensions)
Create a
UnaryBlockOperator to downsample (by factor 2, in all
dimensions) blocks of the standard ImgLib2 RealType. |
static <T extends NativeType<T>> |
downsample(T type,
int numDimensions)
Create a
UnaryBlockOperator to downsample (by factor 2, in all
dimensions) blocks of the standard ImgLib2 RealType. |
static long[] |
getDownsampledDimensions(long[] imgDimensions,
boolean[] downsampleInDim)
Returns recommended size of the downsampled image, given an input image
of size
imgDimensions. |
public static long[] getDownsampledDimensions(long[] imgDimensions,
boolean[] downsampleInDim)
imgDimensions. In each dimension (that should be
downsampled), the recommended size is input size / 2, rounding up (e.g.,
a 5 pixel input image should be downsampled to a 3 pixel image).imgDimensions - dimensions of the input imagedownsampleInDim - for each dimension (same length as imgDimensions}: true if the input image should be downpublic static <T extends NativeType<T>> UnaryBlockOperator<T,T> downsample(T type, Downsample.ComputationType computationType, Downsample.Offset offset, boolean[] downsampleInDim)
UnaryBlockOperator to downsample (by factor 2) blocks of
the standard ImgLib2 RealType. The downsampleInDim
argument spwecifies in which dimensions the input should be downsampled.
Supported types are UnsignedByteType, UnsignedShortType,
UnsignedIntType, ByteType, ShortType, IntType, LongType, FloatType, DoubleType).
T - the input/output typetype - instance of the input typecomputationType - specifies in which precision intermediate values should be
computed. For AUTO, the type that can represent the
input/output type without loss of precision is picked. That is,
FLOAT for u8, i8, u16, i16, i32, f32, and otherwise DOUBLE for u32, i64, f64.offset - Specifies where downsampled pixels should be placed.
HALF_PIXEL means that each downsampled pixel is computed
as the average of 2 neighboring pixels (respectively 4 pixels for
2D, 8 voxels for 3D, etc), and downsampled pixels are shifted by
half a pixel.
CENTERED means that each downsampled pixel is computed as
the weighted average (with weights {.25, .5, .25}) of 3
neighboring pixels (respectively 9 pixels for 2D, 27 voxels for 3D,
etc). Downsampled pixels are centered on input pixels.downsampleInDim - for each dimension d: if downsampleInDim[d]==true if
the input image should be downsampled in dimension d.UnaryBlockOperator to downsample blocks of type Tpublic static <T extends NativeType<T>> UnaryBlockOperator<T,T> downsample(T type, Downsample.ComputationType computationType, Downsample.Offset offset, int numDimensions)
UnaryBlockOperator to downsample (by factor 2, in all
dimensions) blocks of the standard ImgLib2 RealType.
Supported types are UnsignedByteType, UnsignedShortType,
UnsignedIntType, ByteType, ShortType, IntType, LongType, FloatType, DoubleType).
T - the input/output typetype - instance of the input typecomputationType - specifies in which precision intermediate values should be
computed. For AUTO, the type that can represent the
input/output type without loss of precision is picked. That is,
FLOAT for u8, i8, u16, i16, i32, f32, and otherwise DOUBLE for u32, i64, f64.offset - Specifies where downsampled pixels should be placed.
HALF_PIXEL means that each downsampled pixel is computed
as the average of 2 neighboring pixels (respectively 4 pixels for
2D, 8 voxels for 3D, etc), and downsampled pixels are shifted by
half a pixel.
CENTERED means that each downsampled pixel is computed as
the weighted average (with weights {.25, .5, .25}) of 3
neighboring pixels (respectively 9 pixels for 2D, 27 voxels for 3D,
etc). Downsampled pixels are centered on input pixels.numDimensions - number of dimensions in input/output image.UnaryBlockOperator to downsample blocks of type Tpublic static <T extends NativeType<T>> UnaryBlockOperator<T,T> downsample(T type, Downsample.Offset offset, int numDimensions)
UnaryBlockOperator to downsample (by factor 2, in all
dimensions) blocks of the standard ImgLib2 RealType.
Supported types are UnsignedByteType, UnsignedShortType,
UnsignedIntType, ByteType, ShortType, IntType, LongType, FloatType, DoubleType).
Precision for intermediate values is chosen as to represent the
input/output type without loss of precision is picked. That is, FLOAT for u8, i8, u16, i16, i32, f32, and otherwise DOUBLE for
u32, i64, f64.
T - the input/output typetype - instance of the input typeoffset - Specifies where downsampled pixels should be placed.
HALF_PIXEL means that each downsampled pixel is computed
as the average of 2 neighboring pixels (respectively 4 pixels for
2D, 8 voxels for 3D, etc), and downsampled pixels are shifted by
half a pixel.
CENTERED means that each downsampled pixel is computed as
the weighted average (with weights {.25, .5, .25}) of 3
neighboring pixels (respectively 9 pixels for 2D, 27 voxels for 3D,
etc). Downsampled pixels are centered on input pixels.numDimensions - number of dimensions in input/output image.UnaryBlockOperator to downsample blocks of type Tpublic static <T extends NativeType<T>> UnaryBlockOperator<T,T> downsample(T type, int numDimensions)
UnaryBlockOperator to downsample (by factor 2, in all
dimensions) blocks of the standard ImgLib2 RealType.
Supported types are UnsignedByteType, UnsignedShortType,
UnsignedIntType, ByteType, ShortType, IntType, LongType, FloatType, DoubleType).
Precision for intermediate values is chosen as to represent the
input/output type without loss of precision is picked. That is, FLOAT for u8, i8, u16, i16, i32, f32, and otherwise DOUBLE for
u32, i64, f64.
Downsampled pixels are computed as the average of 2 neighboring pixels (respectively 4 pixels for 2D, 8 voxels for 3D, etc). This means downsampled pixels are shifted by half a pixel.
T - the input/output typetype - instance of the input typenumDimensions - number of dimensions in input/output image.UnaryBlockOperator to downsample blocks of type TCopyright © 2009–2024 ImgLib2. All rights reserved.