19 #ifndef rtkProjectionsDecompositionNegativeLogLikelihood_h 20 #define rtkProjectionsDecompositionNegativeLogLikelihood_h 22 #include <itkSingleValuedCostFunction.h> 23 #include <itkVectorImage.h> 24 #include <itkVariableLengthVector.h> 25 #include <itkVariableSizeMatrix.h> 78 long double measure = 0;
85 itkExceptionMacro(<<
"Not implemented");
91 virtual itk::VariableLengthVector<float>
96 itk::VariableLengthVector<double> diag;
101 diag[mat] = 1. /
m_Fischer.GetInverse()[mat][mat];
105 virtual itk::VariableLengthVector<float>
110 itk::VariableLengthVector<double> diag;
115 diag[mat] =
m_Fischer.GetInverse()[mat][mat];
119 virtual itk::VariableLengthVector<float>
123 itk::VariableLengthVector<double> fischer;
143 virtual vnl_vector<double>
146 vnl_vector<double> attenuationFactors;
158 vnl_vector<double> vnlLineIntegrals;
163 vnlLineIntegrals[m] = lineIntegrals[m];
171 attenuationFactors[energy] = std::exp(-attenuationFactors[energy]);
175 itk::VariableLengthVector<double>
178 itk::VariableLengthVector<double> initialGuess;
185 MeanAttenuationInBin.Fill(0);
191 double accumulate = 0;
192 double accumulateWeights = 0;
198 accumulateWeights += this->m_IncidentSpectrum[0][energy];
200 MeanAttenuationInBin[mat][bin] = accumulate / accumulateWeights;
207 initialGuess[mat] = 1e10;
213 if (initialGuess[mat] > requiredLength)
214 initialGuess[mat] = requiredLength;
221 itk::VariableLengthVector<double>
224 itk::VariableLengthVector<double> logTransforms;
227 vnl_vector<double> ones, nonAttenuated;
243 return logTransforms;
246 virtual vnl_vector<double>
249 vnl_vector<double> meaninglessResult;
251 meaninglessResult.fill(0.);
252 return (meaninglessResult);
265 itkGetMacro(NumberOfEnergies,
unsigned int);
268 itkGetMacro(NumberOfMaterials,
unsigned int);
274 itkGetMacro(NumberOfSpectralBins,
unsigned int);
virtual vnl_vector< double > ForwardModel(const ParametersType &lineIntegrals) const
MaterialAttenuationsType m_MaterialAttenuations
unsigned int m_NumberOfEnergies
Superclass::ParametersType ParametersType
unsigned int m_NumberOfSpectralBins
itk::SmartPointer< Self > Pointer
void GetAttenuationFactors(const ParametersType &lineIntegrals, vnl_vector< double > &attenuationFactors) const
itk::VariableLengthVector< int > ThresholdsType
virtual void Initialize()
MeasuredDataType m_MeasuredData
itk::SmartPointer< const Self > ConstPointer
Superclass::DerivativeType DerivativeType
itk::VariableSizeMatrix< double > MeanAttenuationInBinType
ThresholdsType m_Thresholds
void GetDerivative(const ParametersType &, DerivativeType &) const override
~ProjectionsDecompositionNegativeLogLikelihood() override=default
itk::VariableLengthVector< double > BinwiseLogTransform() const
IncidentSpectrumType m_IncidentSpectrum
vnl_matrix< float > IncidentSpectrumType
#define itkSetMacro(name, type)
itk::VariableSizeMatrix< float > m_Fischer
virtual itk::VariableLengthVector< float > GetInverseCramerRaoLowerBound()
virtual itk::VariableLengthVector< float > GetFischerMatrix()
MeasureType GetValue(const ParametersType &) const override
virtual itk::VariableLengthVector< float > GetCramerRaoLowerBound()
itk::VariableLengthVector< double > GuessInitialization() const
vnl_matrix< double > MaterialAttenuationsType
DetectorResponseType m_DetectorResponse
unsigned int GetNumberOfParameters() const override
virtual void ComputeFischerMatrix(const ParametersType &)
ProjectionsDecompositionNegativeLogLikelihood()
Superclass::MeasureType MeasureType
unsigned int m_NumberOfMaterials
vnl_matrix< double > m_IncidentSpectrumAndDetectorResponseProduct
itk::VariableLengthVector< double > MeasuredDataType
virtual vnl_vector< double > GetVariances(const ParametersType &) const
itk::SingleValuedCostFunction Superclass
vnl_matrix< double > DetectorResponseType