Skip to content

Commit e4b90e0

Browse files
committed
bug fixes with Fernando. Hit a roadblock as the structure I was pushing for is incompatible with SCIRUns
1 parent d1dbf4b commit e4b90e0

11 files changed

+79
-80
lines changed

src/Core/Algorithms/Factory/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ ENDIF()
7171
TARGET_LINK_LIBRARIES(Algorithms_Factory
7272
Algorithms_Base
7373
Algorithms_BrainStimulator
74+
Algorithms_Legacy_Inverse
7475
Core_Algorithms_Legacy_Fields
7576
Algorithms_Math
7677
Algorithms_DataIO

src/Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovImpl_child.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ namespace SCIRun {
5454
public:
5555
SolveInverseProblemWithTikhonovImpl_child() {};
5656

57+
void preAlocateInverseMatrices(const SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_, const SCIRun::Core::Datatypes::DenseMatrix& measuredData_ , const SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_, const SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_);
5758

5859
private:
5960

@@ -66,7 +67,6 @@ namespace SCIRun {
6667
protected:
6768

6869
virtual SCIRun::Core::Datatypes::DenseMatrix computeInverseSolution( double lambda_sq, bool inverseCalculation) const;
69-
void preAlocateInverseMatrices(const SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_, const SCIRun::Core::Datatypes::DenseMatrix& measuredData_ , const SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_, const SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_);
7070
// bool checkInputMatrixSizes(); // DEFINED IN PARENT, MIGHT WANT TO OVERRIDE SOME OTHER TIME
7171

7272
};

src/Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD_impl.cc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
#include <Core/Utils/Exception.h>
4646

4747
// Tikhonov inverse libraries
48-
// #include <Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h>
49-
// #include <Modules/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD.h>
48+
#include <Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h>
5049
#include <Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD_impl.h>
5150

5251
// EIGEN LIBRARY
@@ -78,13 +77,6 @@ void SolveInverseProblemWithTikhonovSVD_impl::preAlocateInverseMatrices(const SC
7877
// determine rank
7978
rank = SVDdecomposition.nonzeroSingularValues();
8079

81-
82-
// Set matrix U, S and V
83-
// matrixU_ = convertMatrix::toDense(SVDdecomposition.computeU());
84-
// matrixV_ = convertMatrix::toDense(SVDdecomposition.computeV());
85-
// matrixS_ = convertMatrix::toDense(SVDdecomposition.nonzeroSingularValues());
86-
87-
8880
// Compute the projection of data y on the left singular vectors
8981
auto tempUy = SVDdecomposition.matrixU().transpose() * (measuredData_);
9082

src/Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD_impl.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,16 @@ namespace Inverse {
6363
rank = 0;
6464
};
6565

66+
void preAlocateInverseMatrices(const SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_, const SCIRun::Core::Datatypes::DenseMatrix& measuredData_ , const SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_, const SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_);
6667

6768
private:
6869

6970
int rank;
7071
Eigen::JacobiSVD<SCIRun::Core::Datatypes::DenseMatrix::EigenBase> SVDdecomposition;
71-
// const SCIRun::Core::Datatypes::DenseMatrix matrixU_;
72-
// const SCIRun::Core::Datatypes::DenseColumnMatrix matrixS_;
73-
// const SCIRun::Core::Datatypes::DenseMatrix matrixV_;
74-
// SCIRun::Core::Datatypes::DenseMatrix y;
7572
SCIRun::Core::Datatypes::DenseMatrix Uy;
7673

7774

7875
virtual SCIRun::Core::Datatypes::DenseMatrix computeInverseSolution( double lambda_sq, bool inverseCalculation) const;
79-
void preAlocateInverseMatrices(const SCIRun::Core::Datatypes::DenseMatrix& forwardMatrix_, const SCIRun::Core::Datatypes::DenseMatrix& measuredData_ , const SCIRun::Core::Datatypes::DenseMatrix& sourceWeighting_, const SCIRun::Core::Datatypes::DenseMatrix& sensorWeighting_);
8076
// bool checkInputMatrixSizes(); // DEFINED IN PARENT, MIGHT WANT TO OVERRIDE SOME OTHER TIME
8177

8278

src/Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ namespace Inverse {
119119
static double LambdaLookup(LCurveInput& input, double lambda, int& lambda_index, const double epsilon);
120120
double computeLcurve( const AlgorithmInput & input ) const;
121121

122-
protected:
123-
124122
bool checkInputMatrixSizes( const AlgorithmInput & input ) const;
125123

124+
protected:
126125
// Abstract functions
127126
virtual SCIRun::Core::Datatypes::DenseMatrix computeInverseSolution( double lambda_sq, bool inverseCalculation) const = 0;
128127

src/Interface/Modules/Inverse/SolveInverseProblemWithTikhonovDialog.cc

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ DEALINGS IN THE SOFTWARE.
2828

2929
#include <Interface/Modules/Inverse/SolveInverseProblemWithTikhonovDialog.h>
3030
#include <Modules/Legacy/Inverse/SolveInverseProblemWithTikhonov.h>
31+
#include <Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h>
3132

3233
using namespace SCIRun::Gui;
3334
using namespace SCIRun::Dataflow::Networks;
@@ -49,23 +50,23 @@ SolveInverseProblemWithTikhonovDialog::SolveInverseProblemWithTikhonovDialog(con
4950

5051
WidgetStyleMixin::tabStyle(inputTabWidget_);
5152

52-
addDoubleLineEditManager(lCurveLambdaLineEdit_, SolveInverseProblemWithTikhonovModule::LambdaCorner);
53-
addSpinBoxManager(lambdaNumberSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaNum);
54-
addDoubleSpinBoxManager(lambdaDoubleSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaFromDirectEntry);
55-
addDoubleSpinBoxManager(lambdaMinDoubleSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaMin);
56-
addDoubleSpinBoxManager(lambdaMaxDoubleSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaMax);
57-
addDoubleSpinBoxManager(lambdaResolutionDoubleSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaResolution);
58-
addDoubleLineEditManager(lCurveMinLineEdit_, SolveInverseProblemWithTikhonovModule::LambdaMin);
59-
addDoubleLineEditManager(lCurveMaxLineEdit_, SolveInverseProblemWithTikhonovModule::LambdaMax);
53+
addDoubleLineEditManager(lCurveLambdaLineEdit_, TikhonovAlgoAbstractBase::LambdaCorner);
54+
addSpinBoxManager(lambdaNumberSpinBox_, TikhonovAlgoAbstractBase::LambdaNum);
55+
addDoubleSpinBoxManager(lambdaDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaFromDirectEntry);
56+
addDoubleSpinBoxManager(lambdaMinDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaMin);
57+
addDoubleSpinBoxManager(lambdaMaxDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaMax);
58+
addDoubleSpinBoxManager(lambdaResolutionDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaResolution);
59+
addDoubleLineEditManager(lCurveMinLineEdit_, TikhonovAlgoAbstractBase::LambdaMin);
60+
addDoubleLineEditManager(lCurveMaxLineEdit_, TikhonovAlgoAbstractBase::LambdaMax);
6061

61-
addDoubleSpinBoxManager(lambdaSliderDoubleSpinBox_, SolveInverseProblemWithTikhonovModule::LambdaSliderValue);
62+
addDoubleSpinBoxManager(lambdaSliderDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaSliderValue);
6263

63-
addRadioButtonGroupManager({ autoRadioButton_, underRadioButton_, overRadioButton_ }, SolveInverseProblemWithTikhonovModule::TikhonovCase);
64-
addRadioButtonGroupManager({ solutionConstraintRadioButton_, squaredSolutionRadioButton_ }, Parameters::TikhonovSolutionSubcase);
65-
addRadioButtonGroupManager({ residualConstraintRadioButton_, squaredResidualSolutionRadioButton_ }, Parameters::TikhonovResidualSubcase);
64+
addRadioButtonGroupManager({ autoRadioButton_, underRadioButton_, overRadioButton_ }, TikhonovAlgoAbstractBase::TikhonovCase);
65+
addRadioButtonGroupManager({ solutionConstraintRadioButton_, squaredSolutionRadioButton_ }, TikhonovAlgoAbstractBase::TikhonovSolutionSubcase);
66+
addRadioButtonGroupManager({ residualConstraintRadioButton_, squaredResidualSolutionRadioButton_ }, TikhonovAlgoAbstractBase::TikhonovResidualSubcase);
6667

67-
addComboBoxManager(lambdaMethodComboBox_, SolveInverseProblemWithTikhonovModule::RegularizationMethod, lambdaMethod_);
68-
addTextEditManager(lCurveTextEdit_, SolveInverseProblemWithTikhonovModule::LCurveText);
68+
addComboBoxManager(lambdaMethodComboBox_, TikhonovAlgoAbstractBase::RegularizationMethod, lambdaMethod_);
69+
addTextEditManager(lCurveTextEdit_, TikhonovAlgoAbstractBase::LCurveText);
6970

7071
connect(lambdaSlider_, SIGNAL(valueChanged(int)), this, SLOT(setSpinBoxValue(int)));
7172
connect(lambdaSliderDoubleSpinBox_, SIGNAL(valueChanged(double)), this, SLOT(setSliderValue(double)));

src/Interface/Modules/Inverse/SolveInverseProblemWithTikhonovSVDDialog.cc

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ DEALINGS IN THE SOFTWARE.
2828

2929
#include <Interface/Modules/Inverse/SolveInverseProblemWithTikhonovSVDDialog.h>
3030
#include <Modules/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD.h>
31+
#include <Core/Algorithms/Legacy/Inverse/TikhonovAlgoAbstractBase.h>
3132

3233
using namespace SCIRun::Gui;
3334
using namespace SCIRun::Dataflow::Networks;
@@ -49,23 +50,23 @@ SolveInverseProblemWithTikhonovSVDDialog::SolveInverseProblemWithTikhonovSVDDial
4950

5051
WidgetStyleMixin::tabStyle(inputTabWidget_);
5152

52-
addDoubleLineEditManager(lCurveLambdaLineEdit_, SolveInverseProblemWithTikhonovSVDModule::LambdaCorner);
53-
addSpinBoxManager(lambdaNumberSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaNum);
54-
addDoubleSpinBoxManager(lambdaDoubleSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaFromDirectEntry);
55-
addDoubleSpinBoxManager(lambdaMinDoubleSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaMin);
56-
addDoubleSpinBoxManager(lambdaMaxDoubleSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaMax);
57-
addDoubleSpinBoxManager(lambdaResolutionDoubleSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaResolution);
58-
addDoubleSpinBoxManager(lCurveMinDoubleSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaMin);
59-
addDoubleSpinBoxManager(lCurveMaxDoubleSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaMax);
53+
addDoubleLineEditManager(lCurveLambdaLineEdit_, TikhonovAlgoAbstractBase::LambdaCorner);
54+
addSpinBoxManager(lambdaNumberSpinBox_, TikhonovAlgoAbstractBase::LambdaNum);
55+
addDoubleSpinBoxManager(lambdaDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaFromDirectEntry);
56+
addDoubleSpinBoxManager(lambdaMinDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaMin);
57+
addDoubleSpinBoxManager(lambdaMaxDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaMax);
58+
addDoubleSpinBoxManager(lambdaResolutionDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaResolution);
59+
addDoubleSpinBoxManager(lCurveMinDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaMin);
60+
addDoubleSpinBoxManager(lCurveMaxDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaMax);
6061

61-
addDoubleSpinBoxManager(lambdaSliderDoubleSpinBox_, SolveInverseProblemWithTikhonovSVDModule::LambdaSliderValue);
62+
addDoubleSpinBoxManager(lambdaSliderDoubleSpinBox_, TikhonovAlgoAbstractBase::LambdaSliderValue);
6263

6364
addRadioButtonGroupManager({ autoRadioButton_, underRadioButton_, overRadioButton_ }, SolveInverseProblemWithTikhonovSVDModule::TikhonovCase);
64-
addRadioButtonGroupManager({ solutionConstraintRadioButton_, squaredSolutionRadioButton_ }, Parameters::TikhonovSolutionSubcase);
65-
addRadioButtonGroupManager({ residualConstraintRadioButton_, squaredResidualSolutionRadioButton_ }, Parameters::TikhonovResidualSubcase);
65+
addRadioButtonGroupManager({ solutionConstraintRadioButton_, squaredSolutionRadioButton_ }, TikhonovAlgoAbstractBase::TikhonovSolutionSubcase);
66+
addRadioButtonGroupManager({ residualConstraintRadioButton_, squaredResidualSolutionRadioButton_ }, TikhonovAlgoAbstractBase::TikhonovResidualSubcase);
6667

67-
addComboBoxManager(lambdaMethodComboBox_, SolveInverseProblemWithTikhonovSVDModule::RegularizationMethod, lambdaMethod_);
68-
addTextEditManager(lCurveTextEdit_, SolveInverseProblemWithTikhonovSVDModule::LCurveText);
68+
addComboBoxManager(lambdaMethodComboBox_, TikhonovAlgoAbstractBase::RegularizationMethod, lambdaMethod_);
69+
addTextEditManager(lCurveTextEdit_, TikhonovAlgoAbstractBase::LCurveText);
6970

7071
connect(lambdaSlider_, SIGNAL(valueChanged(int)), this, SLOT(setSpinBoxValue(int)));
7172
connect(lambdaSliderDoubleSpinBox_, SIGNAL(valueChanged(double)), this, SLOT(setSliderValue(double)));

src/Modules/Legacy/Inverse/SolveInverseProblemWithTikhonov.cc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ SolveInverseProblemWithTikhonov::SolveInverseProblemWithTikhonov() : Module(stat
6161

6262
void SolveInverseProblemWithTikhonov::setStateDefaults()
6363
{
64-
setStateIntFromAlgo(SolveInverseProblemWithTikhonovImpl_child::regularizationChoice);
65-
setStateIntFromAlgo(SolveInverseProblemWithTikhonovImpl_child::regularizationSolutionSubcase);
66-
setStateIntFromAlgo(SolveInverseProblemWithTikhonovImpl_child::regularizationResidualSubcase);
64+
setStateIntFromAlgo(TikhonovAlgoAbstractBase::regularizationChoice);
65+
setStateIntFromAlgo(TikhonovAlgoAbstractBase::regularizationSolutionSubcase);
66+
setStateIntFromAlgo(TikhonovAlgoAbstractBase::regularizationResidualSubcase);
6767
}
6868

6969
// execute function
70-
void SolveInverseProblemWithTikhonovSVD::execute()
70+
void SolveInverseProblemWithTikhonov::execute()
7171
{
7272

7373
// load required inputs
@@ -81,19 +81,21 @@ void SolveInverseProblemWithTikhonovSVD::execute()
8181

8282
if (needToExecute())
8383
{
84+
SolveInverseProblemWithTikhonovImpl_child algo;
85+
8486
// set parameters
85-
setAlgoOptionFromState(SolveInverseProblemWithTikhonovImpl_child::regularizationChoice);
86-
setAlgoOptionFromState(SolveInverseProblemWithTikhonovImpl_child::regularizationSolutionSubcase);
87-
setAlgoOptionFromState(SolveInverseProblemWithTikhonovImpl_child::regularizationResidualSubcase);
87+
algo.setOption(TikhonovAlgoAbstractBase::regularizationChoice, get_state()->getValue(TikhonovAlgoAbstractBase::regularizationChoice).toString());
88+
algo.setOption(TikhonovAlgoAbstractBase::regularizationSolutionSubcase, get_state()->getValue(TikhonovAlgoAbstractBase::regularizationSolutionSubcase).toString());
89+
algo.setOption(TikhonovAlgoAbstractBase::regularizationResidualSubcase, get_state()->getValue(TikhonovAlgoAbstractBase::regularizationResidualSubcase).toString());
8890

8991
// check input sizes
90-
algo().checkInputMatrixSizes( withInputData((ForwardMatrix, forward_matrix_h) (MeasuredPotentials,hMatrixMeasDat) (WeightingInSourceSpace,hMatrixRegMat) (WeightingInSensorSpace, hMatrixNoiseCov) ) );
92+
algo.checkInputMatrixSizes( make_input((ForwardMatrix, *forward_matrix_h) (MeasuredPotentials,*hMatrixMeasDat) (WeightingInSourceSpace,*hMatrixRegMat) (WeightingInSensorSpace, *hMatrixNoiseCov) ) );
9193

9294
// prealocate MATRICES
93-
algo().preAlocateInverseMatrices( forward_matrix_h, hMatrixMeasDat, hMatrixRegMat, hMatrixNoiseCov);
95+
algo.preAlocateInverseMatrices( *forward_matrix_h, *hMatrixMeasDat, *hMatrixRegMat, *hMatrixNoiseCov );
9496

9597
// run
96-
auto output = algo().run( withInputData((ForwardMatrix, forward_matrix_h) (MeasuredPotentials,hMatrixMeasDat) (WeightingInSourceSpace,hMatrixRegMat) (WeightingInSensorSpace, hMatrixNoiseCov) ));
98+
auto output = algo.run( make_input((ForwardMatrix, *forward_matrix_h) (MeasuredPotentials,*hMatrixMeasDat) (WeightingInSourceSpace,*hMatrixRegMat) (WeightingInSensorSpace, *hMatrixNoiseCov)));
9799

98100
// update L-curve
99101
/* NO EXISTE

src/Modules/Legacy/Inverse/SolveInverseProblemWithTikhonov.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#ifndef MODULES_LEGACY_INVERSE_SolveInverseProblemWithTikhonov_H__
3131
#define MODULES_LEGACY_INVERSE_SolveInverseProblemWithTikhonov_H__
3232
#include <Dataflow/Network/Module.h>
33+
#include <Core/Algorithms/Legacy/Inverse/SolveInverseProblemWithTikhonovImpl_child.h>
3334
#include <Modules/Fields/share.h>
3435

3536
namespace SCIRun {
@@ -45,18 +46,19 @@ namespace Inverse {
4546
virtual void execute();
4647
virtual void setStateDefaults();
4748

48-
INPUT_PORT(0, ForwardMatrix, Matrix);
49-
INPUT_PORT(1, WeightingInSourceSpace, Matrix);
50-
INPUT_PORT(2, MeasuredPotentials, Matrix);
51-
INPUT_PORT(3, WeightingInSensorSpace, Matrix);
52-
OUTPUT_PORT(0, InverseSolution, Matrix);
53-
OUTPUT_PORT(1, RegularizationParameter, Matrix);
54-
OUTPUT_PORT(2, RegInverse, Matrix);
49+
INPUT_PORT(0, ForwardMatrix, DenseMatrix);
50+
INPUT_PORT(1, WeightingInSourceSpace, DenseMatrix);
51+
INPUT_PORT(2, MeasuredPotentials, DenseMatrix);
52+
INPUT_PORT(3, WeightingInSensorSpace, DenseMatrix);
53+
54+
OUTPUT_PORT(0, InverseSolution, DenseMatrix);
55+
OUTPUT_PORT(1, RegularizationParameter, DenseMatrix);
56+
OUTPUT_PORT(2, RegInverse, DenseMatrix);
5557

5658
MODULE_TRAITS_AND_INFO(ModuleHasUIAndAlgorithm)
5759

5860
private:
59-
void update_lcurve_gui(const double lambda, const Core::Algorithms::Inverse::TikhonovAlgorithm::LCurveInput& input, const int lambda_index);
61+
// void update_lcurve_gui(const double lambda, const Core::Algorithms::Inverse::SolveInverseProblemWithTikhonovImpl_child::LCurveInput& input, const int lambda_index);
6062
};
6163
}}}
6264

src/Modules/Legacy/Inverse/SolveInverseProblemWithTikhonovSVD.cc

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,22 @@ MODULE_INFO_DEF(SolveInverseProblemWithTikhonovSVD, Inverse, SCIRun)
5050
// Constructor needs to initialize all input/output ports
5151
SolveInverseProblemWithTikhonovSVD::SolveInverseProblemWithTikhonovSVD() : Module(staticInfo_)
5252
{
53+
//inputs
5354
INITIALIZE_PORT(ForwardMatrix);
5455
INITIALIZE_PORT(WeightingInSourceSpace);
5556
INITIALIZE_PORT(MeasuredPotentials);
5657
INITIALIZE_PORT(WeightingInSensorSpace);
58+
// outputs
5759
INITIALIZE_PORT(InverseSolution);
5860
INITIALIZE_PORT(RegularizationParameter);
5961
INITIALIZE_PORT(RegInverse);
6062
}
6163

6264
void SolveInverseProblemWithTikhonovSVD::setStateDefaults()
6365
{
64-
setStateIntFromAlgo(SolveInverseProblemWithTikhonovSVD_impl::regularizationChoice);
65-
setStateIntFromAlgo(SolveInverseProblemWithTikhonovSVD_impl::regularizationSolutionSubcase);
66-
setStateIntFromAlgo(SolveInverseProblemWithTikhonovSVD_impl::regularizationResidualSubcase);
66+
setStateIntFromAlgo(TikhonovAlgoAbstractBase::regularizationChoice);
67+
setStateIntFromAlgo(TikhonovAlgoAbstractBase::regularizationSolutionSubcase);
68+
setStateIntFromAlgo(TikhonovAlgoAbstractBase::regularizationResidualSubcase);
6769
}
6870

6971
// execute function
@@ -81,23 +83,25 @@ void SolveInverseProblemWithTikhonovSVD::execute()
8183

8284
if (needToExecute())
8385
{
86+
SolveInverseProblemWithTikhonovSVD_impl algo;
87+
8488
// set parameters
85-
setAlgoOptionFromState(SolveInverseProblemWithTikhonovSVD_impl::regularizationChoice);
86-
setAlgoOptionFromState(SolveInverseProblemWithTikhonovSVD_impl::regularizationSolutionSubcase);
87-
setAlgoOptionFromState(SolveInverseProblemWithTikhonovSVD_impl::regularizationResidualSubcase);
89+
algo.setOption(TikhonovAlgoAbstractBase::regularizationChoice, get_state()->getValue(TikhonovAlgoAbstractBase::regularizationChoice).toString() );
90+
algo.setOption(TikhonovAlgoAbstractBase::regularizationSolutionSubcase, get_state()->getValue(TikhonovAlgoAbstractBase::regularizationSolutionSubcase).toString() );
91+
algo.setOption(TikhonovAlgoAbstractBase::regularizationResidualSubcase, get_state()->getValue(TikhonovAlgoAbstractBase::regularizationResidualSubcase).toString() );
8892

8993
// check input sizes
90-
algo().checkInputMatrixSizes( withInputData((ForwardMatrix, forward_matrix_h) (MeasuredPotentials,hMatrixMeasDat) (WeightingInSourceSpace,hMatrixRegMat) (WeightingInSensorSpace, hMatrixNoiseCov) ) );
94+
algo.checkInputMatrixSizes( make_input( (ForwardMatrix, *forward_matrix_h) (MeasuredPotentials,*hMatrixMeasDat) (WeightingInSourceSpace,*hMatrixRegMat) (WeightingInSensorSpace, *hMatrixNoiseCov) ) );
9195

9296
// prealocate MATRICES
93-
algo().preAlocateInverseMatrices( forward_matrix_h, hMatrixMeasDat, hMatrixRegMat, hMatrixNoiseCov);
97+
algo.preAlocateInverseMatrices( *forward_matrix_h, *hMatrixMeasDat, *hMatrixRegMat, *hMatrixNoiseCov );
9498

9599
// run
96-
auto output = algo().run( withInputData((ForwardMatrix, forward_matrix_h) (MeasuredPotentials,hMatrixMeasDat) (WeightingInSourceSpace,hMatrixRegMat) (WeightingInSensorSpace, hMatrixNoiseCov) ));
100+
auto output = algo.run( make_input( (ForwardMatrix, *forward_matrix_h)(MeasuredPotentials,*hMatrixMeasDat)(WeightingInSourceSpace,*hMatrixRegMat)(WeightingInSensorSpace, *hMatrixNoiseCov) ));
97101

98102
// update L-curve
99103
/* NO EXISTE
100-
SolveInverseProblemWithTikhonovImpl_child::Input::lcurveGuiUpdate update = boost::bind(&SolveInverseProblemWithTikhonov::update_lcurve_gui, this, _1, _2, _3);
104+
SolveInverseProblemWithTikhonovSVD_impl::Input::lcurveGuiUpdate update = boost::bind(&SolveInverseProblemWithTikhonov::update_lcurve_gui, this, _1, _2, _3);
101105
*/
102106

103107
// set outputs

0 commit comments

Comments
 (0)