Class EnergyStack

Object
EnergyStack

public class EnergyStack extends Object
A EnergyStackWithoutParameters with associated parameters in a Dictionary.
Author:
Owen Feehan
  • Constructor Details

    • EnergyStack

      public EnergyStack(Channel channel)
      Create from a single Channel.
      Parameters:
      channel - the channel.
    • EnergyStack

      public EnergyStack(EnergyStackWithoutParameters energyStack)
      Create from a EnergyStackWithoutParameters without any additional parameters.
      Parameters:
      energyStack - the energy-stack.
    • EnergyStack

      public EnergyStack(Stack stack, Dictionary dictionary)
      Create from a Stack with associated parameters in a Dictionary.
      Parameters:
      stack - the stack.
      dictionary - the associated parameters.
    • EnergyStack

      public EnergyStack(Stack stack)
      Create from a EnergyStack without any additional parameters.
      Parameters:
      stack - the stack.
    • EnergyStack

      public EnergyStack(Dimensions dimensions)
      Create a new stack of Dimensions with zero-voxel values, without any additional parameters.
      Parameters:
      dimensions - the dimensions.
    • EnergyStack

      public EnergyStack(EnergyStackWithoutParameters delegate, Dictionary parameters)
      Creates a new EnergyStack instance.
      Parameters:
      delegate -
      parameters - The associated parameters.
  • Method Details

    • extractSlice

      public EnergyStack extractSlice(int z) throws OperationFailedException
      Extract a particular z-slice from the EnergyStack as a new stack.
      Parameters:
      z - the index in the Z-dimension of the slice to extract.
      Returns:
      the extracted slice, as a new EnergyStack but reusing the existing voxels.
      Throws:
      OperationFailedException - if no channels exist in the energy-stack.
    • hasOneSlice

      public boolean hasOneSlice()
      Does exactly one z-slice exist in the energy stack?
      Returns:
      true iff the number of z-slices is 1.
    • dimensions

      public Dimensions dimensions()
      The image-dimensions associated with the energy-stack.
      Returns:
      the image-dimensions.
    • resolution

      public Optional<Resolution> resolution()
      The image-resolution associated with the energy-stack.
      Returns:
      the image-resolution.
    • copyChangeDictionary

      public EnergyStack copyChangeDictionary(Dictionary dictionaryToAssign)
      Makes a copy of the EnergyStack but assigns a new Dictionary.
      Parameters:
      dictionaryToAssign - the dictionary.
      Returns:
      a copy of the existing instance, that is otherwise identical, but contains dictionaryToAssign.
    • getChannel

      public Channel getChannel(int index)
      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

      public Stack asStack()
      Derive a Stack representation containing the identical channels to the current instance.
      Returns:
      a newly created Stack, but reusing the current Channels.
    • extent

      public Extent extent()
      The width and height and depth of all Channels in the stack.
      Returns:
      the size, in three dimensions.
    • withoutParameters

      public EnergyStackWithoutParameters withoutParameters()
      The energy-stack without associated parameters.
      Returns:
      a representation of the energy-stack without parameters (not newly created).
    • getNumberChannels

      public final int getNumberChannels()
      The number of channels in the stack.
      Returns:
      the number of channels.
    • getParameters

      public Dictionary getParameters()
      The associated parameters.
    • setParameters

      public void setParameters(Dictionary parameters)
      The associated parameters.