jrkerns / pylinac

An image analysis library for medical physics
https://pylinac.readthedocs.io/en/latest/
MIT License
153 stars 98 forks source link

FlatSym problem #302

Closed myaqoub closed 3 years ago

myaqoub commented 4 years ago

Hi, Im trying to follow the same steps in tutorial to use FlatSym, I used:

my_img = FlatSym(path=my_file)
my_img.analyze(flatness_method='varian', symmetry_method='varian', vert_position=0.5, horiz_position=0.5)

but got this error:

<ipython-input-48-0bda45c5e24c> in <module>
----> 1 my_img.analyze(flatness_method='varian', symmetry_method='varian', vert_position=0.5, horiz_position=0.5)

C:\ProgramData\Anaconda3\lib\site-packages\pylinac\flatsym.py in analyze(self, flatness_method, symmetry_method, vert_position, horiz_position, vert_width, horiz_width)

C:\ProgramData\Anaconda3\lib\site-packages\pylinac\flatsym.py in _calc_symmetry(self, method, vert_position, horiz_position, vert_width, horiz_width)

C:\ProgramData\Anaconda3\lib\site-packages\pylinac\flatsym.py in _get_vert_profile(self, vert_position, vert_width)

AttributeError: 'FlatSym' object has no attribute 'array''

I tried this change:

my_img = FlatSym.open_path=(my_file)

but got this error:

<ipython-input-50-0bda45c5e24c> in <module>
----> 1 my_img.analyze(flatness_method='varian', symmetry_method='varian', vert_position=0.5, horiz_position=0.5)

AttributeError: 'str' object has no attribute 'analyze'

not sure what I'm doing wrong here?

jrkerns commented 4 years ago

Downgrade to 2.3.1 and you should be fine. 2.3.2 has a bug in the flatsym module.

crcrewso commented 4 years ago

I'm trying to extend FlatSym to also be able to handle SNC IC Profiler data. I can see a couple ways to do this.

  1. Convert the profiler data to an array of floats with 0's for all non-measured cells
  2. Leave each profile as individual axes and create a new array init for each file format/data type

Is there a fix for the 2.3.2 regression? it's getting in the way of my testing.

alanphys commented 3 years ago

Hi James

Did my changes introduce this? I'll try and take a look.

Regards Alan

alanphys commented 3 years ago

OK, I see this has been fixed.