Varian-Code-Samples icon indicating copy to clipboard operation
Varian-Code-Samples copied to clipboard

Anyway to use existing Eclipse Treatment Report Templates (stored as .tml files) in an ESAPI script which generates a report for a patient's treatment plan?

Open zackmorelli opened this issue 6 years ago • 4 comments

This is a copy of a post I made on the ESAPI subreddit, putting here as well just so people are aware:

ORIGINAL POST

r/esapi •Posted byu/zackmorelli95 10 days ago

Hi Everyone,

I am currently trying to make an ESAPI reporting script which automates a lot of the work our dosimetrists do in making reports for patient plans. Currently my department uses the "Print -> Report" feature in Eclipse to print out a text report that contains all the plan's information, and then they manually add screenshots of the planning images and DVH plots to this.

I want to create a script that does all of this all at once, as well as a pass/fail comparison for our anatomy-specific ROI criteria.

My department has put a fair amount of work into making a lot of .tml files for plan report templates of different treatment sites/types for the "Print->Report" feature. There is nothing wrong with these templates, so i would like to continue using them in my ESAPI script if possible.

Does anyone know if there is any way to do this? or if there is some other format that I could convert these .tml files into that would work with ESAPI?

Any help or insight on this would be appreciated. I am using Eclipse Version 13.6 in a citrix environment.

COMMENTS

schmatt_schmitt 4 points · 10 days ago

I don't know of anyone that has created something like this, but I'd be willing to put in a bit of effort if we wanted to work on this as a community project.

It would be some C# class wrappers to take a tml file and convert to scripting objects for reporting purposes. Some of the components will be quite easy, but others (like the linac cartoon that shows shift motions) will be more difficult. I think this is useful.

Reply Give Award Share Report Save

level 1 wkt84 5 points · 7 days ago IMO, a simple solution is below:

Create the Windows script (.vbs) which sends key stroke to Windows.

Call the script from your ESAPI scripts.

These are sample codes;

ESAPI code

System.Diagnostics.Process.Start("sendkey.vbs"); VBS code (sendkey.vbs)

Set objShell = WScript.CreateObject("WScript.Shell") WScript.Sleep 200 'Close your Script window objShell.AppActivate("Scripts") objShell.SendKeys "{ESC}"

'Send key stroke to execute "Print->Report" objShell.SendKeys "%F" objShell.SendKeys "P" objShell.SendKeys "R" Reply Give Award Share Report Save

level 2 zackmorelli95 1 point · 7 days ago oh wow! This is a brilliant idea! Thank you very much wkt84.

I never would have come up with this myself.

This should work just fine for what I want to do. The one caveat is it also needs to select the correct print template/tml file that the user usually selects in the "Layout" drop down menu. I'll see if I can make some adjustments to it to get it to work right and report back.

Thanks again.

UPDATE: I could not find a way to select the "Layout" dropdown menu on the "Print treatment report" dialogue box using SendKeys commands. This will work for printing a default template, but the whole point of what I am trying to do is access all of the different templates we have.

It is really easy and quick to print the reports using the current method in Eclipse, so finding a way to incorporate this into my reporting script is not helpful or worth it.

Eventually I will make native Migradoc/PDFSharp versions of my templates so the script can print the entire report all at once, but right now that is not the priority.

What I was looking for was a method in ESAPI where I could just call a report template in a script and print it for the active plan. This should definitely be possible. If Varian could add this to ESAPI, that would be great, as it would save me a lot of work

zackmorelli avatar May 20 '19 16:05 zackmorelli

Hi Zackmorelli, a few years have now passed. Do you have any new findings in the meantime? I am looking for the same solution as you. Kind regards

EyckBlank avatar Aug 20 '24 11:08 EyckBlank

Hi Eyck,

There is a "TML to Aria" program that was written by Landon Clark. I believe it uses the Varian web platform. Not sure where I got it from; I have an old copy of it.

However, if you want to automate treatment plan reports, using .tml files is not the way to go. I don't remember exactly why, but we went off in a separate direction making our own reports programmatically with PDF libraries. I have a few ARIA scripts I wrote that I could provide you with for doing things like that if you are interested.

I want to add that, if your clinic is big enough to support if, your clinic should really consider buying commercial software from Radformation.

zackmorelli avatar Aug 20 '24 14:08 zackmorelli

Okay, I'll take a look around and see if I have anything else, but if you look at the public repos on my github account you will find a number of ESAPI scripts licensed under GPLv3 that you are free to use. My "Dose_Objective_Check" script is along the lines of what you are looking for. Please email me at [email protected] if you have any questions.

