Sep-18-2017, 03:30 PM
(This post was last modified: Sep-18-2017, 03:30 PM by kesenthilkumar.)
I am newbie in Python and was attracted for a specific purpose. The project deals with Medical Physics (in cancer treatment, physics is used quite a lot) and a program called Pylinac exists for certain QA. This is what drew me to Python.
A beam profile (dose vs distance ) is obtained via a phantom. This is drawn like this:
[Image: sdfdyw.jpg]
I have to draw a line on the steep portion of the curve, on left and right. The line should be drawn on the curve such that it intersects the curve only on the steep portion and not anywhere else. I have to note the intersection of the beginning of the line and the end of the line. And midpoint of the line.
I have the values of the profile in a CSV file and can draw it. But how to draw the line based on the conditions? I have no idea. What I have done is using Excel I have subtracted the y-values from its previous rows and found something interesting. When the difference is plotted, it gives a graph like this:
[Image: v67q7t.png]
I think the gradient region of the curve is the points of the line. But how to do this in Python? and How to extract the values of the start and end point?
I have no coding experience in python and would appreciate if anybody would assist/cooperate/guide me in achieving this. This would help a lot of people in many countries.
thanks and regards
keskumar
A beam profile (dose vs distance ) is obtained via a phantom. This is drawn like this:
[Image: sdfdyw.jpg]
I have to draw a line on the steep portion of the curve, on left and right. The line should be drawn on the curve such that it intersects the curve only on the steep portion and not anywhere else. I have to note the intersection of the beginning of the line and the end of the line. And midpoint of the line.
I have the values of the profile in a CSV file and can draw it. But how to draw the line based on the conditions? I have no idea. What I have done is using Excel I have subtracted the y-values from its previous rows and found something interesting. When the difference is plotted, it gives a graph like this:
[Image: v67q7t.png]
I think the gradient region of the curve is the points of the line. But how to do this in Python? and How to extract the values of the start and end point?
I have no coding experience in python and would appreciate if anybody would assist/cooperate/guide me in achieving this. This would help a lot of people in many countries.
thanks and regards
keskumar