Class EnergyStackWithoutParameters
Object
org.anchoranalysis.feature.energy.EnergyStackWithoutParameters
public class EnergyStackWithoutParameters extends Object
A stack of channels used as context to calculate features (or calculating energy more
broadly).
The stack can have 0 channels, in which case, explicit dimensions must be set.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description EnergyStackWithoutParameters(Channel channel)Create a energy-stack comprised of a single channelEnergyStackWithoutParameters(Dimensions dimensions)Create a energy-stack with no channels - but with associated dimensions.EnergyStackWithoutParameters(Stack stack)Create a energy-stack comprised of all channels from a stack -
Method Summary
Modifier and Type Method Description StackasStack()Derive aStackrepresentation containing the identical channels to the current instance.Dimensionsdimensions()The dimensions of all channels in the stack.org.anchoranalysis.spatial.box.Extentextent()The width and height and depth of allChannels in the stack.EnergyStackWithoutParametersextractSlice(int z)Extract a particular z-slice from theEnergyStackWithoutParametersas a new stack.ChannelgetChannel(int index)Returns the channel at a particular position in the stack.intgetNumberChannels()The number of channels in the stack.
-
Constructor Details
-
EnergyStackWithoutParameters
Create a energy-stack comprised of a single channel- Parameters:
channel-
-
EnergyStackWithoutParameters
Create a energy-stack comprised of all channels from a stack- Parameters:
stack- the stack which is reused as the energy-stack (i.e. it is not duplicated)
-
EnergyStackWithoutParameters
Create a energy-stack with no channels - but with associated dimensions.- Parameters:
dimensions- the dimensions.
-
-
Method Details
-
getNumberChannels
public final int getNumberChannels()The number of channels in the stack.- Returns:
- the number of channels.
-
dimensions
The dimensions of all channels in the stack.- Returns:
- the dimensions.
-
extent
public org.anchoranalysis.spatial.box.Extent extent()The width and height and depth of allChannels in the stack.- Returns:
- the size, in three dimensions.
-
getChannel
Returns the channel at a particular position in the stack.- Parameters:
index- the index (zero-indexed).- Returns:
- the respective channel.
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())
-
asStack
Derive aStackrepresentation containing the identical channels to the current instance. -
extractSlice
Extract a particular z-slice from theEnergyStackWithoutParametersas a new stack.- Parameters:
z- the index in the Z-dimension of the slice to extract.- Returns:
- the extracted slice, as a new
EnergyStackWithoutParametersbut reusing the existing voxels. - Throws:
OperationFailedException- if no channels exist in the energy-stack.
-