And I get the same error when I try to use the directory option:
raise ValueError(“Invalid directory passed. Check the correct method and file was used.”)
However it works when I use: wl = WinstonLutz.from_demo_images()
However when I use the demo_images I find the second error:
AttributeError: ‘WinstonLutz’ object has no attribute ‘save_plots’
I looked into the documentation and I thought that the right attribute was ‘save_plot’ but I was wrong:
AttributeError: ‘WinstonLutz’ object has no attribute ‘save_plot’
So finally I used wl.save_summary(‘wltest.png’) and It worked.
But, in summary, the main problem is that I’m not able to use my own images of the Winston-Lutz test. (By the way I use simple ’ or " to pass the file, and it makes no difference).
Maybe it is a simple issue but I don’t know what to do. I attached my zip file so you can have a look into it.
Roberto,
The first issue is easy to fix, although it’s not intuitive. Generally speaking, when passing a file path on Windows, you need to prepend the string with ‘r’ (which stands for “raw”, meaning don’t escape the backslashes. Note how the error message string is different than what you passed in). So, pass the file like so:
`
wl = WinstonLutz.from_zip(r’C:\MATLAB\EXERCISES\portal\a.zip’) # <–note the “r” in front of the string
`
The single quote vs double quote doesn’t make a difference. This one’s annoying I know!
Unfortunately, I wasn’t able to process your images because there was no gantry/collimator/couch metadata. Can I ask what type of machine you’re using and the versions of the relevant software? I initially considered being able to pass in the values, but didn’t find images where that data wasn’t included. I may have to add that in now if this is a common issue. If anyone else experiences this issue please let me know.
Thank you James once again for your quick response:
These images were obtained with a VARIAN Clinac 600 C/D (year of purchase was around 2004). The portal vision is as500 and the software used to acquire the images is the default one by VARIAN (but I’m sorry I can’t remember the name right now) although I can tell you that it is quite simple and basic (I don’t use “TREATMENT” to obtain the images). I always use the integrated mode of this software and I get a useful image with just 8-10 monitor units. I didn’t know that this software didn’t include the gantry/col/couch position although it seems to be a dicom image. I made a MATLAB script on my own to process these images in order to calculate the distance between the center of the field and the center of the ball and it works but obviously it is not so complete as yours, and this is why I want to use it. In my script I don’t import this info but I have to introduce it manually.