Class ViewJFrameBase
- All Implemented Interfaces:
ViewImageUpdateInterface,ActionListener,ComponentListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,ChangeListener,RootPaneContainer,WindowConstants
- Direct Known Subclasses:
DialogDTIColorDisplay,DTIColorDisplay,ViewJFrameAnimate,ViewJFrameAnimateClip,ViewJFrameColocalizationEM,ViewJFrameColocalizationRegression,ViewJFrameHistoLUT,ViewJFrameHistoRGB,ViewJFrameImage,ViewJFrameLightBox,ViewJFramePaintVasculature,ViewJFramePlotterView,ViewJFrameRegistration,ViewJFrameRegistrationTool,ViewJFrameRenderCamera,ViewJFrameTriImage,ViewJFrameVolumeView
- Version:
- 0.1 Oct 1, 1998
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JButtonprotected JPanelprotected JLabelLabels for the current absolute position:.protected JLabel[]Labels for the current absolute position values:.protected JPanelJPanel containing the absoulte position labels:.protected JLabelvoxel absolute goto components*protected JTextFieldprotected JLabelvoxel absolute goto components*protected JTextFieldprotected JLabelvoxel absolute goto components*protected JTextFieldprotected floatIndicates the amount of blending when two images are loaded in the image frame.private intBlue channel value of the paint color.protected ModelLUTReference to LUT for image A and to the default LUT for image A.protected ModelLUTReference to LUT for image B and to the default LUT for image B.protected intIndicates which image is to be acted upon when two images are displayed.private booleanTells whether the ViewMenuBuilder should allow Close Image(B) after loading image B.private intGreen channel value of the paint color.static final intDisplay mode image A.static final intDisplay mode image A and B.static final intDisplay mode image B.protected ModelImageReference to the image A of this frame.protected ModelImageReference to the image B of this frame.protected booleanWhether the frame's close() method is being called.private intSave if last state was iconified or normal.protected booleanVariable indicating if images of like dimensions should be scrolled simult.protected ViewJFrameImageHolds a reference (link) to another frame so that it be updated with this frame.protected ViewJFrameTriImageHolds a reference (link) to another frame so that it can be updated with this frame.protected ModelLUTReference to LUT for image A and to the default LUT for image A.protected ModelLUTReference to LUT for image B and to the default LUT for image B.private booleanprivate floatOpacity value of the paint color.private BitSetReference to the BitSet map used in painting the image.protected ViewJProgressBarReference to progress bar.private intRed channel value of the paint color.protected JLabelscanner lps goto components*protected JTextFieldprotected JButtonprotected JPanelprotected JLabelscanner lps goto components*protected JTextFieldprotected JLabelscanner lps goto components*protected JTextFieldprotected JLabelLabels for the current scanner position:.protected JLabel[]Labels for the current scanner position values:.protected JPanelJPanel containing the scanner position labels:.protected JLabelscanner ras goto components*protected JTextFieldprotected JButtonprotected JPanelprotected JLabelscanner ras goto components*protected JTextFieldprotected JLabelscanner ras goto components*protected JTextFieldprotected JLabelLabels for the current scanner position:.protected JLabel[]Labels for the current scanner position values:.protected JPanelJPanel containing the scanner position labels:.protected JTabbedPaneThe tabbed pane to hold teh LPS, RAS and absolution coordinate panels.private static final longUse serialVersionUID for interoperability.protected JTabbedPaneThe main tabbed pane in the volume view frame.protected JButtonprotected JPanelprotected JLabeltalairach goto components*protected JTextFieldprotected JLabeltalairach goto components*protected JTextFieldprotected JLabeltalairach goto components*protected JTextFieldprotected ViewUserInterfaceReference to the user interface.private StringDOCUMENT ME!protected intDOCUMENT ME!Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields 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_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionViewJFrameBase(ModelImage _imageA, ModelImage _imageB) Makes an image frame. -
Method Summary
Modifier and TypeMethodDescriptionvoidabout(int zSlice, int tSlice) Makes an aboutDialog box that displays information about the image slice.abstract voidactionPerformed(ActionEvent event) Method to handle action events generated by the main UI when the current frame is selected.voidThe label panel of the x, y, z slider position.booleanReturns whether or not the close image B option should appear after loading.voidclose()Closes both image A and image B (if it exists).voidclose(boolean closeAll) Closes both image A and image B (if it exists).voidRemoves image B from the frame and resets image A to be the active frame for all image controls.voidcomponentHidden(ComponentEvent event) Does nothing.voidcomponentMoved(ComponentEvent event) Does nothing.voidcomponentResized(ComponentEvent event) Does nothing.voidcomponentShown(ComponentEvent event) Does nothing.protected voidfinalize()Cleans memory.private FileFilterfindFilter(JFileChooser chooser, int filterType) Finds the FileFilter that matches the file type.floatReturns a default alphaBlend value for blending of two images.abstract ViewControlsImageGets the control widgets for the frame.Accessor that returns the default LUTa for the frame.Accessor that returns the default LUTb for the frame.intAccessor that returns displayMode.abstract ModelImageAccessor that returns the imageA.abstract ModelImageAccessor that returns the imageB.Accessor that returns the title of image A.Accessor that returns the title of image B.intgetLastState.getLUTa()Accessor that returns LUTa.getLUTb()Accessor that returns LUTb.getRGBTA()Get the RGB table for image A.getRGBTB()Get the RGB table for image B.Get the ViewJFrameTriImage reference.Accessor that returns the user interface.static voidhandleMaskPopupMenu(Component component, MouseEvent event) Handles the popup menu for the Quick Mask buttonsprotected voidhandlePaintToMaskPopupMenu(Component component, MouseEvent event) Handles the pop-up menu for Paint to Mask buttons (inside/outside)protected voidhandleZoomPopupMenu(Component component, 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 ModelLUTinitLUT(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[]DOCUMENT ME!static ModelRGBinitRGB(ModelImage img) Creates and initializes the ModelRGB for an image.protected static int[]Get the initial time and volume slice positions.protected static int[]initUnits(ModelImage img) DOCUMENT ME!protected static floatinitZoom(ModelImage img, float xResFactor, float yResFactor, int screenX, int screenY) Initializes the zoom variables for an image.private booleanisImageResampleable(ModelImage image) Returns whether an image can be resampled to match imageA for loading into the imageB slot of the frame.private booleanisResampleNeeded(ModelImage image) Returns whether a image should be resampled to match the extents and resolutions of imageA.voidloadAllVOIs(boolean quietMode) This method loads all VOIs to the active image from the default VOI directory for that image.voidloadAllVOIsFrom(String voiDir, boolean quietMode) This method loads all VOIs to the active image from a given directory.booleanloadImage(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.voidloadLUT(boolean loadAll, boolean quietMode) This method loads the LUT for the active image.voidloadLUTandTransferFunctionFrom(boolean loadAll, String filename, String dirName, boolean quietMode) This method loads the LUT for the active image.static voidloadLUTandTransferFunctionFrom(ModelImage image, ModelStorageBase lut, boolean loadAll, String filename, String dirName, boolean quietMode) Reads the input LUT (ModelLUT or ModelRGB) from file.private voidloadResampledImage(ModelImage image) Resamples an image and loads it into the imageB slot.protected StringmakeString(float number, int decPts) Makes a string of a float with a specific number of decimal points.private voidmatchImages(ModelImage imageA, ModelImage imageB, boolean doOrigins, boolean doOrients, double defaultValue, double defaultRed, double defaultGreen, double defaultBlue) booleanbooleanopenVOI(boolean quietMode, boolean doLabels) This method opens an existing VOI.VOI[]openVOI(ModelImage image, boolean quietMode) This method opens an existing VOI.Brings up a FileChooser to pick a file.abstract voidRemoves the menu and controls of the main frame so that a new frame can load the main frame with the proper controls.private booleanreorderAfni(ModelImage image, int[] axisA, int[] axisB) Reorders the AFNI image based on the axis orientations.voidsave(FileWriteOptions options, int filterType) Creates save dialog so that the image can be saved // This should be moved to imageModel.save();voidsave(ModelImage img, FileWriteOptions options, int filterType) Creates save dialog so that the image can be saved // This should be moved to imageModel.save();voidsave(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();voidThis method saves all VOIs for the active image to the default VOI directory for that image.voidsaveAllVOIsTo(String voiDir) This method saves all VOIs for the active image to a given directory.voidsaveLabels(boolean saveAll) DOCUMENT ME!voidsaveLUT(boolean saveAll) This method saves the LUT for the active image.static voidsaveLUTandTransferFunction(ModelImage image, ModelLUT lut, String filename, String dirName) Saves the ModelLUT and transfer function.voidsaveLUTandTransferFunction(String filename, String dirName) This method saves the LUT for the active image.voidThis method saves the LUT for the active image.static voidsaveLUTAs(ModelImage image, ModelStorageBase lut, boolean saveAll) Saves the LUT associated with the input image (either a ModelLUT or ModelRGB).voidsaveVOI(boolean saveAllContours) This method saves a selected VOI - should this be in VOI structure ??!!!DOCUMENT ME!voidsaveVOIAs(boolean saveAllContours) This method allows the user to choose how to save the VOI.voidSave intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex.voidsaveVOIIntensitiesTo(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 voidsetAbsPositionLabels(WildMagic.LibFoundation.Mathematics.Vector3f position) Sets the Absolute position label.abstract voidsetActiveImage(int active) Sets the active image (image that should be processed for drawing VOIs and applying algorithms.abstract voidsetAlphaBlend(int value) Sets the alpha blending parameter for two image display.abstract voidSets the menu and controls (i.e. toolbars) of the main frame!voidsetEnableCloseImageBAfterLoad(boolean enable) Sets whether the close image B option should appear after loading.abstract voidsetEnabled(boolean flag) Controls whether or not the images/VOIs of the frame can be modified.voidsetImageA(ModelImage image) Accessor that sets the imageA.abstract voidsetImageB(ModelImage imageB) Accessor that sets the imageB.private intsetImageBAfni(ModelImage imageA, ModelImage image) Sets image B to an AFNI image, performing the appropriate transformations.voidsetLastState(int state) setLastState.voidsetLinkedFrame(ViewJFrameImage linkFrame) Accessor that sets the link Frame.voidsetLinkedTriFrame(ViewJFrameTriImage linkTriFrame) Accessor that sets the link Frame.voidAccessor that sets LUTa.voidAccessor that sets LUTb.voidSets LUTa and LUTb.final voidsetMessageText(String str) Accessor to set the text of the main frame's text field.voidsetOpacityInfo(float _OPACITY, float _alphaBlend) Sets RGB Information.voidsetpaintBitmap(BitSet _paintBitmap) Sets the paint Bitmap.abstract voidsetPaintBitmapSwitch(boolean flag) If true do not getMask on a setActiveImage command so as to keep the mask from the old active image.abstract voidSet the RGB table for image A.abstract voidSet the RGB table for image B.protected voidsetScannerPosition(WildMagic.LibFoundation.Mathematics.Vector3f position) Sets the Scanner position label.abstract voidsetTitle()Sets the Title bar of the frame.voidstateChanged(ChangeEvent event) Does nothing.private voidtransformACPC(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 voidtransformAFNI(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 voidtransformTalairach(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 booleanThe extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.voidwindowActivated(WindowEvent event) Tells the UI that this frame is the currently active one.voidwindowClosed(WindowEvent event) Does nothing.voidwindowClosing(WindowEvent event) Cleans up the frame before closing.voidwindowDeactivated(WindowEvent event) Does nothing.voidwindowDeiconified(WindowEvent event) Does nothing.voidwindowIconified(WindowEvent event) Does nothing.voidwindowOpened(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, updateMethods 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, setUndecoratedMethods 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, toFrontMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEventMethods inherited from interface gov.nih.mipav.view.ViewImageUpdateInterface
setSlice, setTimeSlice, updateImages, updateImages, updateImages
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
IMAGE_A
public static final int IMAGE_ADisplay mode image A.- See Also:
-
IMAGE_B
public static final int IMAGE_BDisplay mode image B.- See Also:
-
IMAGE_A_B
public static final int IMAGE_A_BDisplay mode image A and B.- See Also:
-
zoomMode
protected int zoomModeDOCUMENT ME! -
absoluteLabel
Labels for the current absolute position:. -
absoluteLabelVals
Labels for the current absolute position values:. -
absolutePanel
JPanel containing the absoulte position labels:. -
alphaBlend
protected float alphaBlendIndicates the amount of blending when two images are loaded in the image frame. -
displayMode
protected int displayModeIndicates which image is to be acted upon when two images are displayed. -
imageA
Reference to the image A of this frame. -
imageB
Reference to the image B of this frame. -
linkFrame
Holds a reference (link) to another frame so that it be updated with this frame. -
linkTriFrame
Holds a reference (link) to another frame so that it can be updated with this frame. -
defaultLUTa
Reference to LUT for image A and to the default LUT for image A. -
LUTa
Reference to LUT for image A and to the default LUT for image A. -
defaultLUTb
Reference to LUT for image B and to the default LUT for image B. -
LUTb
Reference to LUT for image B and to the default LUT for image B. -
progressBar
Reference to progress bar. -
scannerLPSLabel
Labels for the current scanner position:. -
scannerRASLabel
Labels for the current scanner position:. -
scannerLPSLabelVals
Labels for the current scanner position values:. -
scannerRASLabelVals
Labels for the current scanner position values:. -
scannerLPSPanel
JPanel containing the scanner position labels:. -
scannerRASPanel
JPanel containing the scanner position labels:. -
tabbedPane
The main tabbed pane in the volume view frame. -
scannerTabbedPane
The tabbed pane to hold teh LPS, RAS and absolution coordinate panels. -
userInterface
Reference to the user interface. -
isClosing
protected boolean isClosingWhether the frame's close() method is being called. -
blue
private int blueBlue channel value of the paint color. -
enableCloseImageB
private boolean enableCloseImageBTells whether the ViewMenuBuilder should allow Close Image(B) after loading image B. -
newFrameCreated
private boolean newFrameCreated -
green
private int greenGreen channel value of the paint color. -
lastState
private int lastStateSave if last state was iconified or normal. -
opacity
private float opacityOpacity value of the paint color. -
paintBitmap
Reference to the BitSet map used in painting the image. -
red
private int redRed channel value of the paint color. -
voiSavedFileName
DOCUMENT ME! -
linkedScrolling
protected boolean linkedScrollingVariable indicating if images of like dimensions should be scrolled simult. -
absoluteXLabel
voxel absolute goto components* -
absoluteYLabel
voxel absolute goto components* -
absoluteZLabel
voxel absolute goto components* -
absoluteXTextField
-
absoluteYTextField
-
absoluteZTextField
-
absoluteGoToButton
-
absoluteGoToPanel
-
scannerLPS_RLLabel
scanner lps goto components* -
scannerLPS_APLabel
scanner lps goto components* -
scannerLPS_ISLabel
scanner lps goto components* -
scannerLPS_RLTextField
-
scannerLPS_APTextField
-
scannerLPS_ISTextField
-
scannerLPS_GoToButton
-
scannerLPS_GoToPanel
-
scannerRAS_RLLabel
scanner ras goto components* -
scannerRAS_APLabel
scanner ras goto components* -
scannerRAS_ISLabel
scanner ras goto components* -
scannerRAS_RLTextField
-
scannerRAS_APTextField
-
scannerRAS_ISTextField
-
scannerRAS_GoToButton
-
scannerRAS_GoToPanel
-
talXLabel
talairach goto components* -
talYLabel
talairach goto components* -
talZLabel
talairach goto components* -
talXTextField
-
talYTextField
-
talZTextField
-
talGoToButton
-
talGoToPanel
-
-
Constructor Details
-
ViewJFrameBase
Makes an image frame.- Parameters:
_imageA- model image A_imageB- model image B
-
-
Method Details
-
actionPerformed
Method to handle action events generated by the main UI when the current frame is selected. Implemented by specific frame classes.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
event- the event from the UI
-
getControls
Gets the control widgets for the frame.- Returns:
- the frame's image controls
-
getImageA
Accessor that returns the imageA.- Returns:
- imageA
-
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:
setEnabledin classComponent- Parameters:
flag- if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
-
setImageB
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
Set the RGB table for image A.- Parameters:
RGBT- the RGB table to use for image A
-
setRGBTB
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:
updateImageExtentsin interfaceViewImageUpdateInterface- Returns:
- true if the update was successful, false otherwise
- See Also:
-
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 slicetSlice- 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
Does nothing.- Specified by:
componentHiddenin interfaceComponentListener- Parameters:
event- the component event
-
componentMoved
Does nothing.- Specified by:
componentMovedin interfaceComponentListener- Parameters:
event- the component event
-
componentResized
Does nothing.- Specified by:
componentResizedin interfaceComponentListener- Parameters:
event- the component event
-
componentShown
Does nothing.- Specified by:
componentShownin interfaceComponentListener- 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
Accessor that returns the title of image A.- Returns:
- frame title for Image A
-
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
Accessor that returns LUTa.- Returns:
- LUTa
-
getLUTb
Accessor that returns LUTb.- Returns:
- LUTb
-
getDefaultLUTa
Accessor that returns the default LUTa for the frame.- Returns:
- defaultLUTa
-
getDefaultLUTb
Accessor that returns the default LUTb for the frame.- Returns:
- defaultLUTb
-
getRGBTA
Get the RGB table for image A.- Returns:
- null (may be overridden by inheriting classes)
-
getRGBTB
Get the RGB table for image B.- Returns:
- null (may be overridden by inheriting classes)
-
getTriImg
Get the ViewJFrameTriImage reference.- Returns:
- linkTriFrame ViewJFrameTriImage.
-
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
This method loads all VOIs to the active image from a given directory.- Parameters:
voiDir- the directory to load voi's fromquietMode- if true indicates that warnings should not be displayed.
-
loadImage
public boolean loadImage(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 filedoOrigins- 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:
-
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, String filename, 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 asdirName- directory to save LUT toquietMode- if true indicates that warnings should not be displayed.
-
loadLUTandTransferFunctionFrom
public static void loadLUTandTransferFunctionFrom(ModelImage image, ModelStorageBase lut, boolean loadAll, String filename, 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
This method opens an existing VOI.- Parameters:
image- image where VOI(s) are to registeredquietMode- if true indicates that warnings should not be displayed.- Returns:
- the VOI(s)
-
pickImageFile
Brings up a FileChooser to pick a file.- Returns:
- File the File the chooser picks.
-
save
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
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
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 >= 0operateQuiet- 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
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
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 asdirName- directory to save LUT to
-
saveLUTAs
Saves the LUT associated with the input image (either a ModelLUT or ModelRGB).- Parameters:
image-lut-saveAll-
-
saveLUTandTransferFunction
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 asdirName- directory to save LUT to
-
saveLUTandTransferFunction
public static void saveLUTandTransferFunction(ModelImage image, ModelLUT lut, String filename, 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
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
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
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
Accessor that sets the link Frame.- Parameters:
linkFrame- set frame to link to.
-
setLinkedTriFrame
Accessor that sets the link Frame.- Parameters:
linkTriFrame- set frame to link to.
-
setLUTa
Accessor that sets LUTa.- Parameters:
lut- DOCUMENT ME!
-
setLUTb
Accessor that sets LUTb.- Parameters:
lut- DOCUMENT ME!
-
setLUTs
Sets LUTa and LUTb.- Parameters:
_LUTa- DOCUMENT ME!_LUTb- DOCUMENT ME!
-
setMessageText
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
Sets the paint Bitmap.- Parameters:
_paintBitmap- DOCUMENT ME!
-
stateChanged
Does nothing.- Specified by:
stateChangedin interfaceChangeListener- Parameters:
event- the change event
-
windowActivated
Tells the UI that this frame is the currently active one.- Specified by:
windowActivatedin interfaceWindowListener- Parameters:
event- the window event
-
windowClosed
Does nothing.- Specified by:
windowClosedin interfaceWindowListener- Parameters:
event- the window event
-
windowClosing
Cleans up the frame before closing.- Specified by:
windowClosingin interfaceWindowListener- Parameters:
event- the window event that triggered this method
-
windowDeactivated
Does nothing.- Specified by:
windowDeactivatedin interfaceWindowListener- Parameters:
event- the window event
-
windowDeiconified
Does nothing.- Specified by:
windowDeiconifiedin interfaceWindowListener- Parameters:
event- the window event
-
windowIconified
Does nothing.- Specified by:
windowIconifiedin interfaceWindowListener- Parameters:
event- the window event
-
windowOpened
Does nothing.- Specified by:
windowOpenedin interfaceWindowListener- Parameters:
event- the window event
-
finalize
Cleans memory. -
makeString
Makes a string of a float with a specific number of decimal points.- Parameters:
number- number to be converted to a stringdecPts- 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
DOCUMENT ME!- Parameters:
component- DOCUMENT ME!event- DOCUMENT ME!
-
handleMaskPopupMenu
Handles the popup menu for the Quick Mask buttons- Parameters:
component- DOCUMENT ME!event- DOCUMENT ME!
-
handlePaintToMaskPopupMenu
Handles the pop-up menu for Paint to Mask buttons (inside/outside)- Parameters:
component- DOCUMENT ME!event- DOCUMENT ME!
-
initExtents
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 imageisColor- whether the image is in color- Returns:
- a buffer which is big enough to contain the image intensity data
-
initNumSlices
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 resolutionimgUnits- the image units of measure- Returns:
- the resolution correction factor in the x (the first element) and y (the second element) dimensions
-
initResolutions
DOCUMENT ME!- Parameters:
img- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
initSlicePositions
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
DOCUMENT ME!- Parameters:
img- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
initLUT
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:
OutOfMemoryError- if enough memory cannot be allocated for this method
-
initRGB
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:
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 zoomxResFactor- correction factor in the x direction for images that are do not have isotropic voxelsyResFactor- 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
Finds the FileFilter that matches the file type.- Parameters:
chooser- JFileChooserfilterType- int the file filter type- Returns:
- FileFilter the filter that matches the filter type.
-
isImageResampleable
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
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
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
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 imageaxisB- axis indices orientation of original image- Returns:
- true if the reordering of the Afni file is successful, false otherwise
-
setImageBAfni
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 createdimgBuffer- source image arrayxfrm- transformation matrix to be appliediXres- input x resolutioniYres- input y resolutioniZres- input z resolutioniXdim- input x dimesnioniYdim- input y dimensioniZdim- input z dimensioniTdim- input t dimensionplaneGap- -1 if no zero filled gaps, 0 for x axis gaps, 1 for y axis, 2 for z axisgapArray- array of coordinates at which the zero filled planes occurdoNN- true if functional, false if anatomicaloXres- output x resolutionoYres- output y resolutionoZres- output z resolutionoXdim- output x dimensionoYdim- output y dimensionoZdim- 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 createdimgBuffer- source image arrayiXres- input x resolutioniYres- input y resolutioniZres- input z resolutioniXdim- input x dimesnioniYdim- input y dimensioniZdim- input z dimensioniTdim- input t dimensionilowXmm- lowest valid input x location in space in millimetersilowYmm- lowest valid input y location in space in millimetersilowZmm- lowest valid input z location in space in millimetersihighXmm- highest valid input x location in space in millimetersihighYmm- highest valid input y location in space in millimetersihighZmm- highest valid input z location in space in millimetersplaneGap- -1 if no zero filled gaps, 0 for x axis gaps, 1 for y axis, 2 for z axisgapArray- array of coordinates at which the zero filled planes occurdoNN- true if functional, false if anatomicaloXres- output x resolutionoYres- output y resolutionoZres- output z resolutionoXdim- output x dimensionoYdim- output y dimensionoZdim- output z dimensionolowXmm- lowest valid output x location in space in millimetersolowYmm- lowest valid output y location in space in millimetersolowZmm- lowest valid output z location in space in millimetersohighXmm- highest valid output x location in space in millimetersohighYmm- highest valid output y location in space in millimetersohighZmm- 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 createdimgBuffer- source image arrayxfrm- transformation matrix to be appliediXres- input x resolutioniYres- input y resolutioniZres- input z resolutioniXdim- input x dimesnioniYdim- input y dimensioniZdim- input z dimensioniTdim- input t dimensionplaneGap- -1 if no zero filled gaps, 0 for x axis gaps, 1 for y axis, 2 for z axisgapArray- array of coordinates at which the zero filled planes occurdoNN- true if functional, false if anatomicaloXres- output x resolutionoYres- output y resolutionoZres- output z resolutionoXdim- output x dimensionoYdim- output y dimensionoZdim- output z dimensionbotX- lowest x output value in this 1 of the 12 Talairach regionsbotY- lowest y output value in this 1 of the 12 Talairach regionsbotZ- lowest z output value in this 1 of the 12 Talairach regionstopX- highest x output value in this 1 of the 12 Talairach regionstopY- highest y output value in this 1 of the 12 Talairach regionstopZ- highest z output value in this 1 of the 12 Talairach regions
-