Testing winston-lutz code

Hello everyone,
I a new programmer. i have written a code but it hasn’t ran and return results.
Does anyone point out my mistake in the code?
Thanks.

You will need to read the “Typical Use” section of the documentation: https://pylinac.readthedocs.io/en/stable/winston_lutz.html#typical-use

For example, if you want to view the plots you need to add:

wl.plot_images()

Randy

Untitled.png

Hi Randy.
I have read the “Winston-Lutz module documentation” section of the Pylinac Document and added few lines of command, but my code has a error is "AttributeError: ‘WinstonLutz’ object has no attribute ‘analyze’ ".
Could you explain it help me?
Thank you so much.

Vào lúc 17:29:30 UTC+7 ngày Thứ Ba, 22 tháng 6, 2021, randle...@gmail.com đã viết:

abc.png

This message was sent securely using Zix® |

  • |

I suspect it might be your address location, but not sure.

Read this:
https://stackoverflow.com/questions/2953834/windows-path-in-python

Try typing r before your string like this:
my_directory = r’C:\mydir’

Note the difference between forward slash and backslash too.

analyze was only added in the recent 3.0RC. Unless you installed it on purpose you are running v2.5 or lower. See the stable docs for usage, which does not have the analyze method: Changelog — pylinac 2.4.0 documentation

Hi James.
Thank you so much for your help.
Basing on your advice , i was fixed the error. Now i meet the problem while i run code
"C:\Users\DELL\anaconda3\lib\site-packages\pylinac\winston_lutz.py:510: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument “figsize” which is no longer supported as of 3.3 and will become an error two minor releases later
plt.savefig(filename, **kwargs)
C:\Users\DELL\anaconda3\lib\site-packages\pylinac\winston_lutz.py:481: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument “figsize” which is no longer supported as of 3.3 and will become an error two minor releases later
plt.savefig(filename, **kwargs)

Could you explain it help me?
Thank you so much.

Vào lúc 02:51:35 UTC+7 ngày Thứ Tư, 28 tháng 7, 2021, jker...@gmail.com đã viết:

abc.png

These are not errors. These are warnings (MatplotlibDeprecationWARNING). The code will run just fine. 3.0 final will fix this warning message.

Hello Dear,

I ma begining in Pylinac . I test winstonlutz ("from pylinac import WinstonLutz
my_directory=r’C:\Users\Elekta\Desktop\ZZZ_python’
w1=WinstonLutz(my_directory)
w1.analyze(bb_size_mm=5)
wl.images[3].plot()
)

I have this error message :

"============== RESTART: C:\Users\Elekta\Desktop\ZZZ_python\test.py =============
Traceback (most recent call last):
File “C:\Users\Elekta\Desktop\ZZZ_python\test.py”, line 9, in
w1=WinstonLutz(my_directory)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pylinac\winston_lutz.py”, line 136, in init
self.images = ImageManager(directory, use_filenames)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pylinac\winston_lutz.py”, line 114, in init
img = WinstonLutz2D(file, use_filenames)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pylinac\winston_lutz.py”, line 687, in init
super().init(file, use_filenames=use_filenames)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pylinac\core\image.py”, line 794, in init
super().init(path)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pylinac\core\image.py”, line 704, in init
self._original_dtype = self.metadata.pixel_array.dtype
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pydicom\dataset.py”, line 836, in getattr
return object.getattribute(self, name)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pydicom\dataset.py”, line 1882, in pixel_array
self.convert_pixel_data()
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pydicom\dataset.py”, line 1444, in convert_pixel_data
self._convert_pixel_data_without_handler()
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pydicom\dataset.py”, line 1556, in _convert_pixel_data_without_handler
raise last_exception # type: ignore[misc]
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pydicom\dataset.py”, line 1536, in _convert_pixel_data_without_handler
self._do_pixel_data_conversion(handler)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pydicom\dataset.py”, line 1563, in _do_pixel_data_conversion
arr = handler.get_pixeldata(self)
File “C:\Users\Elekta\AppData\Local\Programs\Python\Python38\lib\site-packages\pydicom\pixel_data_handlers\numpy_handler.py”, line 283, in get_pixeldata
raise AttributeError(
AttributeError: Unable to convert the pixel data: one of Pixel Data, Float Pixel Data or Double Float Pixel Data must be present in the dataset