19#ifndef rtkProjectionsDecompositionNegativeLogLikelihood_h
20#define rtkProjectionsDecompositionNegativeLogLikelihood_h
80 long double measure = 0;
87 itkExceptionMacro(<<
"Not implemented");
103 diag[mat] = 1. /
m_Fischer.GetInverse()[mat][mat];
117 diag[mat] =
m_Fischer.GetInverse()[mat][mat];
145 virtual vnl_vector<double>
148 vnl_vector<double> attenuationFactors;
160 vnl_vector<double> vnlLineIntegrals;
165 vnlLineIntegrals[m] = lineIntegrals[m];
173 attenuationFactors[energy] = std::exp(-attenuationFactors[energy]);
187 MeanAttenuationInBin.
Fill(0);
193 double accumulate = 0;
194 double accumulateWeights = 0;
200 accumulateWeights += this->m_IncidentSpectrum[0][energy];
202 MeanAttenuationInBin[mat][bin] = accumulate / accumulateWeights;
209 initialGuess[mat] = 1e10;
215 initialGuess[mat] = std::min(initialGuess[mat], requiredLength);
228 vnl_vector<double> ones, nonAttenuated;
244 return logTransforms;
247 virtual vnl_vector<double>
250 vnl_vector<double> meaninglessResult;
252 meaninglessResult.fill(0.);
253 return (meaninglessResult);
266 itkGetMacro(NumberOfEnergies,
unsigned int);
269 itkGetMacro(NumberOfMaterials,
unsigned int);
275 itkGetMacro(NumberOfSpectralBins,
unsigned int);
This class is a base for the CostFunctions returning a single value.
Array< ParametersValueType > DerivativeType
Superclass::ParametersType ParametersType
Implements transparent reference counting.
A templated class holding a M x N size Matrix.
bool SetSize(unsigned int r, unsigned int c)
void Fill(const T &value)
MeasuredDataType m_MeasuredData
MaterialAttenuationsType m_MaterialAttenuations
ProjectionsDecompositionNegativeLogLikelihood Self
itk::SmartPointer< const Self > ConstPointer
void GetDerivative(const ParametersType &lineIntegrals, DerivativeType &derivatives) const override
Superclass::MeasureType MeasureType
itk::VariableLengthVector< double > BinwiseLogTransform() const
itk::SingleValuedCostFunction Superclass
virtual itk::VariableLengthVector< float > GetFischerMatrix()
DetectorResponseType m_DetectorResponse
Superclass::ParametersType ParametersType
IncidentSpectrumType m_IncidentSpectrum
unsigned int m_NumberOfEnergies
vnl_matrix< double > DetectorResponseType
vnl_matrix< double > MaterialAttenuationsType
virtual vnl_vector< double > ForwardModel(const ParametersType &lineIntegrals) const
vnl_matrix< float > IncidentSpectrumType
virtual void Initialize()
vnl_matrix< double > m_IncidentSpectrumAndDetectorResponseProduct
unsigned int m_NumberOfMaterials
MeasureType GetValue(const ParametersType ¶meters) const override
ThresholdsType m_Thresholds
virtual itk::VariableLengthVector< float > GetInverseCramerRaoLowerBound()
virtual void ComputeFischerMatrix(const ParametersType &lineIntegrals)
itk::VariableSizeMatrix< float > m_Fischer
itk::SmartPointer< Self > Pointer
itk::VariableSizeMatrix< double > MeanAttenuationInBinType
itk::VariableLengthVector< double > GuessInitialization() const
ProjectionsDecompositionNegativeLogLikelihood()
void GetAttenuationFactors(const ParametersType &lineIntegrals, vnl_vector< double > &attenuationFactors) const
~ProjectionsDecompositionNegativeLogLikelihood() override=default
itk::VariableLengthVector< int > ThresholdsType
unsigned int m_NumberOfSpectralBins
unsigned int GetNumberOfParameters() const override
itk::VariableLengthVector< double > MeasuredDataType
virtual vnl_vector< double > GetVariances(const ParametersType &lineIntegrals) const
virtual itk::VariableLengthVector< float > GetCramerRaoLowerBound()
Superclass::DerivativeType DerivativeType
#define itkSetMacro(name, type)