Class 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 Details

    • SAVE_PREFIX

      public static final String SAVE_PREFIX
      Label for the file name prefix parameter.
      See Also:
    • SAVE_SUFFIX

      public static final String SAVE_SUFFIX
      Label for the file name suffix parameter.
      See Also:
    • SAVE_FILE_NAME

      public static final String SAVE_FILE_NAME
      Label for the file name parameter (overrides the file_type parameter).
      See Also:
    • SAVE_FILE_TYPE

      public static final String SAVE_FILE_TYPE
      Label for the file type (extension, generally) parameter.
      See Also:
    • START_SLICE

      public static final String START_SLICE
      Label for first slice to save from an image parameter.
      See Also:
    • END_SLICE

      public static final String END_SLICE
      Label for last slice to save from an image parameter.
      See Also:
    • TIFF_SET_WRITE_PACK_BIT

      public static final String TIFF_SET_WRITE_PACK_BIT
      Label for the tiff set write pack bit parameter.
      See Also:
    • TIFF_START_NUMBER

      public static final String TIFF_START_NUMBER
      Label for the tiff initial image number parameter.
      See Also:
    • TIFF_DIGIT_NUMBER

      public static final String TIFF_DIGIT_NUMBER
      Label for the parameter indicating the number of digits to use in tiff image file naming.
      See Also:
    • START_TIME

      public static final String START_TIME
      Label for the parameter indicating the first time slice to save.
      See Also:
    • END_TIME

      public static final String END_TIME
      Label for the parameter indicating the last time slice to save.
      See Also:
    • TIME_SLICE

      public static final 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:
    • AVI_COMPRESSION

      public static final String AVI_COMPRESSION
      Label for the avi compression parameter.
      See Also:
    • NIFTI_EXTENSION

      public static final String NIFTI_EXTENSION
      Label for the parameter indicating whether .nii or .hdr/.img is used in nifti file writes
      See Also:
    • 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 Details

    • 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 Details

    • 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.