Class DataProvenanceParameters

java.lang.Object
gov.nih.mipav.view.dialogs.AlgorithmParameters
gov.nih.mipav.view.dialogs.DataProvenanceParameters

public class DataProvenanceParameters extends AlgorithmParameters

This class standardizes the parameter names given to many common parameters used in algorithms. It also provides helper methods to store/retrieve those common parameters.

See Also:
  • Constructor Details

    • DataProvenanceParameters

      public DataProvenanceParameters()
      Creates a new DataProvenanceParameters object to be used to record the current parameters entered into the algorithm's GUI by the user.
  • Method Details

    • storeImageInRecorder

      public String storeImageInRecorder(ModelImage image)
      Store an image in the script recorder image variable table. Used to store input/output images while recording a script. Should not be used while running a script.
      Overrides:
      storeImageInRecorder in class AlgorithmParameters
      Parameters:
      image - The image to store in the variable table.
      Returns:
      The image placeholder variable assigned to the image by the variable table.
    • storeImage

      public String storeImage(ModelImage image, String paramLabel) throws ParserException
      Stores an input image in the list of parameters for the algorithm.
      Overrides:
      storeImage in class AlgorithmParameters
      Parameters:
      image - The image to store.
      paramLabel - The label to give to the new image parameter.
      Returns:
      The image placeholder variable assigned to the image by the variable table.
      Throws:
      ParserException - If there is a problem creating one of the new parameters.
    • storeInputImage

      public String storeInputImage(ModelImage inputImage) throws ParserException
      Stores an input image in the list of parameters for the algorithm. This image is stored with a new parameter label incremented with each new call to this method.
      Overrides:
      storeInputImage in class AlgorithmParameters
      Parameters:
      inputImage - The input image to store.
      Returns:
      The image placeholder variable assigned to the image by the variable table.
      Throws:
      ParserException - If there is a problem creating one of the new parameters.
    • storeNumIterations

      public void storeNumIterations(int numIters) throws ParserException
      DOCUMENT ME!
      Overrides:
      storeNumIterations in class AlgorithmParameters
      Parameters:
      numIters - DOCUMENT ME!
      Throws:
      ParserException - DOCUMENT ME!
    • storeOutputImageParams

      public String storeOutputImageParams(ModelImage outputImage, boolean isNewImage) throws ParserException
      Stores information about the output of images for this algorithm in the parameter table. It first stores whether a new output image should be generated by the algorithm, and then (if a new image should be generated) stores the new output image in the variable table.
      Overrides:
      storeOutputImageParams in class AlgorithmParameters
      Parameters:
      outputImage - The result image generated by the algorithm (may be null if isNewImage is false.
      isNewImage - Whether the algorithm should output a new image when it is executed.
      Returns:
      The new image placeholder variable assigned to the result image (or null if no output image should be generated).
      Throws:
      ParserException - If there is a problem creating one of the new parameters.
    • isImageStoredInRecorder

      protected static final boolean isImageStoredInRecorder(ModelImage image)
      Returns whether an image has been registered in the script recorder. If it has not been used, it must be specified externally when this script is run later.
      Parameters:
      image - The image to look for in the recorder's image table.
      Returns:
      True if the image has been stored in the recorder's image table, false otherwise.