Package com.xinapse.apps.perfusion
Class AbstractDynamicContrastModel
java.lang.Object
com.xinapse.apps.perfusion.AbstractDynamicContrastModel
- All Implemented Interfaces:
DynamicModel
- Direct Known Subclasses:
DCEMRIModel
A Model that can be fitted to dynamic data where contrast agent is injected, and
the tissue response to an input function is measured.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.xinapse.dynamic.DynamicModel
DynamicModel.SpecifierPanel
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractDynamicContrastModel
(String name, String description, String[] varNames, String[] varUnits) Constructor used by sub-classes. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the dynamic contrast model computed the RMS difference between the model fit and the data.abstract AbstractDynamicContrastResult
fit
(float[] Ct, int col, int row, int slice, AutoCorrelationEstimate autoCorrelationEstimate, MonitorWorker worker) Calculate the model parameters that best fit the data.boolean
Returns false, since the DynamicContrastModels do not do a correction for temporal autocorrelation.final boolean
Returnsfalse
, since Bonferroni correction is not performed because significance values for the fitted parameters are not computed.float
getDt()
Returns the time between data samples.Returns a String describing this dynamic contrast model.Returns the model name.Returns an array ofColourMapping
s, applicable for each of the output images.final String[]
Returns an array of the names of the fitted variables, in an order that matches the order of the variable units returned bygetVarUnits()
.final String[]
Returns an array of the fitted variable units, in an order that matches the order of the variable names returned bygetVarNames()
.final void
setBonferroniN
(float nTests) Does nothing, since Bonferroni correction is not performed because significance values for the fitted parameters are not computed.void
setInputFunction
(AIF aif, float dt) Sets the arterial input function for the model.toString()
Returns the name of this DCEMRIModel.
-
Field Details
-
aif
The blood plasma concentration in the feeding artery, Cpa(t). -
nAIF
protected int nAIFThe 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
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
Returns the model name.- Specified by:
getModelName
in interfaceDynamicModel
- Returns:
- the name of the dynamic contrast model.
-
getModelDescription
Returns a String describing this dynamic contrast model.- Specified by:
getModelDescription
in interfaceDynamicModel
- Returns:
- a String describing this dynamic contrast model.
-
getVarNames
Returns an array of the names of the fitted variables, in an order that matches the order of the variable units returned bygetVarUnits()
.- Specified by:
getVarNames
in interfaceDynamicModel
- Returns:
- the names of the fitted variables.
-
getVarUnits
Returns an array of the fitted variable units, in an order that matches the order of the variable names returned bygetVarNames()
.- Specified by:
getVarUnits
in interfaceDynamicModel
- Returns:
- the fitted variable units.
-
getVarColourMappings
Returns an array ofColourMapping
s, applicable for each of the output images. If any of the output images does not have a specificColourMapping
, the array entry should benull
for the corresponding image.- Specified by:
getVarColourMappings
in interfaceDynamicModel
- Returns:
- an array of
ColourMapping
s, the length of which must be equal to the number of output parameters computed by the model. The default implementation returns an array ofnull
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 interfaceDynamicModel
- Returns:
- true if the model computes the (RMS) difference between the model and the data; false otherwise.
-
getDt
Returns the time between data samples.- Specified by:
getDt
in interfaceDynamicModel
- Returns:
- the time (in seconds) between data samples.
- Throws:
IllegalStateException
- if the arterial input function has not been set.
-
getDoBonferroni
public final boolean getDoBonferroni()Returnsfalse
, since Bonferroni correction is not performed because significance values for the fitted parameters are not computed.- Specified by:
getDoBonferroni
in interfaceDynamicModel
- 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 interfaceDynamicModel
- 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 interfaceDynamicModel
- 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 interfaceDynamicModel
- Returns:
- false.
-
toString
Returns the name of this DCEMRIModel.
-