pylinac icon indicating copy to clipboard operation
pylinac copied to clipboard

Trajectory log results are different on different computers

Open bozhikovstanislav opened this issue 4 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

The calculation are different on different computers .

There is problem in core directory file image.py

change it with float32 to float64 fixed it

the numpy array must be of type np.float64 !! . .

40 img = load(path, dtype=np.float64)

. . . 624 img_x = spf.sobel(ref_img.as_type(np.float64), 1) 625 img_y = spf.sobel(ref_img.as_type(np.float64), 0)

this fixed it

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

bozhikovstanislav avatar Aug 02 '19 09:08 bozhikovstanislav

Can you give me some more context here? What exactly is different and why is float64 consistent but float32 isn't?

jrkerns avatar Aug 22 '19 01:08 jrkerns

https://stackoverflow.com/questions/13421159/different-result-of-same-numpy-mean-calculation-on-two-computers?fbclid=IwAR2UJkbKazO4RSA8pE-aA4ZrCwwYN3annKmJOi47qbkVvNC9J8g4VjyEo4E

here is explained

On Thu, Aug 22, 2019 at 4:50 AM James Kerns [email protected] wrote:

Can you give me some more context here? What exactly is different and why is float64 consistent but float32 isn't?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jrkerns/pylinac/issues/189?email_source=notifications&email_token=ABTLNLWV3FKZM7BHA554GGDQFXWETA5CNFSM4II33P72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD43TXKA#issuecomment-523713448, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTLNLRMR5NI52IE4WM7OXTQFXWETANCNFSM4II33P7Q .

bozhikovstanislav avatar Aug 22 '19 04:08 bozhikovstanislav

I found that when my professor is doing the same calculation on his computer . the results were differed than that of my computer . after changing np.float32 to np.float64 . everything go the same ... as it was mention in the link above . it is related on how numpy library is manipulating big set of array .... this is what I can say ..

bozhikovstanislav avatar Aug 22 '19 06:08 bozhikovstanislav