Class ActionSaveBase
- java.lang.Object
-
- gov.nih.mipav.model.scripting.actions.ActionBase
-
- gov.nih.mipav.model.scripting.actions.ActionImageProcessorBase
-
- gov.nih.mipav.model.scripting.actions.ActionSaveBase
-
- All Implemented Interfaces:
ScriptableActionInterface
- Direct Known Subclasses:
ActionSaveImage
,ActionSaveImageAs
public abstract class ActionSaveBase extends ActionImageProcessorBase
A script action which writes out an image to disk.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AVI_COMPRESSION
Label for the avi compression parameter.static java.lang.String
END_SLICE
Label for last slice to save from an image parameter.static java.lang.String
END_TIME
Label for the parameter indicating the last time slice to save.static java.lang.String
NIFTI_EXTENSION
Label for the parameter indicating whether .nii or .hdr/.img is used in nifti file writesprotected FileWriteOptions
recordingOptions
The file saving options used to save the image, which should be recording in the script.static java.lang.String
SAVE_FILE_NAME
Label for the file name parameter (overrides the file_type parameter).static java.lang.String
SAVE_FILE_TYPE
Label for the file type (extension, generally) parameter.static java.lang.String
SAVE_PREFIX
Label for the file name prefix parameter.static java.lang.String
SAVE_SUFFIX
Label for the file name suffix parameter.static java.lang.String
START_SLICE
Label for first slice to save from an image parameter.static java.lang.String
START_TIME
Label for the parameter indicating the first time slice to save.static java.lang.String
TIFF_DIGIT_NUMBER
Label for the parameter indicating the number of digits to use in tiff image file naming.static java.lang.String
TIFF_SET_WRITE_PACK_BIT
Label for the tiff set write pack bit parameter.static java.lang.String
TIFF_START_NUMBER
Label for the tiff initial image number parameter.static java.lang.String
TIME_SLICE
Label for the parameter indicating which time slice to save when saving 4D images in a format which only supports 3D image writing.-
Fields inherited from class gov.nih.mipav.model.scripting.actions.ActionImageProcessorBase
INPUT_IMAGE_LABEL, recordingInputImage, recordingResultImage
-
Fields inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
isScript
-
-
Constructor Summary
Constructors Constructor Description ActionSaveBase()
Constructor for the dynamic instantiation and execution of the script action.ActionSaveBase(ModelImage input, FileWriteOptions options)
Constructor used to record the script action line.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addSaveOptionsToParameters(ParameterTable parameters, FileWriteOptions options, int[] extents)
Add the save options needed to record the saving of an image to a parameter table.protected static FileWriteOptions
getSaveImageOptions(ParameterTable parameters, ModelImage image, boolean isSaveAsAction)
Create a new set of image saving options from a save action's parameters.void
setSaveOptions(FileWriteOptions options)
Changes the set of options used to save the image.-
Methods inherited from class gov.nih.mipav.model.scripting.actions.ActionImageProcessorBase
createInputImageParameter, insertScriptLine, isImageStoredInRecorder, scriptRun, setInputImage, setResultImage, storeImageInRecorder, storeImageInRunner
-
Methods inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
getActionName, getActionName, isScript, setIsScript
-
-
-
-
Field Detail
-
SAVE_PREFIX
public static final java.lang.String SAVE_PREFIX
Label for the file name prefix parameter.- See Also:
- Constant Field Values
-
SAVE_SUFFIX
public static final java.lang.String SAVE_SUFFIX
Label for the file name suffix parameter.- See Also:
- Constant Field Values
-
SAVE_FILE_NAME
public static final java.lang.String SAVE_FILE_NAME
Label for the file name parameter (overrides the file_type parameter).- See Also:
- Constant Field Values
-
SAVE_FILE_TYPE
public static final java.lang.String SAVE_FILE_TYPE
Label for the file type (extension, generally) parameter.- See Also:
- Constant Field Values
-
START_SLICE
public static final java.lang.String START_SLICE
Label for first slice to save from an image parameter.- See Also:
- Constant Field Values
-
END_SLICE
public static final java.lang.String END_SLICE
Label for last slice to save from an image parameter.- See Also:
- Constant Field Values
-
TIFF_SET_WRITE_PACK_BIT
public static final java.lang.String TIFF_SET_WRITE_PACK_BIT
Label for the tiff set write pack bit parameter.- See Also:
- Constant Field Values
-
TIFF_START_NUMBER
public static final java.lang.String TIFF_START_NUMBER
Label for the tiff initial image number parameter.- See Also:
- Constant Field Values
-
TIFF_DIGIT_NUMBER
public static final java.lang.String TIFF_DIGIT_NUMBER
Label for the parameter indicating the number of digits to use in tiff image file naming.- See Also:
- Constant Field Values
-
START_TIME
public static final java.lang.String START_TIME
Label for the parameter indicating the first time slice to save.- See Also:
- Constant Field Values
-
END_TIME
public static final java.lang.String END_TIME
Label for the parameter indicating the last time slice to save.- See Also:
- Constant Field Values
-
TIME_SLICE
public static final java.lang.String TIME_SLICE
Label for the parameter indicating which time slice to save when saving 4D images in a format which only supports 3D image writing.- See Also:
- Constant Field Values
-
AVI_COMPRESSION
public static final java.lang.String AVI_COMPRESSION
Label for the avi compression parameter.- See Also:
- Constant Field Values
-
NIFTI_EXTENSION
public static final java.lang.String NIFTI_EXTENSION
Label for the parameter indicating whether .nii or .hdr/.img is used in nifti file writes- See Also:
- Constant Field Values
-
recordingOptions
protected FileWriteOptions recordingOptions
The file saving options used to save the image, which should be recording in the script. The action saving must be done elsewhere.
-
-
Constructor Detail
-
ActionSaveBase
public ActionSaveBase()
Constructor for the dynamic instantiation and execution of the script action.
-
ActionSaveBase
public ActionSaveBase(ModelImage input, FileWriteOptions options)
Constructor used to record the script action line.- Parameters:
input
- The image which was saved.options
- The options used during the image save.
-
-
Method Detail
-
setSaveOptions
public void setSaveOptions(FileWriteOptions options)
Changes the set of options used to save the image.- Parameters:
options
- The options used to save the image.
-
getSaveImageOptions
protected static final FileWriteOptions getSaveImageOptions(ParameterTable parameters, ModelImage image, boolean isSaveAsAction)
Create a new set of image saving options from a save action's parameters.- Parameters:
parameters
- The save script action parameters.image
- The image to create the save options for.isSaveAsAction
- Whether this save action is a SaveAs or just a Save.- Returns:
- The options which should be used to save the given image.
-
addSaveOptionsToParameters
protected void addSaveOptionsToParameters(ParameterTable parameters, FileWriteOptions options, int[] extents) throws ParserException
Add the save options needed to record the saving of an image to a parameter table.- Parameters:
parameters
- The parameter table to add the save parameters to.options
- The save options used in the image save.extents
- The extents of the image which was saved.- Throws:
ParserException
- If there is a problem creating the parameters.
-
-