Class JDialogScriptableTransform

All Implemented Interfaces:
AlgorithmInterface, ScriptableActionInterface, DialogDefaultsInterface, ActionDiscovery, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class JDialogScriptableTransform extends JDialogScriptableBase implements AlgorithmInterface, ChangeListener, ActionDiscovery
Dialog to get user input, then call algorithmTransform. User may select resample or transform. User may input matrix or use image's associated transformation matrix. User may input desired resolutions and dims. User may select interpolation method. Creates new volume. You can choose either of 2 goals in bilinear or trilinear interpolation, but you cannot choose both. You can choose to: 1.) Match the start row, column, and slice in the original image with the start row, column, and slice in the transformed image with no duplication of start values and match the end row, column, and slice in the original image with the end row column, and slice in the transformed image with no duplication of end values with a smooth interpolation occurring between the beginning and end. For a smooth bilinear or trilinear interpolation you must map from 0 to n1t - 1 in the transformed image to 0 to n1 - 1 in the original image. Mapping from n1t - 1 to n1t in the transformed image to n1 - 1 to n1 in the source image would lead to multiple identical transformed copies for source image values between n1 - 1 and n1 - 0.5 and identical or out of bounds transformed values for source values from n1 - 0.5 to n1. This necessitates using equations of the form (dim - 1) * res = (transformedDim - 1) * transformedRes. Since the field of view = dim * res, this does not preserve field of view. If a user wishes to reslice an image and have the beginning and end slices match without duplication, then this would be the method to select 2.) If a user simply wishes to magnify the field of view and is not worried about duplicate beginning and end values, then preserve the field of view = dim * res = transformedDim * transformedRes. If the interpolation is not bilinear or trilinear, then the purpose of interpolation is always to preserve the FOV. For either interpolation purpose, note that if the user selects the new dimension, then the floating point resolution can be perfectly adjusted, but if the user selects the new resolution, since dimensions are integers, the new dimension value may not be perfectly adjusted.
Version:
0.1 Nov. 19, 1999
Author:
Delia McGarry, Neva Cherniavsky, Zohara Cohen
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • ORIG_TO_ACPC

      private static final int ORIG_TO_ACPC
      DOCUMENT ME!
      See Also:
    • ORIG_TO_TLRC

      private static final int ORIG_TO_TLRC
      DOCUMENT ME!
      See Also:
    • ACPC_TO_TLRC

      private static final int ACPC_TO_TLRC
      DOCUMENT ME!
      See Also:
    • TLRC_TO_ACPC

      private static final int TLRC_TO_ACPC
      DOCUMENT ME!
      See Also:
    • TLRC_TO_ORIG

      private static final int TLRC_TO_ORIG
      DOCUMENT ME!
      See Also:
    • ACPC_TO_ORIG

      private static final int ACPC_TO_ORIG
      DOCUMENT ME!
      See Also:
    • algoTal

      private AlgorithmTalairachTransform algoTal
      DOCUMENT ME!
    • algoTrans

      private AlgorithmTransform algoTrans
      or if the source image is to be replaced.
    • clipCheckbox

      private JCheckBox clipCheckbox
      DOCUMENT ME!
    • voiCheckbox

      private JCheckBox voiCheckbox
      DOCUMENT ME!
    • image25DCheckbox

      private JCheckBox image25DCheckbox
      DOCUMENT ME!
    • updateOriginCheckbox

      private JCheckBox updateOriginCheckbox
      DOCUMENT ME!
    • invertCheckbox

      private JCheckBox invertCheckbox
      DOCUMENT ME!
    • comboBoxImage

      private JComboBox comboBoxImage
      DOCUMENT ME!
    • comboBoxInterp

      private JComboBox comboBoxInterp
      DOCUMENT ME!
    • comboBoxTalTransform

      private JComboBox comboBoxTalTransform
      DOCUMENT ME!
    • computeTImage

      private JRadioButton computeTImage
      DOCUMENT ME!
    • do25D

      private boolean do25D
      DOCUMENT ME!
    • doRotateCenter

      private boolean doRotateCenter
      DOCUMENT ME!
    • doTalairach

      private boolean doTalairach
      DOCUMENT ME!
    • doVOI

      private boolean doVOI
      DOCUMENT ME!
    • doClip

      private boolean doClip
      DOCUMENT ME!
    • doPad

      private boolean doPad
      DOCUMENT ME!
    • preserveFOV

      private boolean preserveFOV
      DOCUMENT ME!
    • doUpdateOrigin

      private boolean doUpdateOrigin
      DOCUMENT ME!
    • doInvMat

      private boolean doInvMat
      DOCUMENT ME!
    • fileTransMatrix

      private TransMatrix fileTransMatrix
      Stores the matrix read in from a file it then can be converted to the corrected axis orientation (i.e. world coordinate and/or left-hand coordinate systems).
    • image

      private ModelImage image
      source image
    • interp

      private int interp
      Interpolation method
    • fillValue

      private float fillValue
    • labelOrigin

      private JLabel labelOrigin
    • labelResX

      private JLabel labelResX
      DOCUMENT ME!
    • labelResY

      private JLabel labelResY
      DOCUMENT ME!
    • labelResZ

      private JLabel labelResZ
      DOCUMENT ME!
    • labelDimX

      private JLabel labelDimX
      DOCUMENT ME!
    • labelDimY

      private JLabel labelDimY
      DOCUMENT ME!
    • labelDimZ

      private JLabel labelDimZ
      DOCUMENT ME!
    • labelTransformResX

      private JLabel labelTransformResX
    • labelTransformResY

      private JLabel labelTransformResY
    • labelTransformResZ

      private JLabel labelTransformResZ
    • labelTransformDimX

      private JLabel labelTransformDimX
    • labelTransformDimY

      private JLabel labelTransformDimY
    • labelTransformDimZ

      private JLabel labelTransformDimZ
    • textTransformResX

      private JTextField textTransformResX
    • textTransformResY

      private JTextField textTransformResY
    • textTransformResZ

      private JTextField textTransformResZ
    • textTransformDimX

      private JTextField textTransformDimX
    • textTransformDimY

      private JTextField textTransformDimY
    • textTransformDimZ

      private JTextField textTransformDimZ
    • resTransformGroup

      private ButtonGroup resTransformGroup
    • resampleMatrixSourceButton

      private JRadioButton resampleMatrixSourceButton
    • resampleMatrixTargetButton

      private JRadioButton resampleMatrixTargetButton
    • labelTx

      private JLabel labelTx
      DOCUMENT ME!
    • labelTy

      private JLabel labelTy
      DOCUMENT ME!
    • labelTz

      private JLabel labelTz
      DOCUMENT ME!
    • labelRx

      private JLabel labelRx
      DOCUMENT ME!
    • labelRy

      private JLabel labelRy
      DOCUMENT ME!
    • labelRz

      private JLabel labelRz
      DOCUMENT ME!
    • labelSx

      private JLabel labelSx
      DOCUMENT ME!
    • labelSy

      private JLabel labelSy
      DOCUMENT ME!
    • labelSz

      private JLabel labelSz
      DOCUMENT ME!
    • labelSKx

      private JLabel labelSKx
      DOCUMENT ME!
    • labelSKy

      private JLabel labelSKy
      DOCUMENT ME!
    • labelSKz

      private JLabel labelSKz
      DOCUMENT ME!
    • leftHandSystem

      private boolean leftHandSystem
      If true change matrix to the left-hand coordinate system.
    • magSlider

      private JSlider magSlider
      DOCUMENT ME!
    • matrixDeterminationGroup

      private ButtonGroup matrixDeterminationGroup
      DOCUMENT ME!
    • rotationAxisGroup

      private ButtonGroup rotationAxisGroup
      DOCUMENT ME!
    • cropOrPad

      private ButtonGroup cropOrPad
      DOCUMENT ME!
    • matrixFile

      private String matrixFile
      DOCUMENT ME!
    • matrixDirectory

      private String matrixDirectory
    • matrixFName

      private JTextField matrixFName
      DOCUMENT ME!
    • max

      private int max
      DOCUMENT ME!
    • min

      private int min
      DOCUMENT ME!
    • maximum

      private JLabel maximum
      DOCUMENT ME!
    • minimum

      private JLabel minimum
      DOCUMENT ME!
    • current

      private JLabel current
      DOCUMENT ME!
    • oXdim

      private int oXdim
      DOCUMENT ME!
    • oYdim

      private int oYdim
      DOCUMENT ME!
    • oZdim

      private int oZdim
      DOCUMENT ME!
    • cXdim

      private int cXdim
      DOCUMENT ME!
    • cYdim

      private int cYdim
      DOCUMENT ME!
    • cZdim

      private int cZdim
      DOCUMENT ME!
    • oXres

      private float oXres
      DOCUMENT ME!
    • oYres

      private float oYres
      DOCUMENT ME!
    • oZres

      private float oZres
      DOCUMENT ME!
    • cXres

      private float cXres
      DOCUMENT ME!
    • cYres

      private float cYres
      DOCUMENT ME!
    • cZres

      private float cZres
      DOCUMENT ME!
    • units

      private int[] units
    • resampleGroup

      private ButtonGroup resampleGroup
      DOCUMENT ME!
    • resampleImage

      private ModelImage resampleImage
      DOCUMENT ME!
    • resampletoUser

      private JRadioButton resampletoUser
      DOCUMENT ME!
    • resampletoImage

      private JRadioButton resampletoImage
      DOCUMENT ME!
    • resampleSlider

      private JRadioButton resampleSlider
      DOCUMENT ME!
    • resampletoMatrixFile

      private JRadioButton resampletoMatrixFile
      DOCUMENT ME!
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • rotCenter

      private JRadioButton rotCenter
      DOCUMENT ME!
    • rotOrigin

      private JRadioButton rotOrigin
      DOCUMENT ME!
    • cropRadio

      private JRadioButton cropRadio
      DOCUMENT ME!
    • padRadio

      private JRadioButton padRadio
      DOCUMENT ME!
    • storedMatrix

      private JRadioButton storedMatrix
      DOCUMENT ME!
    • noTransform

      private JRadioButton noTransform
      DOCUMENT ME!
    • userDefinedMatrix

      private JRadioButton userDefinedMatrix
      DOCUMENT ME!
    • fileMatrix

      private JRadioButton fileMatrix
      DOCUMENT ME!
    • storedMatrixBox

      private JComboBox storedMatrixBox
    • textResX

      private JTextField textResX
      DOCUMENT ME!
    • textResY

      private JTextField textResY
      DOCUMENT ME!
    • textResZ

      private JTextField textResZ
      DOCUMENT ME!
    • textDimX

      private JTextField textDimX
      DOCUMENT ME!
    • textDimY

      private JTextField textDimY
      DOCUMENT ME!
    • textDimZ

      private JTextField textDimZ
      DOCUMENT ME!
    • resampleStatusTextField

      private JTextField resampleStatusTextField
    • transformStatusTextField

      private JTextField transformStatusTextField
    • textTx

      private JTextField textTx
      DOCUMENT ME!
    • textTy

      private JTextField textTy
      DOCUMENT ME!
    • textTz

      private JTextField textTz
      DOCUMENT ME!
    • textRx

      private JTextField textRx
      DOCUMENT ME!
    • textRy

      private JTextField textRy
      DOCUMENT ME!
    • textRz

      private JTextField textRz
      DOCUMENT ME!
    • textSx

      private JTextField textSx
      DOCUMENT ME!
    • textSy

      private JTextField textSy
      DOCUMENT ME!
    • textSz

      private JTextField textSz
      DOCUMENT ME!
    • textSKx

      private JTextField textSKx
      DOCUMENT ME!
    • textSKy

      private JTextField textSKy
      DOCUMENT ME!
    • textSKz

      private JTextField textSKz
      DOCUMENT ME!
    • tInfo

      private TalairachTransformInfo tInfo
      DOCUMENT ME!
    • transformType

      private int transformType
      DOCUMENT ME!
    • tVal

      private String[] tVal
      DOCUMENT ME!
    • userInterface

      private ViewUserInterface userInterface
      DOCUMENT ME!
    • wcSystem

      private boolean wcSystem
      If true change matrix to the world coordinate system.
    • xfrm

      private TransMatrix xfrm
      DOCUMENT ME!
    • xyAspectRatio

      private JCheckBox xyAspectRatio
      DOCUMENT ME!
    • xyzAspectRatio

      private JCheckBox xyzAspectRatio
      DOCUMENT ME!
    • preserveFOVButton

      private JRadioButton preserveFOVButton
    • preserveOutputDimsButton

      private JRadioButton preserveOutputDimsButton
    • outputDimsGroup

      private ButtonGroup outputDimsGroup
    • preserveFOV2Button

      private JRadioButton preserveFOV2Button
    • separateDimResButton

      private JRadioButton separateDimResButton
    • resDimGroup

      private ButtonGroup resDimGroup
    • useSACenterBox

      private JCheckBox useSACenterBox
      checkbox telling the algorithm to use the scanner coordinate center rather than the image center
    • useSACenter

      private boolean useSACenter
    • tabbedPane

      private JTabbedPane tabbedPane
      Tabbed pane
    • isSATransform

      private boolean isSATransform
      is this a scanner anatomical transform (->AXIAL)
    • enableSATransform

      private boolean enableSATransform
    • constantFOV

      private int constantFOV
      We use the constant to preserve the FOV. Either 1 or 0;
    • interpFOVgroup

      private ButtonGroup interpFOVgroup
      Button group for interpolation type, contant FOV or start, end matching.
    • constantFOVradio

      private JRadioButton constantFOVradio
      Radio button for constant FOV interpolation.
    • endMatchFOVradio

      private JRadioButton endMatchFOVradio
      Radio button for slice start invalid input: '&' end matching interpolation.
    • dims

      private float[] dims
    • resols

      private float[] resols
    • outOfBoundsLabel

      private JLabel outOfBoundsLabel
    • outOfBoundsComboBox

      private JComboBox outOfBoundsComboBox
    • valueLabel

      private JLabel valueLabel
    • valueText

      private JTextField valueText
    • imageMin

      private double imageMin
    • imageMax

      private double imageMax
    • dataType

      private int dataType
    • resamplePanel

      private JPanel resamplePanel
    • outOfBoundsIndex

      private int outOfBoundsIndex
      Tells how to select fill value for out of bounds data 0 for image minimum 1 for NaN for float, zero otherwise. 2 for user defined 3 for image maximum
    • spline

      private AlgorithmTPSpline spline
    • fileInterp

      private int[] fileInterp
    • sourceXres

      private float[] sourceXres
    • sourceYres

      private float[] sourceYres
    • sourceZres

      private float[] sourceZres
    • targetXres

      private float[] targetXres
    • targetYres

      private float[] targetYres
    • targetZres

      private float[] targetZres
    • sourceXdim

      private int[] sourceXdim
    • sourceYdim

      private int[] sourceYdim
    • sourceZdim

      private int[] sourceZdim
    • targetXdim

      private int[] targetXdim
    • targetYdim

      private int[] targetYdim
    • targetZdim

      private int[] targetZdim
    • filetVOI

      private boolean[] filetVOI
    • fileClip

      private boolean[] fileClip
    • filePad

      private boolean[] filePad
    • quiet

      private boolean quiet
    • RESAMPLE_STATUS_DEFAULT_TEXT

      private String RESAMPLE_STATUS_DEFAULT_TEXT
    • TRANSFORM_STATUS_DEFAULT_TEXT

      private String TRANSFORM_STATUS_DEFAULT_TEXT
    • prevSelectedTransformRadioButton

      private JRadioButton prevSelectedTransformRadioButton
  • Constructor Details

    • JDialogScriptableTransform

      public JDialogScriptableTransform()
      Empty constructor needed for dynamic instantiation (used during scripting).
    • JDialogScriptableTransform

      public JDialogScriptableTransform(Frame theParentFrame, ModelImage im)
      Constructs new transform dialog and sets up GUI components.
      Parameters:
      theParentFrame - Parent frame.
      im - Source image.
    • JDialogScriptableTransform

      public JDialogScriptableTransform(Frame theParentFrame, ModelImage im, boolean doInit)
      Constructs new transform dialog and sets up GUI components.
      Parameters:
      theParentFrame - Parent frame.
      im - Source image.
  • Method Details

    • setQuiet

      public void setQuiet(boolean quiet)
      Parameters:
      quiet -
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Closes dialog box when the OK button is pressed, sets the variables, and calls the algorithm.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - Event that triggers function.
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithms when it has completed or failed to to complete, so that the dialog can be display the result image and/or clean up.
      Specified by:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algorithm - Algorithm that caused the event.
    • finalize

      public void finalize()
      Overrides:
      finalize in class Object
    • focusLost

      public void focusLost(FocusEvent event)
      When the user clicks the mouse out of a text field, resets the necessary variables.
      Specified by:
      focusLost in interface FocusListener
      Overrides:
      focusLost in class JDialogBase
      Parameters:
      event - event that triggers this function
    • getResultImage

      public ModelImage getResultImage()
      Accessor that returns the image.
      Returns:
      The result image
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Method to handle item events.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      event - event that cause the method to fire
    • matrixFileMenu

      public String matrixFileMenu()
      Allows the user to select matrix file.
      Returns:
      fileName
    • getFileFromName

      File getFileFromName(String fileName)
    • isCorrectTranformMatrixFile

      private boolean isCorrectTranformMatrixFile(String fileName)
    • readTransformMatrixFile

      private TransMatrix readTransformMatrixFile(String fileName, boolean runningFromScript)
      Reads a matrix from a file.
      Parameters:
      fileName - name of the matrix file.
      runningFromScript - if this was invoked from the script runner
    • readTransformMatrixFile

      public TransMatrix readTransformMatrixFile(String fileName)
      Reads a matrix from a file.
      Parameters:
      fileName - name of the matrix file.
    • setPreserveFOV

      public void setPreserveFOV(boolean flag)
      Accessor that sets value for the preserveFOV boolean
      Parameters:
      flag - true indicates that output dim should be set from input dim*res or input (dim-1)*res. flag false indicates that the output dim should be set from the selected image output dim.
    • setClipFlag

      public void setClipFlag(boolean flag)
      Accessor that sets the clip flag.
      Parameters:
      flag - true indicates clip image, false otherwise.
    • setDoInvMat

      public void setDoInvMat(boolean flag)
      Accessor that sets the boolean for invert matrix.
      Parameters:
      flag - true indicates invert matrix, false otherwise.
    • setDimAndResXYZ

      public void setDimAndResXYZ()
      Resets the dimension and resolution fields for resampling panel. Called by focusLost.
    • setDoTalairach

      public void setDoTalairach(boolean doTalairach)
      Accessor that sets the boolean for doing a Talairach type transformation.
      Parameters:
      doTalairach - boolean
    • setImage25D

      public void setImage25D(boolean flag)
      Accessor that sets the slicing flag.
      Parameters:
      flag - true indicates slices should be blurred independently.
    • setInterp

      public void setInterp(int interp)
      Accessor that sets the interpolation method.
      Parameters:
      interp - DOCUMENT ME!
    • setLeftHandSystem

      public void setLeftHandSystem(boolean leftHandSys)
      Sets the left-hand coordinate flag. If true, change matrix to the left-hand coordinate system.
      Overrides:
      setLeftHandSystem in class JDialogBase
      Parameters:
      leftHandSys - DOCUMENT ME!
    • setMatrix

      public void setMatrix(TransMatrix matrix)
      Accessor that sets the transformation matrix.
      Parameters:
      matrix - The transformation matrix.
    • setOutDimensions

      public void setOutDimensions(int[] outDim)
      Accessor to set the output image's dimensions.
      Parameters:
      outDim - Array of the dimensions.
    • setOutResolutions

      public void setOutResolutions(float[] outRes)
      Accessor to set the output image's resolutions.
      Parameters:
      outRes - Array of the resolutions.
    • setPadFlag

      public void setPadFlag(boolean flag)
      Accessor that sets the padding flag.
      Parameters:
      flag - true indicates slices should be blurred independently.
    • setFillValue

      public void setFillValue(float fillValue)
      Accessor that sets the fillValue.
      Parameters:
      fillValue - DOCUMENT ME!
    • setTransformType

      public void setTransformType(int transformType)
      Accessor that sets the type of Talairach transformation.
      Parameters:
      transformType - int
    • setUnits

      public void setUnits(int[] units)
      Accessor that sets the units.
      Parameters:
      units - of image
    • setUpdateOrigin

      public void setUpdateOrigin(boolean flag)
      Accessor that sets the update origin flag.
      Parameters:
      flag - true indicates to update the image origin using the transformation matrix.
    • setVOIFlag

      public void setVOIFlag(boolean flag)
      Accessor that sets the voi flag.
      Parameters:
      flag - true indicates transform VOI, false otherwise.
    • setWCSystem

      public void setWCSystem(boolean wcSys)
      Sets the world coordinate flag. If true, change matrix to the world coordinate system.
      Overrides:
      setWCSystem in class JDialogBase
      Parameters:
      wcSys - DOCUMENT ME!
    • stateChanged

      public void stateChanged(ChangeEvent event)
      Sets values based on knob along slider.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      event - ChangeEvent event that triggered this function
    • setFileXDim

      public void setFileXDim(int xDim)
      Parameters:
      xDim - By setting fileXdim[0] to zero can change path selected in callAlgorithm
    • callAlgorithm

      protected void callAlgorithm()
      Calls the algorithm with the set variables.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • doPostAlgorithmActions

      protected void doPostAlgorithmActions()
      Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table). Defaults to no action, override to actually have it do something.
      Overrides:
      doPostAlgorithmActions in class JDialogScriptableBase
    • setGUIFromParams

      protected void setGUIFromParams()
      Set the dialog GUI using the script parameters while running this algorithm as part of a script.
      Specified by:
      setGUIFromParams in class JDialogScriptableBase
    • storeParamsFromGUI

      protected void storeParamsFromGUI() throws ParserException
      Record the parameters just used to run this algorithm in a script.
      Specified by:
      storeParamsFromGUI in class JDialogScriptableBase
      Throws:
      ParserException - If there is a problem creating/recording the new parameters.
    • buildComboBox

      private void buildComboBox()
      Builds a list of images to register to the template image.
    • buildMatrixPanel

      private JPanel buildMatrixPanel()
      Builds the matrixPanel.
      Returns:
      The matrix panel.
    • buildOptionPanel

      private JPanel buildOptionPanel()
      Builds the OptionPanel.
      Returns:
      DOCUMENT ME!
    • buildResamplePanel

      private JPanel buildResamplePanel()
      Builds the resample panel.
      Returns:
      The resample panel.
    • callTalAlgorithm

      private void callTalAlgorithm()
      DOCUMENT ME!
    • enableDims

      private void enableDims(boolean state)
      DOCUMENT ME!
      Parameters:
      state - DOCUMENT ME!
    • enableResols

      private void enableResols(boolean state)
      DOCUMENT ME!
      Parameters:
      state - DOCUMENT ME!
    • enableYSettings

      private void enableYSettings(boolean state)
      DOCUMENT ME!
      Parameters:
      state - DOCUMENT ME!
    • getAxisOrientation

      private int[] getAxisOrientation(float[][] array)
      Return the 3 axis orientation codes that correspond to the closest standard anatomical orientation of the (i,j,k) axes.
      Parameters:
      array - 4x4 matrix that transforms (i,j,k) indexes to x,y,z coordinates where +x =Left, +y = Posterior, +z = Superior Only the upper-left 3x3 corner of the matrix is used This routine finds the permutation of (x,y,z) which has the smallest angle to the (i,j,k) axes directions, which are columns of the input matrix
      Returns:
      DOCUMENT ME!
    • init

      private void init()
      Initializes the dialog box to a certain size and adds the components.
    • buildResampleStatusPanel

      JPanel buildResampleStatusPanel()
    • buildTransformStatusPanel

      JPanel buildTransformStatusPanel()
    • reorientCoordSystem

      private TransMatrix reorientCoordSystem(TransMatrix rkMatrix)
      Re-orient the matrix to world and left-hand coordinate systems if required.
      Parameters:
      rkMatrix - the matrix to be converted
      Returns:
      result
      See Also:
    • reorientCoordSystem

      public static TransMatrix reorientCoordSystem(TransMatrix rkMatrix, ModelImage rkImage, ModelImage rkResampleImage, boolean bWcSystem, boolean bLeftHandSystem)
      Re-orient the matrix to world and left-hand coordinate systems if required. Note at the moment the voxel resolutions are handled in the transformation algorithm. At some future point we should adjust for voxel resolutions in the transformation matrix - its faster.
      Parameters:
      rkMatrix - the matrix to be converted
      rkImage - main image
      rkResampleImage - resampled image
      bWcSystem - true if world coord system
      bLeftHandSystem - true if left-handed system.
      Returns:
      result
    • setDefaultResampleToUser

      private void setDefaultResampleToUser()
      DOCUMENT ME!
    • setVariables

      private boolean setVariables()
      Sets the variables needed to run the algorithm.
      Returns:
      Flag indicating successful set of the variables.
    • testType

      private boolean testType(int type, float value)
      Determine if the value is in the image type range and within the float range since AlgorithmTransform does not use double buffers.
      Parameters:
      type - image type
      value - value tested
      Returns:
      true if value is within acceptable range
    • getActionMetadata

      public ActionMetadata getActionMetadata()
      Return meta-information about this discoverable action for categorization and labeling purposes.
      Specified by:
      getActionMetadata in interface ActionDiscovery
      Returns:
      Metadata for this action.
    • createInputParameters

      public ParameterTable createInputParameters()
      Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used in setGUIFromParams()).
      Specified by:
      createInputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the inputs of this algorithm.
    • createOutputParameters

      public ParameterTable createOutputParameters()
      Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).
      Specified by:
      createOutputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the outputs of this algorithm.
    • getOutputImageName

      public String getOutputImageName(String imageParamName)
      Returns the name of an image output by this algorithm, the image returned depends on the parameter label given (which can be used to retrieve the image object from the image registry).
      Specified by:
      getOutputImageName in interface ActionDiscovery
      Parameters:
      imageParamName - The output image parameter label for which to get the image name.
      Returns:
      The image name of the requested output image parameter label.
    • isActionComplete

      public boolean isActionComplete()
      Returns whether the action has successfully completed its execution.
      Specified by:
      isActionComplete in interface ActionDiscovery
      Returns:
      True, if the action is complete. False, if the action failed or is still running.
    • disableResampleMatrixFileButton

      private void disableResampleMatrixFileButton()
    • enableResampleMatrixFileButton

      private void enableResampleMatrixFileButton()
    • enableResampleMatrixFileButtonTargetOnly

      private void enableResampleMatrixFileButtonTargetOnly()
    • populateResampleMatrixFileValues

      private void populateResampleMatrixFileValues()
    • clearResampleOriginalValues

      private void clearResampleOriginalValues()
    • setResampleStatusBox

      private void setResampleStatusBox(String status)
    • clearResampleStatusBox

      private void clearResampleStatusBox()
    • isValidV2MatrixFileRead

      private boolean isValidV2MatrixFileRead()
    • isV2MatrixDataFile

      private boolean isV2MatrixDataFile()
    • hasV1TargetData

      private boolean hasV1TargetData()
    • setTransformStatusBox

      private void setTransformStatusBox(String status)
    • clearTransformStatusBox

      private void clearTransformStatusBox()
    • updateResampleStatusUserSpecified

      private void updateResampleStatusUserSpecified()
    • updateResampleStatusImage

      private void updateResampleStatusImage()