Class AbstractDynamicContrastModel

java.lang.Object
com.xinapse.apps.perfusion.AbstractDynamicContrastModel
All Implemented Interfaces:
DynamicModel
Direct Known Subclasses:
DCEMRIModel

public abstract class AbstractDynamicContrastModel extends Object implements DynamicModel
A Model that can be fitted to dynamic data where contrast agent is injected, and the tissue response to an input function is measured.
  • Field Details

    • aif

      protected AIF aif
      The blood plasma concentration in the feeding artery, Cpa(t).
    • nAIF

      protected int nAIF
      The number of points in the AIF if it is resampled with a time step of dt.
  • Constructor Details

    • AbstractDynamicContrastModel

      protected AbstractDynamicContrastModel(String name, String description, String[] varNames, String[] varUnits)
      Constructor used by sub-classes. The varNames and varUnits must be in an order so that the variable names are matched to the correct units.
      Parameters:
      name - the model name.
      description - a short description of the model.
      varNames - the array of fitted variable names.
      varUnits - the units of the fitted variables.
  • Method Details

    • setInputFunction

      public void setInputFunction(AIF aif, float dt) throws NumericalException
      Sets the arterial input function for the model.
      Parameters:
      aif - the arterial input function (plasma concentration values in the feeding artery), Cpa(t).
      dt - the time between data samples in the tissue response for which the AIF will be used.
      Throws:
      NumericalException - if the AIF cannot be handled due to a numerical processing problem.
    • getModelName

      public String getModelName()
      Returns the model name.
      Specified by:
      getModelName in interface DynamicModel
      Returns:
      the name of the dynamic contrast model.
    • getModelDescription

      public String getModelDescription()
      Returns a String describing this dynamic contrast model.
      Specified by:
      getModelDescription in interface DynamicModel
      Returns:
      a String describing this dynamic contrast model.
    • getVarNames

      public final String[] getVarNames()
      Returns an array of the names of the fitted variables, in an order that matches the order of the variable units returned by getVarUnits().
      Specified by:
      getVarNames in interface DynamicModel
      Returns:
      the names of the fitted variables.
    • getVarUnits

      public final String[] getVarUnits()
      Returns an array of the fitted variable units, in an order that matches the order of the variable names returned by getVarNames().
      Specified by:
      getVarUnits in interface DynamicModel
      Returns:
      the fitted variable units.
    • getVarColourMappings

      public ColourMapping[] getVarColourMappings()
      Returns an array of ColourMappings, applicable for each of the output images. If any of the output images does not have a specific ColourMapping, the array entry should be null for the corresponding image.
      Specified by:
      getVarColourMappings in interface DynamicModel
      Returns:
      an array of ColourMappings, the length of which must be equal to the number of output parameters computed by the model. The default implementation returns an array of null values.
    • computesRMSDiff

      public boolean computesRMSDiff()
      Returns whether the dynamic contrast model computed the RMS difference between the model fit and the data.
      Specified by:
      computesRMSDiff in interface DynamicModel
      Returns:
      true if the model computes the (RMS) difference between the model and the data; false otherwise.
    • getDt

      public float getDt() throws IllegalStateException
      Returns the time between data samples.
      Specified by:
      getDt in interface DynamicModel
      Returns:
      the time (in seconds) between data samples.
      Throws:
      IllegalStateException - if the arterial input function has not been set.
    • getDoBonferroni

      public final boolean getDoBonferroni()
      Returns false, since Bonferroni correction is not performed because significance values for the fitted parameters are not computed.
      Specified by:
      getDoBonferroni in interface DynamicModel
      Returns:
      true if this DynmicModel does Bonferroni correction; false otherwise.
    • setBonferroniN

      public final void setBonferroniN(float nTests)
      Does nothing, since Bonferroni correction is not performed because significance values for the fitted parameters are not computed.
      Specified by:
      setBonferroniN in interface DynamicModel
      Parameters:
      nTests - the number of independent fits that will be performed by the model.
    • fit

      public abstract AbstractDynamicContrastResult fit(float[] Ct, int col, int row, int slice, AutoCorrelationEstimate autoCorrelationEstimate, MonitorWorker worker) throws NumericalException, CancelledException
      Calculate the model parameters that best fit the data.
      Specified by:
      fit in interface DynamicModel
      Parameters:
      Ct - the tissue contrast agent concentration function, Ct(t), post-contrast.
      col - the image column number that is being analysed - ignored.
      row - the image column number that is being analysed - ignored.
      slice - the slice number - ignored.
      autoCorrelationEstimate - - ignored.
      worker - if non-null, the MonitorWorker that may be used to cancel the operation.
      Returns:
      the result of fitting to the data.
      Throws:
      NumericalException - if a numerical error occurs during the fitting.
      CancelledException - if the fitting is cancelled using the MonitorWorker.
    • getCorrectAutoCorrelation

      public boolean getCorrectAutoCorrelation()
      Returns false, since the DynamicContrastModels do not do a correction for temporal autocorrelation.
      Specified by:
      getCorrectAutoCorrelation in interface DynamicModel
      Returns:
      false.
    • toString

      public String toString()
      Returns the name of this DCEMRIModel.
      Overrides:
      toString in class Object
      Returns:
      the name of this DCEMRIModel.