zackmorelli avatar Aug 20 '24 15:08 zackmorelli

Hi Eyck,

I wish I had better news for you, but there is no way to use ESAPI to get good images of isodose lines of an eclipse treatment plan. Or to create a picture of an eclipse treatment plan in the way that it looks like in eclipse. This is something I put a lot of time and effort into a long time ago because I knew if generating the images required for plan reports could be automated, it would save our dosimetrists a lot of time. I was able to use ESAPI to generate crude images of isodose lines from real eclipse plans, but it was nowhere close to being good enough to use clinically. I realized at that point that I would not be able to make something good enough that we could actually use. I'm assuming it is different in Germany, but in the U.S. we need to include a bunch of detailed images in plan reports for health insurance billing purposes. Even after all the work I put into it, generating report images using the tml files in Eclipse is still the best way I know to do that. Of course commercial software you can purchase from Radformation can do that.

I also tried the idea of telling an ESPI script to make certain mouse clicks to create a plan report in eclipse via the tml files; that did not work either.

My advice to you would be to not waste your precious time pursuing those ideas (you only have so much time for research on top of working in the clinic). What ESAPI can do is automate DVH evaluation and a bunch of other plan checks for you. And my scripts generate PDF reports of all that, they just don't include images of the actual plan like you were asking about. Scripts that automate putting plan images in a report is a very big challenge that you can't do in house. It's best left to commercial software.

  • Zack Morelli

On Thu, Aug 22, 2024 at 11:57 AM Eyck Blank @.***> wrote:

Hello Mr Morelli, the last question for today. Can I control Eclipse in ESAPI ? By this I mean, for example, printing a plan report with File | Print | Protocol . . . or the selection of transversal layers and isodose levels. I have not found anything about this in the ESAPI help. My plan is to let Eclipse do as much of the report design as possible. (using tml reports, printing DVH's, printing image layers with isodoses . . . I have heard something about this topic somewhere, but I don't know where.

If necessary, I could also use macro commands made by a programmable mouse.

So that's my minds for today. Have a nice evening Eyck Blank

Rückantwortadresse:

@.***


Von: Zack Morelli @.***> Gesendet: Dienstag, 20. August 2024 16:05 An: VarianAPIs/Varian-Code-Samples Cc: Blank, Eyck; Comment Betreff: Re: [VarianAPIs/Varian-Code-Samples] Anyway to use existing Eclipse Treatment Report Templates (stored as .tml files) in an ESAPI script which generates a report for a patient's treatment plan? (#34)

Hi Eyck,

There is a "TML to Aria" program that was written by Landon Clark. I believe it uses the Varian web platform. Not sure where I got it from; I have an old copy of it.

However, if you want to automate treatment plan reports, using .tml files is not the way to go. I don't remember exactly why, but we went off in a separate direction making our own reports programmatically with PDF libraries. I have a few ARIA scripts I wrote that I could provide you with for doing things like that if you are interested.

I want to add that, if your clinic is big enough to support if, your clinic should really consider buying commercial software from Radformation.

— Reply to this email directly, view it on GitHub [github.com]< https://urldefense.com/v3/https://github.com/VarianAPIs/Varian-Code-Samples/issues/34*issuecomment-2298949505;Iw!!OTyOlAGPvQ!RvXoehjUL5GVAD_8O6BW0tAIMwO9UibBFMyTic10MpGjfgT3rMmD9zJCuc_Ak01YNgfZJ4QLZVR-6uzTs1NNwAMTjmHoDqA9rA$>, or unsubscribe [github.com]< https://urldefense.com/v3/https://github.com/notifications/unsubscribe-auth/ARM22RDM3CZII67XTPRKN2TZSNELZAVCNFSM6AAAAABMZVKBBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJYHE2DSNJQGU;!!OTyOlAGPvQ!RvXoehjUL5GVAD_8O6BW0tAIMwO9UibBFMyTic10MpGjfgT3rMmD9zJCuc_Ak01YNgfZJ4QLZVR-6uzTs1NNwAMTjmHGsNk2wg$>.

You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/VarianAPIs/Varian-Code-Samples/issues/34#issuecomment-2305116613, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJNL6JUSKUZIATZW277VNJTZSYC5LAVCNFSM6AAAAABMZVKBBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBVGEYTMNRRGM . You are receiving this because you authored the thread.Message ID: @.***>

zackmorelli avatar Aug 23 '24 18:08 zackmorelli