Class ActionImageProcessorBase

java.lang.Object
gov.nih.mipav.model.scripting.actions.ActionBase
gov.nih.mipav.model.scripting.actions.ActionImageProcessorBase
All Implemented Interfaces:
ScriptableActionInterface
Direct Known Subclasses:
ActionChangeEndianess, ActionChangeModality, ActionChangeName, ActionChangeOrientations, ActionChangeOrigin, ActionChangeResolutions, ActionChangeTalairachInfo, ActionChangeTransformInfo, ActionChangeUnits, ActionClone, ActionCloseFrame, ActionCreateBlankImage, ActionExtractImageB, ActionMaskToPaint, ActionMaskToVOI, ActionOpenAllVOIs, ActionOpenImage, ActionOpenVOI, ActionPaintToMask, ActionPaintToVOI, ActionSaveAllVOIs, ActionSaveBase, ActionSaveVOIIntensities, ActionSelectAllVOIs, ActionStartMipav, ActionVOIToMask

public abstract class ActionImageProcessorBase extends ActionBase
A base class for script actions which perform their action using an input image.
  • Field Details

    • INPUT_IMAGE_LABEL

      protected static final String INPUT_IMAGE_LABEL
      The label to use for the input image parameter.
    • recordingInputImage

      protected ModelImage recordingInputImage
      The image whose processing should be recorded in the script. The actual processing must be done elsewhere.
    • recordingResultImage

      protected ModelImage recordingResultImage
      The image generated by processing the input image, if any.
  • Constructor Details

    • ActionImageProcessorBase

      public ActionImageProcessorBase()
      Constructor for the dynamic instantiation and execution of the script action.
    • ActionImageProcessorBase

      public ActionImageProcessorBase(ModelImage input)
      Constructor used to record the Clone script action line.
      Parameters:
      input - The image which was cloned.
    • ActionImageProcessorBase

      public ActionImageProcessorBase(ModelImage input, ModelImage result)
      Constructor used to record the Clone script action line.
      Parameters:
      input - The image which was cloned.
      result - The result image generated.
  • Method Details

    • insertScriptLine

      public abstract void insertScriptLine()
      If a script is being recorded and the action (read: algorithm) is done, add an entry for this action.
      Specified by:
      insertScriptLine in interface ScriptableActionInterface
      Specified by:
      insertScriptLine in class ActionBase
    • scriptRun

      public abstract void scriptRun(ParameterTable parameters)
      Sets up the action dialog state and then executes it.
      Specified by:
      scriptRun in interface ScriptableActionInterface
      Specified by:
      scriptRun in class ActionBase
      Parameters:
      parameters - Table of parameters for the script to use.
    • setInputImage

      public void setInputImage(ModelImage inputImage)
      Changes the image whose processing should be recorded in the script.
      Parameters:
      inputImage - The image which was processed.
    • setResultImage

      public void setResultImage(ModelImage resultImage)
      Changes the image generated by the action we are recording.
      Parameters:
      resultImage - The image which was generated.
    • isImageStoredInRecorder

      protected static final boolean isImageStoredInRecorder(ModelImage image, boolean isScript)
      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.
      isScript - boolean telling whether this operation involves the script recorder (or provenance recorder)
      Returns:
      True if the image has been stored in the recorder's image table, false otherwise.
    • createInputImageParameter

      protected ParameterImage createInputImageParameter(boolean isScript) throws ParserException
      Creates a new image parameter for the action's input image, determining whether it needs to be externally-specified or will be generated from another script action.
      Parameters:
      isScript - boolean telling whether this operation involves the script recorder (or provenance recorder)
      Returns:
      A new image parameter pointing to this action's input image.
      Throws:
      ParserException - If there is a problem encountered while creating the new parameter.
    • storeImageInRecorder

      protected static final String storeImageInRecorder(ModelImage image, boolean isScript)
      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.
      Parameters:
      image - The image to store in the variable table.
      isScript - boolean telling whether this operation involves the script recorder (or provenance recorder)
      Returns:
      The image placeholder variable assigned to the image by the variable table.
    • storeImageInRunner

      protected static final String storeImageInRunner(ModelImage image)
      Store an image in the script runner image variable table. Used to store input/output images while running a script. Should not be used while recording a script.
      Parameters:
      image - The image to store in the variable table.
      Returns:
      The image placeholder variable assigned to the image by the variable table.