SimonBiggs / npgamma

Using numpy broadcasting to find the gamma index
GNU Affero General Public License v3.0
19 stars 7 forks source link

Notes #3

Closed SimonBiggs closed 7 years ago

SimonBiggs commented 8 years ago

Create a function which has an analytical solution of gamma. Maybe a cube flat in the centre, and another cube "perpendicular". With corners at each face of the original.

Include commented AGPL3+ licence at top of npgamma notebooks.

Swap the distance dose thresholds around. Fix up the examples.

Update pypi.

SimonBiggs commented 7 years ago

Determine mathematically what gamma should be for a 3D displaced cube, 1mm in x direction, 2mm in y, and 3mm in z. The cube has one with 1% dose higher than the other. They are surrounded by 0% dose.

Or do I just use a few generic shapes for regression testing? Make a few generic scenarios for 3D, 2D, and 1D. Determine what npgamma says now. Use them for regression testing and then refactor the code.

The results of those tests can be given. Someone can mathematically determine if they are what they should be.

Some unit tests. Confirm that every point has a point no further away than the step size within the coords to check. Do a regression test for the coords to check functions for each dimension

Do a regression test for the min dose difference functions

Regression test of the gamma results themselves.

Some refactor ideas Keep coordinate order consistent throughout. Define coordinates within dictionary so that a for loop can be done stepping through the keys. Have just the key "x" for 1D, have the keys "y, x" for 2D, and the keys "y, x, z" for 3D.

robmarkcole commented 7 years ago

My colleagues thesis may be a useful resource, he compares the gamma index calc'd by various software http://epubs.surrey.ac.uk/808445/1/M%20Hussien%20PhD%20thesis.pdf

SimonBiggs commented 7 years ago

I'd be very keen for your collegue to have a look at npgamma. If the code is hard to read let me know where it is more difficult and I'll happily fill it up with comments as requested. It'd be great for someone who has looked at a range of gamma implementations to have a look through the code.

robmarkcole commented 7 years ago

The relevant function being calculate_gamma(), perhaps you could write a short paragraph on this iterative method, since I know he is not familiar with python, then I will approach him?

SimonBiggs commented 7 years ago

Sounds good. I have a few ideas to make the code a bit more readable anyway. Let me get back to you in a couple days.

On Wed, 7 Dec 2016, 12:25 AM Robin notifications@github.com wrote:

The relevant function being calculate_gamma(), perhaps you could write a short paragraph on this iterative method, since I know he is not familiar with python, then I will approach him?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SimonBiggs/npgamma/issues/3#issuecomment-265148186, or mute the thread https://github.com/notifications/unsubscribe-auth/AGQVe9BbKVleOQXOx4MxIJRXazxIWcTkks5rFWGdgaJpZM4HfNd9 .

robmarkcole commented 7 years ago

OK. Btw this is some code J. Kerns produced which may be useful

https://gist.github.com/jrkerns/9acd9c3c74aed05ab81cf756ad3be7f1

SimonBiggs commented 7 years ago

I haven't had a look into that alternative Sobel filter method. Does it equivalent results? Does it have issues with lack of interpolation?

On Wed, 7 Dec 2016, 12:40 AM Robin notifications@github.com wrote:

OK. Btw this is some code J. Kerns produced which may be useful https://gist.github.com/jrkerns/9acd9c3c74aed05ab81cf756ad3be7f1 http://url

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SimonBiggs/npgamma/issues/3#issuecomment-265149629, or mute the thread https://github.com/notifications/unsubscribe-auth/AGQVe0AP69t3-Vfnp6dEiAE3HakCdoSmks5rFWM-gaJpZM4HfNd9 .

robmarkcole commented 7 years ago

Hi Simon, I have only briefly tested the code, and stopped when I got the error about the grids not matching. Will take another look over Xmas break. Cheers

https://github.com/robmarkcole/Useful-python-for-medical-physics/tree/master/Experiments%20in%20ipython%20notebooks/Archive/pygamma

SimonBiggs commented 7 years ago

Initial notes given here are either complete or represented within another issue.