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 interfaceFunctional interface for creating intensity values for a given location. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExtentLarge 2D extent for testing.static final ExtentLarge 3D extent for testing.static final ExtentMedium 2D extent for testing.static final ExtentMedium 3D extent for testing.static final ExtentSmall 2D extent for testing.static final ExtentSmall 3D extent for testing. -
Constructor Summary
ConstructorsConstructorDescriptionChannelFixture(boolean includeResolution) Creates a newChannelFixtureinstance. -
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 intdiffModulo(int x, int y, int z) Calculates intensity as the difference of coordinates modulo 256.static intmultModulo(int x, int y, int z) Calculates intensity as the product of coordinates modulo 256.static intsumModulo(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 newChannelFixtureinstance.- 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.
-