Package org.anchoranalysis.test.image
Class ChannelFixture
Object
ChannelFixture
Creates a
Channel
to use in tests.- Author:
- Owen Feehan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Functional interface for creating intensity values for a given location. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Extent
Large 2D extent for testing.static final Extent
Large 3D extent for testing.static final Extent
Medium 2D extent for testing.static final Extent
Medium 3D extent for testing.static final Extent
Small 2D extent for testing.static final Extent
Small 3D extent for testing. -
Constructor Summary
ConstructorsConstructorDescriptionChannelFixture
(boolean includeResolution) Creates a newChannelFixture
instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateChannel
(Extent extent, ChannelFixture.IntensityFunction createIntensity, VoxelDataType channelVoxelType) Creates a channel with specified extent, intensity function, and voxel data type.static int
diffModulo
(int x, int y, int z) Calculates intensity as the difference of coordinates modulo 256.static int
multModulo
(int x, int y, int z) Calculates intensity as the product of coordinates modulo 256.static int
sumModulo
(int x, int y, int z) Calculates intensity as the sum of coordinates modulo 256.
-
Field Details
-
SMALL_3D
Small 3D extent for testing. -
SMALL_2D
Small 2D extent for testing. -
MEDIUM_3D
Medium 3D extent for testing. -
MEDIUM_2D
Medium 2D extent for testing. -
LARGE_3D
Large 3D extent for testing. -
LARGE_2D
Large 2D extent for testing.
-
-
Constructor Details
-
ChannelFixture
public ChannelFixture() -
ChannelFixture
public ChannelFixture(boolean includeResolution) Creates a newChannelFixture
instance.- Parameters:
includeResolution
- Whether to include resolution with the channel's dimensions.
-
-
Method Details
-
sumModulo
public static int sumModulo(int x, int y, int z) Calculates intensity as the sum of coordinates modulo 256.- Parameters:
x
- The x-coordinate.y
- The y-coordinate.z
- The z-coordinate.- Returns:
- The calculated intensity.
-
diffModulo
public static int diffModulo(int x, int y, int z) Calculates intensity as the difference of coordinates modulo 256.- Parameters:
x
- The x-coordinate.y
- The y-coordinate.z
- The z-coordinate.- Returns:
- The calculated intensity.
-
multModulo
public static int multModulo(int x, int y, int z) Calculates intensity as the product of coordinates modulo 256.- Parameters:
x
- The x-coordinate.y
- The y-coordinate.z
- The z-coordinate.- Returns:
- The calculated intensity.
-
createChannel
public Channel createChannel(Extent extent, ChannelFixture.IntensityFunction createIntensity, VoxelDataType channelVoxelType) Creates a channel with specified extent, intensity function, and voxel data type.- Parameters:
extent
- The extent of the channel.createIntensity
- The function to create intensity values.channelVoxelType
- The voxel data type of the channel.- Returns:
- The created channel.
-