Class ViewJFrameBase

    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.swing.JButton absoluteGoToButton  
      protected javax.swing.JPanel absoluteGoToPanel  
      protected javax.swing.JLabel absoluteLabel
      Labels for the current absolute position:.
      protected javax.swing.JLabel[] absoluteLabelVals
      Labels for the current absolute position values:.
      protected javax.swing.JPanel absolutePanel
      JPanel containing the absoulte position labels:.
      protected javax.swing.JLabel absoluteXLabel
      voxel absolute goto components*
      protected javax.swing.JTextField absoluteXTextField  
      protected javax.swing.JLabel absoluteYLabel
      voxel absolute goto components*
      protected javax.swing.JTextField absoluteYTextField  
      protected javax.swing.JLabel absoluteZLabel
      voxel absolute goto components*
      protected javax.swing.JTextField absoluteZTextField  
      protected float alphaBlend
      Indicates the amount of blending when two images are loaded in the image frame.
      private int blue
      Blue channel value of the paint color.
      protected ModelLUT defaultLUTa
      Reference to LUT for image A and to the default LUT for image A.
      protected ModelLUT defaultLUTb
      Reference to LUT for image B and to the default LUT for image B.
      protected int displayMode
      Indicates which image is to be acted upon when two images are displayed.
      private boolean enableCloseImageB
      Tells whether the ViewMenuBuilder should allow Close Image(B) after loading image B.
      private int green
      Green channel value of the paint color.
      static int IMAGE_A
      Display mode image A.
      static int IMAGE_A_B
      Display mode image A and B.
      static int IMAGE_B
      Display mode image B.
      protected ModelImage imageA
      Reference to the image A of this frame.
      protected ModelImage imageB
      Reference to the image B of this frame.
      protected boolean isClosing
      Whether the frame's close() method is being called.
      private int lastState
      Save if last state was iconified or normal.
      protected boolean linkedScrolling
      Variable indicating if images of like dimensions should be scrolled simult.
      protected ViewJFrameImage linkFrame
      Holds a reference (link) to another frame so that it be updated with this frame.
      protected ViewJFrameTriImage linkTriFrame
      Holds a reference (link) to another frame so that it can be updated with this frame.
      protected ModelLUT LUTa
      Reference to LUT for image A and to the default LUT for image A.
      protected ModelLUT LUTb
      Reference to LUT for image B and to the default LUT for image B.
      private boolean newFrameCreated  
      private float opacity
      Opacity value of the paint color.
      private java.util.BitSet paintBitmap
      Reference to the BitSet map used in painting the image.
      protected ViewJProgressBar progressBar
      Reference to progress bar.
      private int red
      Red channel value of the paint color.
      protected javax.swing.JLabel scannerLPS_APLabel
      scanner lps goto components*
      protected javax.swing.JTextField scannerLPS_APTextField  
      protected javax.swing.JButton scannerLPS_GoToButton  
      protected javax.swing.JPanel scannerLPS_GoToPanel  
      protected javax.swing.JLabel scannerLPS_ISLabel
      scanner lps goto components*
      protected javax.swing.JTextField scannerLPS_ISTextField  
      protected javax.swing.JLabel scannerLPS_RLLabel
      scanner lps goto components*
      protected javax.swing.JTextField scannerLPS_RLTextField  
      protected javax.swing.JLabel scannerLPSLabel
      Labels for the current scanner position:.
      protected javax.swing.JLabel[] scannerLPSLabelVals
      Labels for the current scanner position values:.
      protected javax.swing.JPanel scannerLPSPanel
      JPanel containing the scanner position labels:.
      protected javax.swing.JLabel scannerRAS_APLabel
      scanner ras goto components*
      protected javax.swing.JTextField scannerRAS_APTextField  
      protected javax.swing.JButton scannerRAS_GoToButton  
      protected javax.swing.JPanel scannerRAS_GoToPanel  
      protected javax.swing.JLabel scannerRAS_ISLabel
      scanner ras goto components*
      protected javax.swing.JTextField scannerRAS_ISTextField  
      protected javax.swing.JLabel scannerRAS_RLLabel
      scanner ras goto components*
      protected javax.swing.JTextField scannerRAS_RLTextField  
      protected javax.swing.JLabel scannerRASLabel
      Labels for the current scanner position:.
      protected javax.swing.JLabel[] scannerRASLabelVals
      Labels for the current scanner position values:.
      protected javax.swing.JPanel scannerRASPanel
      JPanel containing the scanner position labels:.
      protected javax.swing.JTabbedPane scannerTabbedPane
      The tabbed pane to hold teh LPS, RAS and absolution coordinate panels.
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      protected javax.swing.JTabbedPane tabbedPane
      The main tabbed pane in the volume view frame.
      protected javax.swing.JButton talGoToButton  
      protected javax.swing.JPanel talGoToPanel  
      protected javax.swing.JLabel talXLabel
      talairach goto components*
      protected javax.swing.JTextField talXTextField  
      protected javax.swing.JLabel talYLabel
      talairach goto components*
      protected javax.swing.JTextField talYTextField  
      protected javax.swing.JLabel talZLabel
      talairach goto components*
      protected javax.swing.JTextField talZTextField  
      protected ViewUserInterface userInterface
      Reference to the user interface.
      private java.lang.String voiSavedFileName
      DOCUMENT ME!
      protected int zoomMode
      DOCUMENT ME!
      • Fields inherited from class javax.swing.JFrame

        accessibleContext, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Frame

        CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void about​(int zSlice, int tSlice)
      Makes an aboutDialog box that displays information about the image slice.
      abstract void actionPerformed​(java.awt.event.ActionEvent event)
      Method to handle action events generated by the main UI when the current frame is selected.
      void buildLabelPanel()
      The label panel of the x, y, z slider position.
      boolean canCloseImageBAfterLoad()
      Returns whether or not the close image B option should appear after loading.
      void close()
      Closes both image A and image B (if it exists).
      void close​(boolean closeAll)
      Closes both image A and image B (if it exists).
      void closeImageB()
      Removes image B from the frame and resets image A to be the active frame for all image controls.
      void componentHidden​(java.awt.event.ComponentEvent event)
      Does nothing.
      void componentMoved​(java.awt.event.ComponentEvent event)
      Does nothing.
      void componentResized​(java.awt.event.ComponentEvent event)
      Does nothing.
      void componentShown​(java.awt.event.ComponentEvent event)
      Does nothing.
      protected void finalize()
      Cleans memory.
      private javax.swing.filechooser.FileFilter findFilter​(javax.swing.JFileChooser chooser, int filterType)
      Finds the FileFilter that matches the file type.
      float getAlphaBlend()
      Returns a default alphaBlend value for blending of two images.
      abstract ViewControlsImage getControls()
      Gets the control widgets for the frame.
      ModelLUT getDefaultLUTa()
      Accessor that returns the default LUTa for the frame.
      ModelLUT getDefaultLUTb()
      Accessor that returns the default LUTb for the frame.
      int getDisplayMode()
      Accessor that returns displayMode.
      abstract ModelImage getImageA()
      Accessor that returns the imageA.
      abstract ModelImage getImageB()
      Accessor that returns the imageB.
      java.lang.String getImageNameA()
      Accessor that returns the title of image A.
      java.lang.String getImageNameB()
      Accessor that returns the title of image B.
      int getLastState()
      getLastState.
      ModelLUT getLUTa()
      Accessor that returns LUTa.
      ModelLUT getLUTb()
      Accessor that returns LUTb.
      ModelRGB getRGBTA()
      Get the RGB table for image A.
      ModelRGB getRGBTB()
      Get the RGB table for image B.
      ViewJFrameTriImage getTriImg()
      Get the ViewJFrameTriImage reference.
      ViewUserInterface getUserInterface()
      Accessor that returns the user interface.
      static void handleMaskPopupMenu​(java.awt.Component component, java.awt.event.MouseEvent event)
      Handles the popup menu for the Quick Mask buttons
      protected void handlePaintToMaskPopupMenu​(java.awt.Component component, java.awt.event.MouseEvent event)
      Handles the pop-up menu for Paint to Mask buttons (inside/outside)
      protected void handleZoomPopupMenu​(java.awt.Component component, java.awt.event.MouseEvent event)
      DOCUMENT ME!
      protected static int[] initExtents​(ModelImage img)
      Get the extents of an image.
      protected static float[] initImageBuffer​(int[] extents, boolean isColor, int imageType)
      Create the intensity buffer for an image.
      static ModelLUT initLUT​(ModelImage img)
      Creates and initializes the LUT for an image.
      protected static int[] initNumSlices​(ModelImage img)
      Get the total number of time slices and volume slices.
      protected static int[] initPixelBuffer​(int[] extents)
      Create the pixel buffer for an image.
      protected static float[] initResFactor​(float[] imgResols, int[] imgUnits)
      Get the resolution correction needed for non-isotropic images.
      protected static float[] initResolutions​(ModelImage img)
      DOCUMENT ME!
      static ModelRGB initRGB​(ModelImage img)
      Creates and initializes the ModelRGB for an image.
      protected static int[] initSlicePositions​(ModelImage img)
      Get the initial time and volume slice positions.
      protected static int[] initUnits​(ModelImage img)
      DOCUMENT ME!
      protected static float initZoom​(ModelImage img, float xResFactor, float yResFactor, int screenX, int screenY)
      Initializes the zoom variables for an image.
      private boolean isImageResampleable​(ModelImage image)
      Returns whether an image can be resampled to match imageA for loading into the imageB slot of the frame.
      private boolean isResampleNeeded​(ModelImage image)
      Returns whether a image should be resampled to match the extents and resolutions of imageA.
      void loadAllVOIs​(boolean quietMode)
      This method loads all VOIs to the active image from the default VOI directory for that image.
      void loadAllVOIsFrom​(java.lang.String voiDir, boolean quietMode)
      This method loads all VOIs to the active image from a given directory.
      boolean loadImage​(java.lang.Object obj, ViewJComponentEditImage compImage, boolean stackFlag, boolean doOrigins, boolean doOrients, double defaultValue, double defaultRed, double defaultGreen, double defaultBlue, boolean isQuiet)
      Loads an image into imageB slot of frame.
      void loadLUT​(boolean loadAll, boolean quietMode)
      This method loads the LUT for the active image.
      void loadLUTandTransferFunctionFrom​(boolean loadAll, java.lang.String filename, java.lang.String dirName, boolean quietMode)
      This method loads the LUT for the active image.
      static void loadLUTandTransferFunctionFrom​(ModelImage image, ModelStorageBase lut, boolean loadAll, java.lang.String filename, java.lang.String dirName, boolean quietMode)
      Reads the input LUT (ModelLUT or ModelRGB) from file.
      private void loadResampledImage​(ModelImage image)
      Resamples an image and loads it into the imageB slot.
      protected java.lang.String makeString​(float number, int decPts)
      Makes a string of a float with a specific number of decimal points.
      private void matchImages​(ModelImage imageA, ModelImage imageB, boolean doOrigins, boolean doOrients, double defaultValue, double defaultRed, double defaultGreen, double defaultBlue)  
      boolean newFrameBeenCreated()  
      boolean openVOI​(boolean quietMode, boolean doLabels)
      This method opens an existing VOI.
      VOI[] openVOI​(ModelImage image, boolean quietMode)
      This method opens an existing VOI.
      java.io.File pickImageFile()
      Brings up a FileChooser to pick a file.
      abstract void removeControls()
      Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls.
      private boolean reorderAfni​(ModelImage image, int[] axisA, int[] axisB)
      Reorders the AFNI image based on the axis orientations.
      void save​(FileWriteOptions options, int filterType)
      Creates save dialog so that the image can be saved // This should be moved to imageModel.save();
      void save​(ModelImage img, FileWriteOptions options, int filterType)
      Creates save dialog so that the image can be saved // This should be moved to imageModel.save();
      void save​(ModelImage img, FileWriteOptions options, int filterType, boolean operateQuiet)
      Creates save dialog so that the image can be saved // This should be moved to imageModel.save();
      void saveAllVOIs()
      This method saves all VOIs for the active image to the default VOI directory for that image.
      void saveAllVOIsTo​(java.lang.String voiDir)
      This method saves all VOIs for the active image to a given directory.
      void saveLabels​(boolean saveAll)
      DOCUMENT ME!
      void saveLUT​(boolean saveAll)
      This method saves the LUT for the active image.
      static void saveLUTandTransferFunction​(ModelImage image, ModelLUT lut, java.lang.String filename, java.lang.String dirName)
      Saves the ModelLUT and transfer function.
      void saveLUTandTransferFunction​(java.lang.String filename, java.lang.String dirName)
      This method saves the LUT for the active image.
      void saveLUTAs​(boolean saveAll, java.lang.String filename, java.lang.String dirName)
      This method saves the LUT for the active image.
      static void saveLUTAs​(ModelImage image, ModelStorageBase lut, boolean saveAll)
      Saves the LUT associated with the input image (either a ModelLUT or ModelRGB).
      void saveVOI​(boolean saveAllContours)
      This method saves a selected VOI - should this be in VOI structure ??!!!
      java.lang.String saveVOIAs()
      DOCUMENT ME!
      void saveVOIAs​(boolean saveAllContours)
      This method allows the user to choose how to save the VOI.
      void saveVOIIntensities()
      Save intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex.
      void saveVOIIntensitiesTo​(java.lang.String voiIntensitiesDir)
      Save intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex.
      protected void setAbsPositionLabels​(WildMagic.LibFoundation.Mathematics.Vector3f position)
      Sets the Absolute position label.
      abstract void setActiveImage​(int active)
      Sets the active image (image that should be processed for drawing VOIs and applying algorithms.
      abstract void setAlphaBlend​(int value)
      Sets the alpha blending parameter for two image display.
      abstract void setControls()
      Sets the menu and controls (i.e. toolbars) of the main frame!
      void setEnableCloseImageBAfterLoad​(boolean enable)
      Sets whether the close image B option should appear after loading.
      abstract void setEnabled​(boolean flag)
      Controls whether or not the images/VOIs of the frame can be modified.
      void setImageA​(ModelImage image)
      Accessor that sets the imageA.
      abstract void setImageB​(ModelImage imageB)
      Accessor that sets the imageB.
      private int setImageBAfni​(ModelImage imageA, ModelImage image)
      Sets image B to an AFNI image, performing the appropriate transformations.
      void setLastState​(int state)
      setLastState.
      void setLinkedFrame​(ViewJFrameImage linkFrame)
      Accessor that sets the link Frame.
      void setLinkedTriFrame​(ViewJFrameTriImage linkTriFrame)
      Accessor that sets the link Frame.
      void setLUTa​(ModelLUT lut)
      Accessor that sets LUTa.
      void setLUTb​(ModelLUT lut)
      Accessor that sets LUTb.
      void setLUTs​(ModelLUT _LUTa, ModelLUT _LUTb)
      Sets LUTa and LUTb.
      void setMessageText​(java.lang.String str)
      Accessor to set the text of the main frame's text field.
      void setOpacityInfo​(float _OPACITY, float _alphaBlend)
      Sets RGB Information.
      void setpaintBitmap​(java.util.BitSet _paintBitmap)
      Sets the paint Bitmap.
      abstract void setPaintBitmapSwitch​(boolean flag)
      If true do not getMask on a setActiveImage command so as to keep the mask from the old active image.
      abstract void setRGBTA​(ModelRGB RGBT)
      Set the RGB table for image A.
      abstract void setRGBTB​(ModelRGB RGBT)
      Set the RGB table for image B.
      protected void setScannerPosition​(WildMagic.LibFoundation.Mathematics.Vector3f position)
      Sets the Scanner position label.
      abstract void setTitle()
      Sets the Title bar of the frame.
      void stateChanged​(javax.swing.event.ChangeEvent event)
      Does nothing.
      private void transformACPC​(ModelImage image, float[] imgBuffer, TransMatrix xfrm, float iXres, float iYres, float iZres, int iXdim, int iYdim, int iZdim, int iTdim, int planeGap, int[] gapArray, boolean doNN, float oXres, float oYres, float oZres, int oXdim, int oYdim, int oZdim)
      This routine is designed to transform AFNI functional images which have already been transformed to match AFNI original images to match AFNI +acpc images.
      private void transformAFNI​(ModelImage image, float[] imgBuffer, float iXres, float iYres, float iZres, int iXdim, int iYdim, int iZdim, int iTdim, float ilowXmm, float ilowYmm, float ilowZmm, float ihighXmm, float ihighYmm, float ihighZmm, int planeGap, int[] gapArray, boolean doNN, float oXres, float oYres, float oZres, int oXdim, int oYdim, int oZdim, float olowXmm, float olowYmm, float olowZmm, float ohighXmm, float ohighYmm, float ohighZmm)
      This routine is designed to transform AFNI functional images and AFNI 3D + time anatomical images to match AFNI original 3D anatomical images.
      private void transformTalairach​(ModelImage image, float[] imgBuffer, TransMatrix xfrm, float iXres, float iYres, float iZres, int iXdim, int iYdim, int iZdim, int iTdim, int planeGap, int[] gapArray, boolean doNN, float oXres, float oYres, float oZres, int oXdim, int oYdim, int oZdim, int botX, int botY, int botZ, int topX, int topY, int topZ)
      This routine is designed to transform AFNI functional images which have already been transformed to match AFNI original images to match AFNI +tlrc images.
      abstract boolean updateImageExtents()
      The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.
      void windowActivated​(java.awt.event.WindowEvent event)
      Tells the UI that this frame is the currently active one.
      void windowClosed​(java.awt.event.WindowEvent event)
      Does nothing.
      void windowClosing​(java.awt.event.WindowEvent event)
      Cleans up the frame before closing.
      void windowDeactivated​(java.awt.event.WindowEvent event)
      Does nothing.
      void windowDeiconified​(java.awt.event.WindowEvent event)
      Does nothing.
      void windowIconified​(java.awt.event.WindowEvent event)
      Does nothing.
      void windowOpened​(java.awt.event.WindowEvent event)
      Does nothing.
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • IMAGE_A_B

        public static final int IMAGE_A_B
        Display mode image A and B.
        See Also:
        Constant Field Values
      • zoomMode

        protected int zoomMode
        DOCUMENT ME!
      • absoluteLabel

        protected javax.swing.JLabel absoluteLabel
        Labels for the current absolute position:.
      • absoluteLabelVals

        protected javax.swing.JLabel[] absoluteLabelVals
        Labels for the current absolute position values:.
      • absolutePanel

        protected javax.swing.JPanel absolutePanel
        JPanel containing the absoulte position labels:.
      • alphaBlend

        protected float alphaBlend
        Indicates the amount of blending when two images are loaded in the image frame.
      • displayMode

        protected int displayMode
        Indicates which image is to be acted upon when two images are displayed.
      • imageA

        protected ModelImage imageA
        Reference to the image A of this frame.
      • imageB

        protected ModelImage imageB
        Reference to the image B of this frame.
      • linkFrame

        protected ViewJFrameImage linkFrame
        Holds a reference (link) to another frame so that it be updated with this frame.
      • linkTriFrame

        protected ViewJFrameTriImage linkTriFrame
        Holds a reference (link) to another frame so that it can be updated with this frame.
      • defaultLUTa

        protected ModelLUT defaultLUTa
        Reference to LUT for image A and to the default LUT for image A.
      • LUTa

        protected ModelLUT LUTa
        Reference to LUT for image A and to the default LUT for image A.
      • defaultLUTb

        protected ModelLUT defaultLUTb
        Reference to LUT for image B and to the default LUT for image B.
      • LUTb

        protected ModelLUT LUTb
        Reference to LUT for image B and to the default LUT for image B.
      • progressBar

        protected ViewJProgressBar progressBar
        Reference to progress bar.
      • scannerLPSLabel

        protected javax.swing.JLabel scannerLPSLabel
        Labels for the current scanner position:.
      • scannerRASLabel

        protected javax.swing.JLabel scannerRASLabel
        Labels for the current scanner position:.
      • scannerLPSLabelVals

        protected javax.swing.JLabel[] scannerLPSLabelVals
        Labels for the current scanner position values:.
      • scannerRASLabelVals

        protected javax.swing.JLabel[] scannerRASLabelVals
        Labels for the current scanner position values:.
      • scannerLPSPanel

        protected javax.swing.JPanel scannerLPSPanel
        JPanel containing the scanner position labels:.
      • scannerRASPanel

        protected javax.swing.JPanel scannerRASPanel
        JPanel containing the scanner position labels:.
      • tabbedPane

        protected javax.swing.JTabbedPane tabbedPane
        The main tabbed pane in the volume view frame.
      • scannerTabbedPane

        protected javax.swing.JTabbedPane scannerTabbedPane
        The tabbed pane to hold teh LPS, RAS and absolution coordinate panels.
      • userInterface

        protected ViewUserInterface userInterface
        Reference to the user interface.
      • isClosing

        protected boolean isClosing
        Whether the frame's close() method is being called.
      • blue

        private int blue
        Blue channel value of the paint color.
      • enableCloseImageB

        private boolean enableCloseImageB
        Tells whether the ViewMenuBuilder should allow Close Image(B) after loading image B.
      • newFrameCreated

        private boolean newFrameCreated
      • green

        private int green
        Green channel value of the paint color.
      • lastState

        private int lastState
        Save if last state was iconified or normal.
      • opacity

        private float opacity
        Opacity value of the paint color.
      • paintBitmap

        private java.util.BitSet paintBitmap
        Reference to the BitSet map used in painting the image.
      • red

        private int red
        Red channel value of the paint color.
      • voiSavedFileName

        private java.lang.String voiSavedFileName
        DOCUMENT ME!
      • linkedScrolling

        protected boolean linkedScrolling
        Variable indicating if images of like dimensions should be scrolled simult.
      • absoluteXLabel

        protected javax.swing.JLabel absoluteXLabel
        voxel absolute goto components*
      • absoluteYLabel

        protected javax.swing.JLabel absoluteYLabel
        voxel absolute goto components*
      • absoluteZLabel

        protected javax.swing.JLabel absoluteZLabel
        voxel absolute goto components*
      • absoluteXTextField

        protected javax.swing.JTextField absoluteXTextField
      • absoluteYTextField

        protected javax.swing.JTextField absoluteYTextField
      • absoluteZTextField

        protected javax.swing.JTextField absoluteZTextField
      • absoluteGoToButton

        protected javax.swing.JButton absoluteGoToButton
      • absoluteGoToPanel

        protected javax.swing.JPanel absoluteGoToPanel
      • scannerLPS_RLLabel

        protected javax.swing.JLabel scannerLPS_RLLabel
        scanner lps goto components*
      • scannerLPS_APLabel

        protected javax.swing.JLabel scannerLPS_APLabel
        scanner lps goto components*
      • scannerLPS_ISLabel

        protected javax.swing.JLabel scannerLPS_ISLabel
        scanner lps goto components*
      • scannerLPS_RLTextField

        protected javax.swing.JTextField scannerLPS_RLTextField
      • scannerLPS_APTextField

        protected javax.swing.JTextField scannerLPS_APTextField
      • scannerLPS_ISTextField

        protected javax.swing.JTextField scannerLPS_ISTextField
      • scannerLPS_GoToButton

        protected javax.swing.JButton scannerLPS_GoToButton
      • scannerLPS_GoToPanel

        protected javax.swing.JPanel scannerLPS_GoToPanel
      • scannerRAS_RLLabel

        protected javax.swing.JLabel scannerRAS_RLLabel
        scanner ras goto components*
      • scannerRAS_APLabel

        protected javax.swing.JLabel scannerRAS_APLabel
        scanner ras goto components*
      • scannerRAS_ISLabel

        protected javax.swing.JLabel scannerRAS_ISLabel
        scanner ras goto components*
      • scannerRAS_RLTextField

        protected javax.swing.JTextField scannerRAS_RLTextField
      • scannerRAS_APTextField

        protected javax.swing.JTextField scannerRAS_APTextField
      • scannerRAS_ISTextField

        protected javax.swing.JTextField scannerRAS_ISTextField
      • scannerRAS_GoToButton

        protected javax.swing.JButton scannerRAS_GoToButton
      • scannerRAS_GoToPanel

        protected javax.swing.JPanel scannerRAS_GoToPanel
      • talXLabel

        protected javax.swing.JLabel talXLabel
        talairach goto components*
      • talYLabel

        protected javax.swing.JLabel talYLabel
        talairach goto components*
      • talZLabel

        protected javax.swing.JLabel talZLabel
        talairach goto components*
      • talXTextField

        protected javax.swing.JTextField talXTextField
      • talYTextField

        protected javax.swing.JTextField talYTextField
      • talZTextField

        protected javax.swing.JTextField talZTextField
      • talGoToButton

        protected javax.swing.JButton talGoToButton
      • talGoToPanel

        protected javax.swing.JPanel talGoToPanel
    • Constructor Detail

      • ViewJFrameBase

        public ViewJFrameBase​(ModelImage _imageA,
                              ModelImage _imageB)
        Makes an image frame.
        Parameters:
        _imageA - model image A
        _imageB - model image B
    • Method Detail

      • actionPerformed

        public abstract void actionPerformed​(java.awt.event.ActionEvent event)
        Method to handle action events generated by the main UI when the current frame is selected. Implemented by specific frame classes.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        event - the event from the UI
      • getControls

        public abstract ViewControlsImage getControls()
        Gets the control widgets for the frame.
        Returns:
        the frame's image controls
      • getImageA

        public abstract ModelImage getImageA()
        Accessor that returns the imageA.
        Returns:
        imageA
      • getImageB

        public abstract ModelImage getImageB()
        Accessor that returns the imageB.
        Returns:
        imageB
      • removeControls

        public abstract void removeControls()
        Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls. Abstract and must be extended.
      • setActiveImage

        public abstract void setActiveImage​(int active)
        Sets the active image (image that should be processed for drawing VOIs and applying algorithms.
        Parameters:
        active - IMAGE_A or IMAGE_B
      • setAlphaBlend

        public abstract void setAlphaBlend​(int value)
        Sets the alpha blending parameter for two image display.
        Parameters:
        value - amount [0,100] that is the percentage of Image A to be displayed and (1-percentage) of Image B to be displayed
      • setControls

        public abstract void setControls()
        Sets the menu and controls (i.e. toolbars) of the main frame! This puts only the menus and controls needed to controls the operations of this frame. Different image frames have different menu and controls.
      • setEnabled

        public abstract void setEnabled​(boolean flag)
        Controls whether or not the images/VOIs of the frame can be modified.
        Overrides:
        setEnabled in class java.awt.Component
        Parameters:
        flag - if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
      • setImageB

        public abstract void setImageB​(ModelImage imageB)
        Accessor that sets the imageB.
        Parameters:
        imageB - The image to make image-B in this frame.
      • setPaintBitmapSwitch

        public abstract void setPaintBitmapSwitch​(boolean flag)
        If true do not getMask on a setActiveImage command so as to keep the mask from the old active image.
        Parameters:
        flag - if true do not getMask on a setActiveImage command
      • setRGBTA

        public abstract void setRGBTA​(ModelRGB RGBT)
        Set the RGB table for image A.
        Parameters:
        RGBT - the RGB table to use for image A
      • setRGBTB

        public abstract void setRGBTB​(ModelRGB RGBT)
        Set the RGB table for image B.
        Parameters:
        RGBT - the RGB table to use for image B
      • setTitle

        public abstract void setTitle()
        Sets the Title bar of the frame.
      • updateImageExtents

        public abstract boolean updateImageExtents()
        The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.
        Specified by:
        updateImageExtents in interface ViewImageUpdateInterface
        Returns:
        true if the update was successful, false otherwise
        See Also:
        ViewImageUpdateInterface
      • about

        public void about​(int zSlice,
                          int tSlice)
        Makes an aboutDialog box that displays information about the image slice.
        Parameters:
        zSlice - index to slice in z-Plane about the specific image slice
        tSlice - index to slice in time about the specific image slice
      • buildLabelPanel

        public void buildLabelPanel()
        The label panel of the x, y, z slider position.
      • canCloseImageBAfterLoad

        public boolean canCloseImageBAfterLoad()
        Returns whether or not the close image B option should appear after loading.
        Returns:
        whether the "Close image B" option should appear after image B is loaded
      • newFrameBeenCreated

        public boolean newFrameBeenCreated()
      • close

        public void close()
        Closes both image A and image B (if it exists). It ensures the images are un-registered from the main-frame then removes any display listeners.
      • close

        public void close​(boolean closeAll)
        Closes both image A and image B (if it exists). It ensures the images are un-registered from the main-frame then removes any display listeners.
      • closeImageB

        public void closeImageB()
        Removes image B from the frame and resets image A to be the active frame for all image controls. Ensures the image is removed, disconnected from the frame and un-registered. Also informs the garbage-collector to release any held memory.
      • componentHidden

        public void componentHidden​(java.awt.event.ComponentEvent event)
        Does nothing.
        Specified by:
        componentHidden in interface java.awt.event.ComponentListener
        Parameters:
        event - the component event
      • componentMoved

        public void componentMoved​(java.awt.event.ComponentEvent event)
        Does nothing.
        Specified by:
        componentMoved in interface java.awt.event.ComponentListener
        Parameters:
        event - the component event
      • componentResized

        public void componentResized​(java.awt.event.ComponentEvent event)
        Does nothing.
        Specified by:
        componentResized in interface java.awt.event.ComponentListener
        Parameters:
        event - the component event
      • componentShown

        public void componentShown​(java.awt.event.ComponentEvent event)
        Does nothing.
        Specified by:
        componentShown in interface java.awt.event.ComponentListener
        Parameters:
        event - the component event
      • getAlphaBlend

        public float getAlphaBlend()
        Returns a default alphaBlend value for blending of two images.
        Returns:
        a default alphaBlend value
      • getDisplayMode

        public int getDisplayMode()
        Accessor that returns displayMode.
        Returns:
        displayMode
      • getImageNameA

        public java.lang.String getImageNameA()
        Accessor that returns the title of image A.
        Returns:
        frame title for Image A
      • getImageNameB

        public java.lang.String getImageNameB()
        Accessor that returns the title of image B.
        Returns:
        frame title for Image B
      • getLastState

        public int getLastState()
        getLastState.
        Returns:
        lastState Should be either Frame.NORMAL or Frame.ICONIFIED
      • getLUTa

        public ModelLUT getLUTa()
        Accessor that returns LUTa.
        Returns:
        LUTa
      • getLUTb

        public ModelLUT getLUTb()
        Accessor that returns LUTb.
        Returns:
        LUTb
      • getDefaultLUTa

        public ModelLUT getDefaultLUTa()
        Accessor that returns the default LUTa for the frame.
        Returns:
        defaultLUTa
      • getDefaultLUTb

        public ModelLUT getDefaultLUTb()
        Accessor that returns the default LUTb for the frame.
        Returns:
        defaultLUTb
      • getRGBTA

        public ModelRGB getRGBTA()
        Get the RGB table for image A.
        Returns:
        null (may be overridden by inheriting classes)
      • getRGBTB

        public ModelRGB getRGBTB()
        Get the RGB table for image B.
        Returns:
        null (may be overridden by inheriting classes)
      • getTriImg

        public ViewJFrameTriImage getTriImg()
        Get the ViewJFrameTriImage reference.
        Returns:
        linkTriFrame ViewJFrameTriImage.
      • getUserInterface

        public ViewUserInterface getUserInterface()
        Accessor that returns the user interface.
        Returns:
        the user interface
      • loadAllVOIs

        public void loadAllVOIs​(boolean quietMode)
        This method loads all VOIs to the active image from the default VOI directory for that image.
        Parameters:
        quietMode - if true indicates that warnings should not be displayed.
      • loadAllVOIsFrom

        public void loadAllVOIsFrom​(java.lang.String voiDir,
                                    boolean quietMode)
        This method loads all VOIs to the active image from a given directory.
        Parameters:
        voiDir - the directory to load voi's from
        quietMode - if true indicates that warnings should not be displayed.
      • loadImage

        public boolean loadImage​(java.lang.Object obj,
                                 ViewJComponentEditImage compImage,
                                 boolean stackFlag,
                                 boolean doOrigins,
                                 boolean doOrients,
                                 double defaultValue,
                                 double defaultRed,
                                 double defaultGreen,
                                 double defaultBlue,
                                 boolean isQuiet)
        Loads an image into imageB slot of frame. Matches the imageB resolutions and dimensions to imageA, and can optionally match the images' origins and orientations.
        Parameters:
        obj - an object which is either a ModelImage to be loaded into the modelimage (as say, imageB, imported from another frame) or a File to be read in via FileIO.readImage(...)
        compImage - image component where image is set so that it can be displayed.
        stackFlag - flag indicating multi file
        doOrigins - when calling MatchImages to match resolutions and dimensions, should origins be matched too?
        doOrients - when calling MatchImages to match resolutions and dimensions, should orientations be matched too?
        Returns:
        true if the load was successful, false otherwise
        See Also:
        JDialogLoadImage
      • matchImages

        private void matchImages​(ModelImage imageA,
                                 ModelImage imageB,
                                 boolean doOrigins,
                                 boolean doOrients,
                                 double defaultValue,
                                 double defaultRed,
                                 double defaultGreen,
                                 double defaultBlue)
      • loadLUT

        public void loadLUT​(boolean loadAll,
                            boolean quietMode)
        This method loads the LUT for the active image. If the image is not a color image then both the functions and the LUT data are loaded. If this is a color image, then only the functions are loaded.
        Parameters:
        loadAll - boolean indicating that both lut and transfer functions should be loaded. If false, then only transfer functions are loaded.
        quietMode - if true indicates that warnings should not be displayed.
      • loadLUTandTransferFunctionFrom

        public void loadLUTandTransferFunctionFrom​(boolean loadAll,
                                                   java.lang.String filename,
                                                   java.lang.String dirName,
                                                   boolean quietMode)
        This method loads the LUT for the active image. If the image is not a color image then both the functions and the LUT data are loaded. If this is a color image, then only the functions are loaded.
        Parameters:
        loadAll - boolean indicating that both lut and transfer functions should be loaded. If false, then only transfer functions are loaded.
        filename - filename to save LUT as
        dirName - directory to save LUT to
        quietMode - if true indicates that warnings should not be displayed.
      • loadLUTandTransferFunctionFrom

        public static void loadLUTandTransferFunctionFrom​(ModelImage image,
                                                          ModelStorageBase lut,
                                                          boolean loadAll,
                                                          java.lang.String filename,
                                                          java.lang.String dirName,
                                                          boolean quietMode)
        Reads the input LUT (ModelLUT or ModelRGB) from file.
        Parameters:
        image -
        lut -
        loadAll -
        filename -
        dirName -
        quietMode -
      • openVOI

        public boolean openVOI​(boolean quietMode,
                               boolean doLabels)
        This method opens an existing VOI.
        Parameters:
        quietMode - if true indicates that warnings should not be displayed.
        doLabels - DOCUMENT ME!
        Returns:
        whether a VOI was successfully opened (ie - the dialog wasn't cancelled)
      • openVOI

        public VOI[] openVOI​(ModelImage image,
                             boolean quietMode)
        This method opens an existing VOI.
        Parameters:
        image - image where VOI(s) are to registered
        quietMode - if true indicates that warnings should not be displayed.
        Returns:
        the VOI(s)
      • pickImageFile

        public java.io.File pickImageFile()
        Brings up a FileChooser to pick a file.
        Returns:
        File the File the chooser picks.
      • save

        public void save​(FileWriteOptions options,
                         int filterType)
        Creates save dialog so that the image can be saved // This should be moved to imageModel.save();
        Parameters:
        options - File-write options.
        filterType - only used if >= 0
      • save

        public void save​(ModelImage img,
                         FileWriteOptions options,
                         int filterType)
        Creates save dialog so that the image can be saved // This should be moved to imageModel.save();
        Parameters:
        img - DOCUMENT ME!
        options - DOCUMENT ME!
        filterType - only used if value >= 0
      • save

        public void save​(ModelImage img,
                         FileWriteOptions options,
                         int filterType,
                         boolean operateQuiet)
        Creates save dialog so that the image can be saved // This should be moved to imageModel.save();
        Parameters:
        img - DOCUMENT ME!
        options - DOCUMENT ME!
        filterType - only used if value >= 0
        operateQuiet - informs the FileIO to not notify user of errors or interrogate for more information.
      • saveAllVOIs

        public void saveAllVOIs()
        This method saves all VOIs for the active image to the default VOI directory for that image.
      • saveAllVOIsTo

        public void saveAllVOIsTo​(java.lang.String voiDir)
        This method saves all VOIs for the active image to a given directory.
        Parameters:
        voiDir - directory that contains VOIs for this image.
      • saveLabels

        public void saveLabels​(boolean saveAll)
        DOCUMENT ME!
        Parameters:
        saveAll - DOCUMENT ME!
      • saveLUT

        public void saveLUT​(boolean saveAll)
        This method saves the LUT for the active image. If the image is not a color image then both the functions and the LUT data are saved. If this is a color image, then only the functions are saved.
        Parameters:
        saveAll - - boolean indicating that both lut and transfer functions should be saved. If false, then only transfer functions are saved.
      • saveLUTAs

        public void saveLUTAs​(boolean saveAll,
                              java.lang.String filename,
                              java.lang.String dirName)
        This method saves the LUT for the active image. If the image is not a color image then both the functions and the LUT data are saved. If this is a color image, then only the functions are saved.
        Parameters:
        saveAll - boolean indicating that both lut and transfer functions should be saved. If false, then only transfer functions are saved.

        If either filename or directory is null, then the user will be prompted for a filename.

        filename - filename to save LUT as
        dirName - directory to save LUT to
      • saveLUTAs

        public static void saveLUTAs​(ModelImage image,
                                     ModelStorageBase lut,
                                     boolean saveAll)
        Saves the LUT associated with the input image (either a ModelLUT or ModelRGB).
        Parameters:
        image -
        lut -
        saveAll -
      • saveLUTandTransferFunction

        public void saveLUTandTransferFunction​(java.lang.String filename,
                                               java.lang.String dirName)
        This method saves the LUT for the active image. If the image is not a color image then both the functions and the LUT data are saved. If this is a color image, then only the functions are saved.
        Parameters:
        filename - filename to save LUT as
        dirName - directory to save LUT to
      • saveLUTandTransferFunction

        public static void saveLUTandTransferFunction​(ModelImage image,
                                                      ModelLUT lut,
                                                      java.lang.String filename,
                                                      java.lang.String dirName)
        Saves the ModelLUT and transfer function.
        Parameters:
        image -
        lut -
        filename -
        dirName -
      • saveVOI

        public void saveVOI​(boolean saveAllContours)
        This method saves a selected VOI - should this be in VOI structure ??!!!
        Parameters:
        saveAllContours - if true all contours are saved
      • saveVOIAs

        public java.lang.String saveVOIAs()
        DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • saveVOIAs

        public void saveVOIAs​(boolean saveAllContours)
        This method allows the user to choose how to save the VOI.
        Parameters:
        saveAllContours - if true all contours are saved
      • saveVOIIntensities

        public void saveVOIIntensities()
        Save intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex. If color use format x,y,z,a,r,g,b on each line and if complex use format x,y,z,real,imaginary on each line.
      • saveVOIIntensitiesTo

        public void saveVOIIntensitiesTo​(java.lang.String voiIntensitiesDir)
        Save intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex. If color use format x,y,z,a,r,g,b on each line and if complex use format x,y,z,real,imaginary on each line.
      • setEnableCloseImageBAfterLoad

        public void setEnableCloseImageBAfterLoad​(boolean enable)
        Sets whether the close image B option should appear after loading.
        Parameters:
        enable - whether the "Close image B" option should appear after image B is loaded
      • setImageA

        public void setImageA​(ModelImage image)
        Accessor that sets the imageA.
        Parameters:
        image - The image to make image-A in this frame.
      • setLastState

        public void setLastState​(int state)
        setLastState.
        Parameters:
        state - Should be either Frame.NORMAL or Frame.ICONIFIED
      • setLinkedFrame

        public void setLinkedFrame​(ViewJFrameImage linkFrame)
        Accessor that sets the link Frame.
        Parameters:
        linkFrame - set frame to link to.
      • setLinkedTriFrame

        public void setLinkedTriFrame​(ViewJFrameTriImage linkTriFrame)
        Accessor that sets the link Frame.
        Parameters:
        linkTriFrame - set frame to link to.
      • setLUTa

        public void setLUTa​(ModelLUT lut)
        Accessor that sets LUTa.
        Parameters:
        lut - DOCUMENT ME!
      • setLUTb

        public void setLUTb​(ModelLUT lut)
        Accessor that sets LUTb.
        Parameters:
        lut - DOCUMENT ME!
      • setLUTs

        public void setLUTs​(ModelLUT _LUTa,
                            ModelLUT _LUTb)
        Sets LUTa and LUTb.
        Parameters:
        _LUTa - DOCUMENT ME!
        _LUTb - DOCUMENT ME!
      • setMessageText

        public final void setMessageText​(java.lang.String str)
        Accessor to set the text of the main frame's text field.
        Parameters:
        str - string to be display in the main frame's text field
      • setOpacityInfo

        public void setOpacityInfo​(float _OPACITY,
                                   float _alphaBlend)
        Sets RGB Information.
        Parameters:
        _OPACITY - DOCUMENT ME!
        _alphaBlend - DOCUMENT ME!
      • setpaintBitmap

        public void setpaintBitmap​(java.util.BitSet _paintBitmap)
        Sets the paint Bitmap.
        Parameters:
        _paintBitmap - DOCUMENT ME!
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent event)
        Does nothing.
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Parameters:
        event - the change event
      • windowActivated

        public void windowActivated​(java.awt.event.WindowEvent event)
        Tells the UI that this frame is the currently active one.
        Specified by:
        windowActivated in interface java.awt.event.WindowListener
        Parameters:
        event - the window event
      • windowClosed

        public void windowClosed​(java.awt.event.WindowEvent event)
        Does nothing.
        Specified by:
        windowClosed in interface java.awt.event.WindowListener
        Parameters:
        event - the window event
      • windowClosing

        public void windowClosing​(java.awt.event.WindowEvent event)
        Cleans up the frame before closing.
        Specified by:
        windowClosing in interface java.awt.event.WindowListener
        Parameters:
        event - the window event that triggered this method
      • windowDeactivated

        public void windowDeactivated​(java.awt.event.WindowEvent event)
        Does nothing.
        Specified by:
        windowDeactivated in interface java.awt.event.WindowListener
        Parameters:
        event - the window event
      • windowDeiconified

        public void windowDeiconified​(java.awt.event.WindowEvent event)
        Does nothing.
        Specified by:
        windowDeiconified in interface java.awt.event.WindowListener
        Parameters:
        event - the window event
      • windowIconified

        public void windowIconified​(java.awt.event.WindowEvent event)
        Does nothing.
        Specified by:
        windowIconified in interface java.awt.event.WindowListener
        Parameters:
        event - the window event
      • windowOpened

        public void windowOpened​(java.awt.event.WindowEvent event)
        Does nothing.
        Specified by:
        windowOpened in interface java.awt.event.WindowListener
        Parameters:
        event - the window event
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Cleans memory.
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable - the Exception raised by this method
      • makeString

        protected java.lang.String makeString​(float number,
                                              int decPts)
        Makes a string of a float with a specific number of decimal points.
        Parameters:
        number - number to be converted to a string
        decPts - the number of decimal points
        Returns:
        string representation of the number
      • setAbsPositionLabels

        protected void setAbsPositionLabels​(WildMagic.LibFoundation.Mathematics.Vector3f position)
        Sets the Absolute position label.
        Parameters:
        position - DOCUMENT ME!
      • setScannerPosition

        protected void setScannerPosition​(WildMagic.LibFoundation.Mathematics.Vector3f position)
        Sets the Scanner position label.
        Parameters:
        position - DOCUMENT ME!
      • handleZoomPopupMenu

        protected void handleZoomPopupMenu​(java.awt.Component component,
                                           java.awt.event.MouseEvent event)
        DOCUMENT ME!
        Parameters:
        component - DOCUMENT ME!
        event - DOCUMENT ME!
      • handleMaskPopupMenu

        public static void handleMaskPopupMenu​(java.awt.Component component,
                                               java.awt.event.MouseEvent event)
        Handles the popup menu for the Quick Mask buttons
        Parameters:
        component - DOCUMENT ME!
        event - DOCUMENT ME!
      • handlePaintToMaskPopupMenu

        protected void handlePaintToMaskPopupMenu​(java.awt.Component component,
                                                  java.awt.event.MouseEvent event)
        Handles the pop-up menu for Paint to Mask buttons (inside/outside)
        Parameters:
        component - DOCUMENT ME!
        event - DOCUMENT ME!
      • initExtents

        protected static int[] initExtents​(ModelImage img)
        Get the extents of an image. (don't know why this is really needed...)
        Parameters:
        img - the image
        Returns:
        the image's extents
      • initImageBuffer

        protected static float[] initImageBuffer​(int[] extents,
                                                 boolean isColor,
                                                 int imageType)
        Create the intensity buffer for an image.
        Parameters:
        extents - the extents of the image
        isColor - whether the image is in color
        Returns:
        a buffer which is big enough to contain the image intensity data
      • initNumSlices

        protected static int[] initNumSlices​(ModelImage img)
        Get the total number of time slices and volume slices.
        Parameters:
        img - the image to get the slices of
        Returns:
        an array containing the number of volume slices (in the first element) and the number of time slices in the image (in the second element)
      • initPixelBuffer

        protected static int[] initPixelBuffer​(int[] extents)
        Create the pixel buffer for an image.
        Parameters:
        extents - the extents of the image
        Returns:
        a buffer which is big enough to contain the image pixel data
      • initResFactor

        protected static float[] initResFactor​(float[] imgResols,
                                               int[] imgUnits)
        Get the resolution correction needed for non-isotropic images.
        Parameters:
        imgResols - the image resolution
        imgUnits - the image units of measure
        Returns:
        the resolution correction factor in the x (the first element) and y (the second element) dimensions
      • initResolutions

        protected static float[] initResolutions​(ModelImage img)
        DOCUMENT ME!
        Parameters:
        img - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • initSlicePositions

        protected static int[] initSlicePositions​(ModelImage img)
        Get the initial time and volume slice positions.
        Parameters:
        img - the image to get the slice positions of
        Returns:
        an array containing the slice in the volume (in the first element) and the time slice (in the second element)
      • initUnits

        protected static int[] initUnits​(ModelImage img)
        DOCUMENT ME!
        Parameters:
        img - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • initLUT

        public static ModelLUT initLUT​(ModelImage img)
                                throws java.lang.OutOfMemoryError
        Creates and initializes the LUT for an image.
        Parameters:
        img - the image to create a LUT for
        Returns:
        a LUT for the image img (null if a color image)
        Throws:
        java.lang.OutOfMemoryError - if enough memory cannot be allocated for this method
      • initRGB

        public static ModelRGB initRGB​(ModelImage img)
                                throws java.lang.OutOfMemoryError
        Creates and initializes the ModelRGB for an image.
        Parameters:
        img - the image to create a ModelRGB for
        Returns:
        a ModelRGB for the image img (null if NOT a color image)
        Throws:
        java.lang.OutOfMemoryError - if enough memory cannot be allocated for this method
      • initZoom

        protected static float initZoom​(ModelImage img,
                                        float xResFactor,
                                        float yResFactor,
                                        int screenX,
                                        int screenY)
        Initializes the zoom variables for an image.
        Parameters:
        img - the image to use to initialize the zoom
        xResFactor - correction factor in the x direction for images that are do not have isotropic voxels
        yResFactor - correction factor in the x direction for images that are do not have isotropic voxels
        Returns:
        the initial zoom to use for this image
      • findFilter

        private javax.swing.filechooser.FileFilter findFilter​(javax.swing.JFileChooser chooser,
                                                              int filterType)
        Finds the FileFilter that matches the file type.
        Parameters:
        chooser - JFileChooser
        filterType - int the file filter type
        Returns:
        FileFilter the filter that matches the filter type.
      • isImageResampleable

        private boolean isImageResampleable​(ModelImage image)
        Returns whether an image can be resampled to match imageA for loading into the imageB slot of the frame.
        Parameters:
        image - the image to check
        Returns:
        true if the image is either 3D or 4D (but not if the 4th dim differs)
      • isResampleNeeded

        private boolean isResampleNeeded​(ModelImage image)
        Returns whether a image should be resampled to match the extents and resolutions of imageA.
        Parameters:
        image - the image to check against imageA
        Returns:
        true if a resampling of the image is required
      • loadResampledImage

        private void loadResampledImage​(ModelImage image)
        Resamples an image and loads it into the imageB slot. This image should already be matched against imageA.
        Parameters:
        image - the image to resample and load as imageB
      • reorderAfni

        private boolean reorderAfni​(ModelImage image,
                                    int[] axisA,
                                    int[] axisB)
        Reorders the AFNI image based on the axis orientations. B0 to A1 indicates changing x to y; B0 to A2 indicates a change from x to z.
        Parameters:
        image - Image to reorder.
        axisA - axis indices orientation of reordered image
        axisB - axis indices orientation of original image
        Returns:
        true if the reordering of the Afni file is successful, false otherwise
      • setImageBAfni

        private int setImageBAfni​(ModelImage imageA,
                                  ModelImage image)
        Sets image B to an AFNI image, performing the appropriate transformations.
        Parameters:
        imageA - Image A.
        image - AFNI image to set to image A.
        Returns:
        -1 if failure; 0 if no tranformation needed; and 1 if transformation and set successful.
      • transformACPC

        private void transformACPC​(ModelImage image,
                                   float[] imgBuffer,
                                   TransMatrix xfrm,
                                   float iXres,
                                   float iYres,
                                   float iZres,
                                   int iXdim,
                                   int iYdim,
                                   int iZdim,
                                   int iTdim,
                                   int planeGap,
                                   int[] gapArray,
                                   boolean doNN,
                                   float oXres,
                                   float oYres,
                                   float oZres,
                                   int oXdim,
                                   int oYdim,
                                   int oZdim)
        This routine is designed to transform AFNI functional images which have already been transformed to match AFNI original images to match AFNI +acpc images.

        AFNI:Software for Analysis and Visualization of Functional Magnetic Resonance Neuroimages by Robert W. Cox states:

        "In some applications, gaps are present between the functional slices. For example, some investigators using sagittal functional images do not collect data that spans the longitudinal fissure, but instead leave a 3-5 mm gap there. The auxiliary program abut can provide zero-filled images to fill in the gaps, and can resample the nonzero slices to a finer mesh if needed(e.g., to fill a 2 mm gap in a series of 4 mm functional slices). Resampling in the slice select direction between contiguous input slices can be done using nearest- neighbor, linear, or cubic interpolation, at the user's discretion. Interpolation is not done across the boundaries between the gap-filling zero images and the nonzero user-supplied images; that is, interpolation is only done inside spatially contiguous blocks of actual input data."

        A second special consideration exists in the interpolation of functional data. The MCW AFNI - User Manual states: "In this version of AFNI, the threshold data (e.g., correlation coefficient) is always resampled using the nearest neighbor method. This is because thresholding with an interpolated nonlinear statistic is a somewhat dubious procedure." At another point the manual states: "Threshold data in functional datasets is always resampled using the nearest neighbor mode. This is becasue it is somewhat unreasonable to interpolate a nonlinear statistic (such as correlation coefficient) between voxels, and then to interpret this statistic using probabilistic models that assume independence."

        Thus, the intensity data is interpolated with trilinear interpolation and the threshold data is interpolated with nearest neighbor interpolation.

        Parameters:
        image - image being created
        imgBuffer - source image array
        xfrm - transformation matrix to be applied
        iXres - input x resolution
        iYres - input y resolution
        iZres - input z resolution
        iXdim - input x dimesnion
        iYdim - input y dimension
        iZdim - input z dimension
        iTdim - input t dimension
        planeGap - -1 if no zero filled gaps, 0 for x axis gaps, 1 for y axis, 2 for z axis
        gapArray - array of coordinates at which the zero filled planes occur
        doNN - true if functional, false if anatomical
        oXres - output x resolution
        oYres - output y resolution
        oZres - output z resolution
        oXdim - output x dimension
        oYdim - output y dimension
        oZdim - output z dimension
      • transformAFNI

        private void transformAFNI​(ModelImage image,
                                   float[] imgBuffer,
                                   float iXres,
                                   float iYres,
                                   float iZres,
                                   int iXdim,
                                   int iYdim,
                                   int iZdim,
                                   int iTdim,
                                   float ilowXmm,
                                   float ilowYmm,
                                   float ilowZmm,
                                   float ihighXmm,
                                   float ihighYmm,
                                   float ihighZmm,
                                   int planeGap,
                                   int[] gapArray,
                                   boolean doNN,
                                   float oXres,
                                   float oYres,
                                   float oZres,
                                   int oXdim,
                                   int oYdim,
                                   int oZdim,
                                   float olowXmm,
                                   float olowYmm,
                                   float olowZmm,
                                   float ohighXmm,
                                   float ohighYmm,
                                   float ohighZmm)
        This routine is designed to transform AFNI functional images and AFNI 3D + time anatomical images to match AFNI original 3D anatomical images. Here the 3 axes of the 2 images are parallel and the spatial orientation of the 2 sets of axes are identical.

        AFNI:Software for Analysis and Visualization of Functional Magnetic Resonance Neuroimages by Robert W. Cox states:

        "In some applications, gaps are present between the functional slices. For example, some investigators using sagittal functional images do not collect data that spans the longitudinal fissure, but instead leave a 3-5 mm gap there. The auxiliary program abut can provide zero-filled images to fill in the gaps, and can resample the nonzero slices to a finer mesh if needed(e.g., to fill a 2 mm gap in a series of 4 mm functional slices). Resampling in the slice select direction between contiguous input slices can be done using nearest- neighbor, linear, or cubic interpolation, at the user's discretion. Interpolation is not done across the boundaries between the gap-filling zero images and the nonzero user-supplied images; that is, interpolation is only done inside spatially contiguous blocks of actual input data."

        A second special consideration exists in the interpolation of functional data. The MCW AFNI - User Manual states: "In this version of AFNI, the threshold data (e.g., correlation coefficient) is always resampled using the nearest neighbor method. This is because thresholding with an interpolated nonlinear statistic is a somewhat dubious procedure."

        At another point the manual states: "Threshold data in functional datasets is always resampled using the nearest neighbor mode. This is becasue it is somewhat unreasonable to interpolate a nonlinear statistic (such as correlation coefficient) between voxels, and then to interpret this statistic using probabilistic models that assume independence."

        Thus, the intensity data is interpolated with trilinear interpolation and the threshold data is interpolated with nearest neighbor interpolation.

        Parameters:
        image - image being created
        imgBuffer - source image array
        iXres - input x resolution
        iYres - input y resolution
        iZres - input z resolution
        iXdim - input x dimesnion
        iYdim - input y dimension
        iZdim - input z dimension
        iTdim - input t dimension
        ilowXmm - lowest valid input x location in space in millimeters
        ilowYmm - lowest valid input y location in space in millimeters
        ilowZmm - lowest valid input z location in space in millimeters
        ihighXmm - highest valid input x location in space in millimeters
        ihighYmm - highest valid input y location in space in millimeters
        ihighZmm - highest valid input z location in space in millimeters
        planeGap - -1 if no zero filled gaps, 0 for x axis gaps, 1 for y axis, 2 for z axis
        gapArray - array of coordinates at which the zero filled planes occur
        doNN - true if functional, false if anatomical
        oXres - output x resolution
        oYres - output y resolution
        oZres - output z resolution
        oXdim - output x dimension
        oYdim - output y dimension
        oZdim - output z dimension
        olowXmm - lowest valid output x location in space in millimeters
        olowYmm - lowest valid output y location in space in millimeters
        olowZmm - lowest valid output z location in space in millimeters
        ohighXmm - highest valid output x location in space in millimeters
        ohighYmm - highest valid output y location in space in millimeters
        ohighZmm - highest valid output z location in space in millimeters
      • transformTalairach

        private void transformTalairach​(ModelImage image,
                                        float[] imgBuffer,
                                        TransMatrix xfrm,
                                        float iXres,
                                        float iYres,
                                        float iZres,
                                        int iXdim,
                                        int iYdim,
                                        int iZdim,
                                        int iTdim,
                                        int planeGap,
                                        int[] gapArray,
                                        boolean doNN,
                                        float oXres,
                                        float oYres,
                                        float oZres,
                                        int oXdim,
                                        int oYdim,
                                        int oZdim,
                                        int botX,
                                        int botY,
                                        int botZ,
                                        int topX,
                                        int topY,
                                        int topZ)
        This routine is designed to transform AFNI functional images which have already been transformed to match AFNI original images to match AFNI +tlrc images.

        AFNI:Software for Analysis and Visualization of Functional Magnetic Resonance Neuroimages by Robert W. Cox states:

        "In some applications, gaps are present between the functional slices. For example, some investigators using sagittal functional images do not collect data that spans the longitudinal fissure, but instead leave a 3-5 mm gap there. The auxiliary program abut can provide zero-filled images to fill in the gaps, and can resample the nonzero slices to a finer mesh if needed(e.g., to fill a 2 mm gap in a series of 4 mm functional slices). Resampling in the slice select direction between contiguous input slices can be done using nearest- neighbor, linear, or cubic interpolation, at the user's discretion. Interpolation is not done across the boundaries between the gap-filling zero images and the nonzero user-supplied images; that is, interpolation is only done inside spatially contiguous blocks of actual input data."

        A second special consideration exists in the interpolation of functional data. The MCW AFNI - User Manual states: "In this version of AFNI, the threshold data (e.g., correlation coefficient) is always resampled using the nearest neighbor method. This is because thresholding with an interpolated nonlinear statistic is a somewhat dubious procedure." At another point the manual states: "Threshold data in functional datasets is always resampled using the nearest neighbor mode. This is becasue it is somewhat unreasonable to interpolate a nonlinear statistic (such as correlation coefficient) between voxels, and then to interpret this statistic using probabilistic models that assume independence."

        Thus, the intensity data is interpolated with trilinear interpolation and the threshold data is interpolated with nearest neighbor interpolation.

        Parameters:
        image - image being created
        imgBuffer - source image array
        xfrm - transformation matrix to be applied
        iXres - input x resolution
        iYres - input y resolution
        iZres - input z resolution
        iXdim - input x dimesnion
        iYdim - input y dimension
        iZdim - input z dimension
        iTdim - input t dimension
        planeGap - -1 if no zero filled gaps, 0 for x axis gaps, 1 for y axis, 2 for z axis
        gapArray - array of coordinates at which the zero filled planes occur
        doNN - true if functional, false if anatomical
        oXres - output x resolution
        oYres - output y resolution
        oZres - output z resolution
        oXdim - output x dimension
        oYdim - output y dimension
        oZdim - output z dimension
        botX - lowest x output value in this 1 of the 12 Talairach regions
        botY - lowest y output value in this 1 of the 12 Talairach regions
        botZ - lowest z output value in this 1 of the 12 Talairach regions
        topX - highest x output value in this 1 of the 12 Talairach regions
        topY - highest y output value in this 1 of the 12 Talairach regions
        topZ - highest z output value in this 1 of the 12 Talairach regions