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
A script action which writes out an image to disk.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringLabel for the avi compression parameter.static final StringLabel for last slice to save from an image parameter.static final StringLabel for the parameter indicating the last time slice to save.static final StringLabel for the parameter indicating whether .nii or .hdr/.img is used in nifti file writesprotected FileWriteOptionsThe file saving options used to save the image, which should be recording in the script.static final StringLabel for the file name parameter (overrides the file_type parameter).static final StringLabel for the file type (extension, generally) parameter.static final StringLabel for the file name prefix parameter.static final StringLabel for the file name suffix parameter.static final StringLabel for first slice to save from an image parameter.static final StringLabel for the parameter indicating the first time slice to save.static final StringLabel for the parameter indicating the number of digits to use in tiff image file naming.static final StringLabel for the tiff set write pack bit parameter.static final StringLabel for the tiff initial image number parameter.static final StringLabel 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, recordingResultImageFields inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
isScript -
Constructor Summary
ConstructorsConstructorDescriptionConstructor 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
Modifier and TypeMethodDescriptionprotected voidaddSaveOptionsToParameters(ParameterTable parameters, FileWriteOptions options, int[] extents) Add the save options needed to record the saving of an image to a parameter table.protected static final FileWriteOptionsgetSaveImageOptions(ParameterTable parameters, ModelImage image, boolean isSaveAsAction) Create a new set of image saving options from a save action's parameters.voidsetSaveOptions(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, storeImageInRunnerMethods inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
getActionName, getActionName, isScript, setIsScript
-
Field Details
-
SAVE_PREFIX
Label for the file name prefix parameter.- See Also:
-
SAVE_SUFFIX
Label for the file name suffix parameter.- See Also:
-
SAVE_FILE_NAME
Label for the file name parameter (overrides the file_type parameter).- See Also:
-
SAVE_FILE_TYPE
Label for the file type (extension, generally) parameter.- See Also:
-
START_SLICE
Label for first slice to save from an image parameter.- See Also:
-
END_SLICE
Label for last slice to save from an image parameter.- See Also:
-
TIFF_SET_WRITE_PACK_BIT
Label for the tiff set write pack bit parameter.- See Also:
-
TIFF_START_NUMBER
Label for the tiff initial image number parameter.- See Also:
-
TIFF_DIGIT_NUMBER
Label for the parameter indicating the number of digits to use in tiff image file naming.- See Also:
-
START_TIME
Label for the parameter indicating the first time slice to save.- See Also:
-
END_TIME
Label for the parameter indicating the last time slice to save.- See Also:
-
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:
-
AVI_COMPRESSION
Label for the avi compression parameter.- See Also:
-
NIFTI_EXTENSION
Label for the parameter indicating whether .nii or .hdr/.img is used in nifti file writes- See Also:
-
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 Details
-
ActionSaveBase
public ActionSaveBase()Constructor for the dynamic instantiation and execution of the script action. -
ActionSaveBase
Constructor used to record the script action line.- Parameters:
input- The image which was saved.options- The options used during the image save.
-
-
Method Details
-
setSaveOptions
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.
-