Class AbstractDynamicFrame

All Implemented Interfaces:
MessageShower, PreferencesSettable, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public abstract class AbstractDynamicFrame extends MultiContrastAnalysisFrame
AbstractDynamicFrame - a GUI for performing general image dynamic analysis.
See Also:
  • Field Details

    • TIME_BETWEEN_IMAGES_PREFERENCE_NAME

      public static final String TIME_BETWEEN_IMAGES_PREFERENCE_NAME
      The Preference name for the time between images.
      See Also:
    • THRESHOLD_PREFERENCE_NAME

      public static final String THRESHOLD_PREFERENCE_NAME
      The Preference name for the intensity threshold.
      See Also:
    • REGISTRATION_PREFERENCE_NAME

      public static final String REGISTRATION_PREFERENCE_NAME
      The Preference name for whether to perform registration.
      See Also:
    • APPLY_SPATIAL_FILTER_PREFERENCE_NAME

      public static final String APPLY_SPATIAL_FILTER_PREFERENCE_NAME
      The Preference name for whether to apply a spatial smoothing filter.
      See Also:
    • SPATIAL_FILTER_FWHM_PREFERENCE_NAME

      public static final String SPATIAL_FILTER_FWHM_PREFERENCE_NAME
      The Preference name for smoothing filter FWHM in mm.
      See Also:
    • N_STEADY_STATES_PREFERENCE_NAME

      public static final String N_STEADY_STATES_PREFERENCE_NAME
      The Preference name for the number of steady-state images.
      See Also:
    • DEFAULT_N_STEADY_STATES

      public static final int DEFAULT_N_STEADY_STATES
      The default number of steady state images, if not set in user preferences.
      See Also:
    • MAX_N_TIMES

      protected static final int MAX_N_TIMES
      The maximum number of time points that can be selected in various spinners.
      See Also:
    • timeBetweenImagesField

      protected JTextField timeBetweenImagesField
      The JTextField to set the time between images in seconds.
    • registerCheckBox

      protected final JCheckBox registerCheckBox
      A check box to turn on registration.
    • smoothingFilterCheckBox

      protected final JCheckBox smoothingFilterCheckBox
      A check box to turn on spatial filtering.
    • fwhmTextField

      protected final com.xinapse.util.XinapseFormattedTextField fwhmTextField
      A JFormattedTextField to set the FWHM of the smoothing filter.
    • maskSelectorPanel

      protected final com.xinapse.dynamic.DynamicMaskSelectorWorker.Panel maskSelectorPanel
      A JPanel for selecting an image mask.
    • dynamicModelPanel

      protected final JPanel dynamicModelPanel
      The JPanel that contains the analysis setup. Components for the analysis model should be added to this JPanel.
    • outputImageSelectionPanel

      public final OutputImageSelectionPanel outputImageSelectionPanel
      ImageSelectionPanel used to select the output images basename.
  • Constructor Details

    • AbstractDynamicFrame

      protected AbstractDynamicFrame(String frameTitle, List<Image> iconImages, String preferencesNodeName)
      Creates a new DynamicFrame for a stand-alone image dynamic analysis application.
      Parameters:
      frameTitle - the title for the frame.
      iconImages - List of icon images to set for the frame.
      preferencesNodeName - the Preferences node name from which the initial settings will be loaded.
    • AbstractDynamicFrame

      protected AbstractDynamicFrame(com.xinapse.displayer.ImageDisplayer parent, String frameTitle, List<Image> iconImages, String preferencesNodeName)
      Creates new DynamicFrame for use with Jim.
      Parameters:
      parent - the ImageDisplayer that this frame is connected to.
      frameTitle - the title for the frame.
      iconImages - List of icon images to set for the frame.
      preferencesNodeName - the Preferences node name from which the initial settings will be loaded.
  • Method Details

    • showStatus

      public void showStatus(String s)
      Shows a status message in the GUI.
      Specified by:
      showStatus in interface MessageShower
      Specified by:
      showStatus in class com.xinapse.util.ImageOrganiserFrame
      Parameters:
      s - the status message to show.
    • getUseBrainFinder

      public boolean getUseBrainFinder()
      Returns whether the Brain Finder option has been set in the GUI.
      Returns:
      true of the Brain Finder option has been set; false otherwise.
    • getBT

      public Float getBT() throws InvalidArgumentException
      Returns the threshold fraction to use with the Brain Finder, if this option has been set in the GUI.
      Returns:
      the threshold fraction to use with the Brain Finder, or null.
      Throws:
      InvalidArgumentException - if the bT value is outside the range (0..1) exclusive.
    • getBinaryMask

      public com.xinapse.apps.mask.BinaryMask getBinaryMask() throws InvalidArgumentException
      Returns the mask image if masking by an image has been selected.
      Returns:
      the mask image if masking by an image has been selected, or null if masking by an image has not been selected.
      Throws:
      InvalidArgumentException - if masking by an image has been selected, but the mask image has not been set or cannot be opened.
    • getMaskROIs

      public List<ROI> getMaskROIs() throws InvalidArgumentException
      Returns the mask ROIs if masking by a ROIs has been selected.
      Returns:
      the mask ROIs if masking by a ROIs has been selected, or null if masking by a ROIs has not been selected.
      Throws:
      InvalidArgumentException - if masking by ROIs has been selected, but the mask ROI File has not been set or cannot be opened.
    • getMaskROIFile

      public File getMaskROIFile() throws InvalidArgumentException
      Returns the mask ROI file if masking by a ROIs has been selected.
      Returns:
      the ROI File if masking by a ROIs has been selected, or null if masking by a ROIs has not been selected.
      Throws:
      InvalidArgumentException - if masking by ROIs has been selected, but the mask ROIs File has not been set or cannot be opened.
    • getThreshold

      public Double getThreshold() throws InvalidArgumentException
      Returns the intensity threshold for pixel processing.
      Returns:
      the intensity threshold or null if no threshold has been set.
      Throws:
      InvalidArgumentException - if the threshold value cannot be interpreset from what has been set in the GUI.
    • setThreshold

      public void setThreshold(Double thr)
      Sets the intensity threshold for pixel processing.
      Parameters:
      thr - the intensity threshold or null if no threshold is to be set.
    • getXStart

      public float getXStart()
      For the purposes of plotting data, returns the starting value of the independent variable.
      Specified by:
      getXStart in class MultiContrastAnalysisFrame
      Returns:
      1 which is the scan number of the first image.
    • getDeltaX

      public float getDeltaX() throws NumberFormatException
      For the purposes of plotting data, returns the step between values of the independent variable.
      Specified by:
      getDeltaX in class MultiContrastAnalysisFrame
      Returns:
      1 which is the step between scans.
      Throws:
      NumberFormatException - if the step between values cannot be determined.
    • getXAxisLabel

      public String getXAxisLabel()
      For the purposes of plotting data, returns the x-axis label.
      Specified by:
      getXAxisLabel in class MultiContrastAnalysisFrame
      Returns:
      "scan number".
    • getTimeBetweenImages

      public float getTimeBetweenImages() throws NumberFormatException
      Returns the time between images set in the GUI.
      Returns:
      the time (in seconds) between images.
      Throws:
      NumberFormatException - if the time between images has not been set by the user, or if the time between images cannot be interpreted, or is not positive.
    • setTimeBetweenImages

      public void setTimeBetweenImages(Float timeBetweenImages)
      Sets the time between images in the GUI.
      Parameters:
      timeBetweenImages - the time between images. If null, this method has not effect.
    • getSmoothingFWHMmm

      public float getSmoothingFWHMmm() throws InvalidArgumentException
      Returns the full-width-at-half-maximum for the smoothing filter.
      Returns:
      the full-width-at-half-maximum for the smoothing filter.
      Throws:
      InvalidArgumentException - if the FWHM has not been set by the user, or the FWHM cannot be interpreted, or is not positive.
    • getOutputImagesBaseName

      public String getOutputImagesBaseName() throws InvalidArgumentException
      Returns the basename for the output images.
      Returns:
      the basename for the output images.
      Throws:
      InvalidArgumentException - if the basename has not been set by the user.
    • getNSteadyStates

      public int getNSteadyStates()
      Returns the number of pre-steady-state images set in the GUI.
      Returns:
      the number of pre-steady-state images set in the GUI.
    • setDefaults

      public void setDefaults()
      Description copied from class: MultiContrastAnalysisFrame
      Put the default settings to this MultiContrastAnalysisFrame.
      Specified by:
      setDefaults in interface PreferencesSettable
      Overrides:
      setDefaults in class MultiContrastAnalysisFrame
    • savePreferences

      public void savePreferences(Preferences prefs) throws InvalidArgumentException
      Description copied from class: MultiContrastAnalysisFrame
      Save the current setting to the user preferences.
      Specified by:
      savePreferences in interface PreferencesSettable
      Overrides:
      savePreferences in class MultiContrastAnalysisFrame
      Parameters:
      prefs - the Preferences node to which to save the settings.
      Throws:
      InvalidArgumentException - if the current settings are not valid.
    • busyCursors

      public void busyCursors()
      Description copied from class: com.xinapse.util.ImageOrganiserFrame
      Call this method to indicate that the ImageOrganiserFrame is busy processing.
      Specified by:
      busyCursors in interface MessageShower
      Overrides:
      busyCursors in class MultiContrastAnalysisFrame
    • readyCursors

      public void readyCursors()
      Description copied from class: com.xinapse.util.ImageOrganiserFrame
      Call this method to indicate that the ImageOrganiserFrame is ready to do further processing.
      Specified by:
      readyCursors in interface MessageShower
      Overrides:
      readyCursors in class MultiContrastAnalysisFrame
    • setVisible

      public void setVisible(boolean b)
      Description copied from class: com.xinapse.util.ImageOrganiserFrame
      Shows or hides this ImageOrganiserFrame depending on the value of parameter b. If b is false, then the user will be asked if any Threads the were generated by this ImageOrganiserFrame should be stopped. If the user indicates to stop the Threads, then the threads are stopped at the next available opportunity. If, after these checks, no Threads are running, then the quitMe flag is set, and this ImageOrganiserFrame is hidden.
      Overrides:
      setVisible in class MultiContrastAnalysisFrame
      Parameters:
      b - if true, shows this ImageOrganiserFrame; otherwise, hides this ImageOrganiserFrame.