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 Summary
Fields Modifier and Type Field Description protected static java.lang.String
INPUT_IMAGE_LABEL
The label to use for the input image parameter.protected ModelImage
recordingInputImage
The image whose processing should be recorded in the script.protected ModelImage
recordingResultImage
The image generated by processing the input image, if any.-
Fields inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
isScript
-
-
Constructor Summary
Constructors Constructor Description ActionImageProcessorBase()
Constructor for the dynamic instantiation and execution of the script action.ActionImageProcessorBase(ModelImage input)
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
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ParameterImage
createInputImageParameter(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 void
insertScriptLine()
If a script is being recorded and the action (read: algorithm) is done, add an entry for this action.protected static boolean
isImageStoredInRecorder(ModelImage image, boolean isScript)
Returns whether an image has been registered in the script recorder.abstract void
scriptRun(ParameterTable parameters)
Sets up the action dialog state and then executes it.void
setInputImage(ModelImage inputImage)
Changes the image whose processing should be recorded in the script.void
setResultImage(ModelImage resultImage)
Changes the image generated by the action we are recording.protected static java.lang.String
storeImageInRecorder(ModelImage image, boolean isScript)
Store an image in the script recorder image variable table.protected static java.lang.String
storeImageInRunner(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 Detail
-
INPUT_IMAGE_LABEL
protected static final java.lang.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 Detail
-
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 Detail
-
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 interfaceScriptableActionInterface
- Specified by:
insertScriptLine
in classActionBase
-
scriptRun
public abstract void scriptRun(ParameterTable parameters)
Sets up the action dialog state and then executes it.- Specified by:
scriptRun
in interfaceScriptableActionInterface
- Specified by:
scriptRun
in classActionBase
- 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 java.lang.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 java.lang.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.
-
-