public class StackWriteAttributes extends Object
This class is immutable.
Constructor and Description |
---|
StackWriteAttributes(boolean always2D,
boolean singleChannel,
boolean threeChannels,
StackRGBState rgb,
boolean binary)
Alternative constructor that assumes each channel is 8-bits.
|
Modifier and Type | Method and Description |
---|---|
StackWriteAttributes |
allChannelsEightBit()
Mark the attributes to indicate that channels are no longer guaranteed to be 8-bit.
|
StackWriteAttributes |
always2D(boolean binary)
Derives a
StackWriteAttributes that will always be 2D, but is otherwise unchanged. |
StackWriteAttributes |
and(StackWriteAttributes other)
Combines with another
StackWriteAttributes by performing a logical and on each
field. |
StackRGBState |
getRgb()
Whether it's an RGB or RGBA image when it has three/four channels respectively.
|
boolean |
isAlways2D()
Whether the output is guaranteed to only ever 2D i.e.
|
boolean |
isBinary()
Whether all channels represent a binary image.
|
boolean |
isEightBitChannels()
Whether each channel is 8 bits.
|
boolean |
isSingleChannel()
The number of channels is guaranteed to be 1 in the output.
|
boolean |
isThreeChannels()
The number of channels is guaranteed to be 3 in the output.
|
StackWriteAttributes |
or(StackWriteAttributes other)
Combines with another
StackWriteAttributes by performing a logical or on each
field. |
StackWriteAttributes |
rgb(boolean plusAlpha)
Derives a
StackWriteAttributes that will be RGB or RGB-A, but is otherwise unchanged. |
String |
toString()
A user-friendly description of the stack-type to include in error and warning messages.
|
boolean |
writeAsRGB(Stack stack)
Whether to write a stack in RGB mode?
|
public StackWriteAttributes(boolean always2D, boolean singleChannel, boolean threeChannels, StackRGBState rgb, boolean binary)
always2D
- whether the output is guaranteed to only ever 2D i.e. maximally one z-slice?singleChannel
- the number of channels is guaranteed to be 1 in the output.threeChannels
- the number of channels is guaranteed to be 3 in the output.rgb
- whether it's an RGB or RGBA image when it has three/four channels respectively.binary
- whether all channels represent a binary image.public StackWriteAttributes always2D(boolean binary)
StackWriteAttributes
that will always be 2D, but is otherwise unchanged.binary
- whether all channels are binary (only two allowed states: the max intensity
value and the minimum intensity value.)StackWriteAttributes
derived from the existing object.public StackWriteAttributes rgb(boolean plusAlpha)
StackWriteAttributes
that will be RGB or RGB-A, but is otherwise unchanged.plusAlpha
- when true, RGBA is used. when false, RGB.StackWriteAttributes
derived from the existing object.public StackWriteAttributes and(StackWriteAttributes other)
StackWriteAttributes
by performing a logical and on each
field.other
- the other StackWriteAttributes
to combine with.StackWriteAttributes
where each field is the logical
and of the two inputspublic StackWriteAttributes or(StackWriteAttributes other)
StackWriteAttributes
by performing a logical or on each
field.other
- the other StackWriteAttributes
to combine with.StackWriteAttributes
where each field is the logical
or of the two inputspublic boolean writeAsRGB(Stack stack)
stack
- the stack to query whether it should be written in RGB mode.public StackWriteAttributes allChannelsEightBit()
StackWriteAttributes
that has eightBit=false
but is
otherwise duplicated.public String toString()
public boolean isAlways2D()
public boolean isSingleChannel()
public boolean isThreeChannels()
public StackRGBState getRgb()
This flag should only be set when alwaysOneOrThreChannels
is true.
This flag is ignored, when the number of channels is not three.
public boolean isBinary()
This implies each channel has only two allowed states: the max intensity value and the minimum intensity value.
public boolean isEightBitChannels()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.