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
A base class for script actions which perform their action using an input image.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringThe label to use for the input image parameter.protected ModelImageThe image whose processing should be recorded in the script.protected ModelImageThe image generated by processing the input image, if any.Fields inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
isScript -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the dynamic instantiation and execution of the script action.Constructor used to record the Clone script action line.ActionImageProcessorBase(ModelImage input, ModelImage result) Constructor used to record the Clone script action line. -
Method Summary
Modifier and TypeMethodDescriptionprotected ParameterImagecreateInputImageParameter(boolean isScript) 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.abstract voidIf a script is being recorded and the action (read: algorithm) is done, add an entry for this action.protected static final booleanisImageStoredInRecorder(ModelImage image, boolean isScript) Returns whether an image has been registered in the script recorder.abstract voidscriptRun(ParameterTable parameters) Sets up the action dialog state and then executes it.voidsetInputImage(ModelImage inputImage) Changes the image whose processing should be recorded in the script.voidsetResultImage(ModelImage resultImage) Changes the image generated by the action we are recording.protected static final StringstoreImageInRecorder(ModelImage image, boolean isScript) Store an image in the script recorder image variable table.protected static final StringstoreImageInRunner(ModelImage image) Store an image in the script runner image variable table.Methods inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
getActionName, getActionName, isScript, setIsScript
-
Field Details
-
INPUT_IMAGE_LABEL
The label to use for the input image parameter. -
recordingInputImage
The image whose processing should be recorded in the script. The actual processing must be done elsewhere. -
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
Constructor used to record the Clone script action line.- Parameters:
input- The image which was cloned.
-
ActionImageProcessorBase
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:
insertScriptLinein interfaceScriptableActionInterface- Specified by:
insertScriptLinein classActionBase
-
scriptRun
Sets up the action dialog state and then executes it.- Specified by:
scriptRunin interfaceScriptableActionInterface- Specified by:
scriptRunin classActionBase- Parameters:
parameters- Table of parameters for the script to use.
-
setInputImage
Changes the image whose processing should be recorded in the script.- Parameters:
inputImage- The image which was processed.
-
setResultImage
Changes the image generated by the action we are recording.- Parameters:
resultImage- The image which was generated.
-
isImageStoredInRecorder
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:
Trueif the image has been stored in the recorder's image table,falseotherwise.
-
createInputImageParameter
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
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
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.
-