-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/18 add inverse solution scripts #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ncentrations (assumes scattering fixed) for R(rho) measurements over a range of wavelengths. I am committing the "inverse crime" here because I'm using NURBS for simulated measured data and the model used for inversion. This runs and provides reasonable results using the python scipy.optimize least_squares method. However if I change the model to SDA point source it has warnings. Similar code can be found in MATLAB interop code and runs fine with SDA. So not sure if python optimization method not as robust as lsqcurvefit or if something else is wrong with code.
…y however tries to call our C# Solve method. The tricky thing here is that in order to use Solve we have to determine a way for python to create a "func" that can be read by our C# code. When this is executed, an error about the "func" not being of the correct format is given.
…A as model function! I would like to compare results with MATLAB generated results. I updated r-of-rho-multi-op-prop-inversion-using-csharp.py to have updates made.
…ta as in vts_solver_demo.m, however found error in vts_solver_demo Example 18 last line of code. Error should show error between recovered chromophore concs and measured, it currently shows error of first 3 R(rho) estimates for measured and recovered. Updated the -csharp-solve accordingly.
…fixed typo in header.
…nning yet but didn't want to loose my work.
…...]. This version flattens data in order [op1fx1 op2fx2 op3fx1 ...]. These two version give same results. For both it bothers me that Chi2 converged is larger than initial guess. I thought reordering of flattened data would change something but it didn't. I guess that makes sense.
…eration values to be the chromophores not mua.
….. results using python optimization and C# Solve are identical.
…... script but having trouble converting IScatterer.GetMusp(wavelength) to an array that python understands.
…tasets for some reason.
…ts as lscurvefit provides.
…. No wonder results look so good. Here I am using PointSourceSDA. This is the reason results don't match.
… being performed.
…pyter notebook script
…r')" lines once I exited PowerShell and reentered. Y-axis units missing on one.
|
@lmalenfant, I am ready for review on this PR. |
lmalenfant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled the code locally and everything runs great, I just noticed an inconsistency in the axis label for wavelength and noted it in the code.
| opsFit = Tissue(chromophoresFit, scatterer, "", n=1.4).GetOpticalProperties(wavelengths) | ||
| rOfRhoFit= forwardSolverForInversion.ROfRho(opsFit, rho) | ||
| # plot the results using Plotly | ||
| xLabel = "wavelengths [nm]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the other plot this is singular, we should keep it consistent for both plots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Thanks!
So far we have 3 inversion command line scripts:
The optimization is performed by a python library scipy.
Currently 1) and 2) provide identical results
The optimization is performed by a python library scipy.