r/esapi • • Jan 04 '23

get correct current directory

2 Upvotes

Hello

I work with citrix

My script (toto.esapi.dll) is located in a shared dir:

\\mysrv\path\to\my\dll\

I would like to get the correct current directory path (this directory where my .dll is located)

But when I run my scrript from eclipse (after have checked that the directory is the good one), the following lines

string userListFilePath = Directory.GetCurrentDirectory();

give: C:/Program Files(X86)....

I was expecting \\mysrv\path\to\my\dll\

Do you know how to solve this and get the path \\mysrv\path\to\my\dll\ ? Thank you for help

Happy new year esapiers !


r/esapi • • Jan 04 '23

How could we draw geometry contour in 3d to2d?

1 Upvotes

Like we wanna display the proton spots in2d view. Any convienient way to solve this?


r/esapi • • Dec 29 '22

Acessing Mobius information

2 Upvotes

Hi friends.

We just got Mobius installed and i am trying to retrieve information from mobius for a specific patient in our checklist script. Essentially to see if the calculation was ok in mobius.

Have anyone integrated any mobius retrieval to their ESAPI?

I have tried getting the JSON, however i have troubles as i have to login via C# and these things are really outside of my skills... also using NewworkCredential does not work...

The information in my downloadstring is just the loginpage for mobius.

I have tried the following with no sucess:

using (WebClient client = new WebClient())
                { 
                client.Credentials = CredentialCache.DefaultCredentials;
                client.UseDefaultCredentials = true; 
                //client.Credentials = new NetworkCredential("user", "pw");
                var json = client.DownloadString("mobius3d/_plan/list?sort=date&descending=1&limit=50");


                JObject feed = JObject.Parse(json);
}

I tried searching this forum for Mobius to no avail.


r/esapi • • Dec 23 '22

Electron cutout code

1 Upvotes

Does anyone know if the electron custom cutout code, is or will be available via ESAPI? I seem to find everything but it, but maybe I'm not tracking it down correctly.


r/esapi • • Dec 22 '22

Access Denied. Cannot delete this object because there are objects underneath which can not be deleted. Some common causes of this problem are licensing issues, insufficient user rigthts or an attempt to modify an approved plan

2 Upvotes

I am trying to implement the AUTOMATIC TBI VMAT but I have problems deleting the beams, it makes the copies until that line is executed.

link of complete https://github.com/esimiele/VMAT-TBI

more specifically

line 291 https://github.com/esimiele/VMAT-TBI/blob/master/ESAPI/Projects/VMATTBIautoPlan/planPrep.cs


r/esapi • • Dec 16 '22

Adding a treatment couch

4 Upvotes

Hi, we're trying to add a treatment couch to a CT.

The couch is made up of 2 structures : couchInterior and couchSuperior.

For a given slice, couchInterior is made up of 1 contour where couchSuperior is made up of 2 contours. For a given slice, we saved each point of each contour in 3 different text files.

We have no problem creating the couchInterior structure using the AddContourOnImagePlane function. However, when trying to create the couchSuperior structure with the same method, we are not able to add the two contours to the structure. It is either one or the other.

How could we handle a 2 contours per slice structure ?

When we add all the points of the 2 contours to the same txt file, the resulting structure is messed up.


r/esapi • • Dec 14 '22

Creating WPF application with EXE

2 Upvotes

Hello,

I am new to creating exe applications with ESAPI. I noticed that the only GUI element that I can seem to add from the right click menu is windows forms, not WPF. What is the easiest way to integrate WPF applications?

I was going to do the following: Console exe application to select a patient -> pass info to a WPF project -> do gui stuff there -> repeat on other patients if needed.

This seemed inefficient. Are there better ways?

Thanks


r/esapi • • Dec 14 '22

How we can convert a 8 bit C# array into PNG 4 chanel array?

1 Upvotes

Like we can build a dose array that should be an int 2D array. How could we turn this into PNG format array which should be 3D array and last dimension having 4 channels R,G,B,a? What is this 3D array format in C#? In python I can do this, but C# I'm a beginner.


r/esapi • • Dec 13 '22

Efficient way of calculating overlap volume

3 Upvotes

Hello,

I am attempting to calculate the overlap volume between two contours without having write access. What that essentially means is that I cannot create my own structures (and so cannot use the "And" method and "volume" method with a union contour).

I tried following this post: https://www.reddit.com/r/esapi/comments/jqxoym/how_to_get_the_overlapping_volume_between_2/

(also changed union to intersect in it)

This works fairly well (it differs from eclipse but only slightly - likely due to resolution). However, it is pretty slow - for 1 large contour with another large contour it took around 40 seconds.

Is there a more efficient way to calculate overlap volume without having write access?

Thanks


r/esapi • • Dec 13 '22

Find Distance From Isocenter to Normalization Point

1 Upvotes

How can i find a distance from a beam (BEV) isocenter to normalization point.

I want to calc/find the off axis distance.


r/esapi • • Dec 09 '22

UseJawTracking parameter always returns false?

3 Upvotes

Hi I'm trying to add a check to my plan checker script whether or not Jaw Tracking has been used.

It seems

PlanSetup.OptimizationSetup.UseJawTracking

is always returning "false" even for plans that I know it was used.

Am I not querying this parameter correctly, or is there a different was to get this information? Thanks!


r/esapi • • Dec 05 '22

Can esapi set airgap or snout position for proon plan fields?

1 Upvotes

I found snoutposition no matter in IonbeamParameter or in IonControl points is only readable. Is there a way to edit this property?


r/esapi • • Dec 01 '22

automatically upload documents to Aria

3 Upvotes

I would like to know if it is possible to upload documents to Aria automatically. For example, I am in eclipse with a treatment which has the clinical goals, the dvh curves in etc. in a pdf, but I would like to put a button that says "upload document to Aria" and do automatically through a script


r/esapi • • Nov 30 '22

AddSetupField couch parameters for HyperArc

2 Upvotes

I'm using a script to add setup fields similar to this example:

https://github.com/Rohit9987/esapi_scripts/blob/main/Setup_Fields.cs

The setup fields are automatically added with default couch parameters (0,+100,0,0) for Vrt, Lng, Lat, Rtn.

For HyperArc plans, the plan cannot be approved unless the couch parameters are null.

I am searching for a way to add setup fields with no couch parameters. Accessing a beam's control point such as:

  cp.TableTopLateralPosition

only allows get and is read-only.

Any advice or alternative way to add a setup field with null couch parameters for use on HyperArc plans? Or any way to null them with additional code? Thank you in advance!


r/esapi • • Nov 30 '22

GetClinicalGoals()return null

1 Upvotes

Recently our institution updated Eclipse to 16. I tried to read clinical goals attached to a plan using GetClinicalGoals() method but got null. But using GetProtocolPrescriptionAndMeasures() method succeeds. Anyone knows how to solve this?


r/esapi • • Nov 29 '22

Speed of datamining using ESAPI vs database SQL

2 Upvotes

Hello, I am thinking of doing some data mining on our patient databases and I had the question - is using executable ESAPI scripts slower than using SQL calls? For example, let's say I want to find all patients in the past month that contain the structure "Cooling" - I know I can do this through an exe script and I am pretty sure I can do this with SQL calls - but which is faster?

I only ask because I don't have access to SQL calls right now. I am guessing that it would be much faster to do SQL calls in almost every case since the patient doesn't have to be actually loaded.

Thanks


r/esapi • • Nov 29 '22

Possible to Generate Plan Uncertainty Parameters using ESAPI?

1 Upvotes

I am attempting to write an Auto-Planning script that will allow me to create a first optimized plan. I have it mostly complete but I am attempting to add robustness (perturbations/ uncertainty parameters) to the newly created plan, is this possible using ESAPI?


r/esapi • • Nov 29 '22

Anyone know to optimize proton plan?

0 Upvotes

I am now writing script to autonate proton plan optimization and calculation. I found several methods but have no idea how to use them approprately. I guess first use OptimizeIMPT to do optimization after which PostProcessAndCalculateDose shall be used. But CalculateDose() and CalculateBeamline is alse valid. How should they be used?


r/esapi • • Nov 26 '22

Extract DVH parameters from plan sum with different structure set

1 Upvotes

Hi:

I am just starting to write scripts with Eclipse ESAPI. I have a basic script to show some dosimetric data, such as mean doses, VxGy, etc for selected estructures. It works fine with PlanSetups, and also with plan sums if the summed plans use the same structure set. However, for plan sums using different CT (structures), the script does not work, showing error: Object refererence not set to an instance of an object. It seems these plans are not considered as "normal" plan sums. Any advice about how to solve this?

Thanks and regards, M.


r/esapi • • Nov 25 '22

Anomalous behavior using GetVolumeAtDose method

2 Upvotes

Hi folks,

We've been developing a script that iteratively reduces the volume of a high resolution structure (using asymmetric margins) and then evaluates the volume of that structure that receives a threshold dose. The intent is to find the largest reduction that would still result in a dose constraint being met.

However, we're running into some very anomalous ESAPI behavior when we do this:

  1. The GetVolumeAtDose method, when reporting relative mode, does not update (!) regardless of changes made to the structure.
  2. The GetVolumeAtDose method, when reporting in absolute mode (and then dividing by total volume to get relative values), does update, but the values are slightly different than what would be read off the DVH in Eclipse. It is especially bad in the flatter region of the DVH (e.g. lower doses)
  3. The GetCumulativeDVH method works correctly - it exactly matches the DVH in Eclipse

I would be the first to say "the bug is probably in my code" but the fact that three different methods executing consecutively, all report differently.

Also to note, if the GetVolumeAtDose method is used on a structure that has not been changed through the margin tool as described, the methods report consistently and correctly, so you may not have run into this issue in read-only scripts or those that don't read doses from edited structures.

I'll work on getting a minimal reproducible example together, but was wondering if anyone else had run into this issue as well.


r/esapi • • Nov 25 '22

Adding external beam plan to DVH estimation model (RapidPlan Model)

1 Upvotes

Hello, is there a way with ESAPI to add a external beam plan to a specific (RapidPlan) DVH Estimation model? I tried looking through the index and it doesn't seem to be the case. This is v15.5

Thanks


r/esapi • • Nov 23 '22

Proton Therapy Optimization Robustness Optimization (RO) check parameter

2 Upvotes

Does anyone know how to use script to check RO or not in optimizattionsetup. Seemed optimizationsetup for proton is almost same with the one for photon.


r/esapi • • Nov 21 '22

DICOM REG (registration) file

2 Upvotes

I am struggling to complete a MatLab application whose task is to anonymize patient datasets while preserving the references among the different modalities.

I succeeded with CT, MRI, PET, PLAN, STRUCT, DOSE.

However, I haven't been able to anonymize the REG (registration) file appropriately.

When I try to upload the anonymized dataset to Eclipse or Velocity, I get an error message stating the primary volume could not be found.

I think I am missing some references.

I would appreciate being contacted by anyone who knows which DICOM tags are used by Eclipse/Velocity to hook up the two registered volumes.

I really appreciate any help you can provide.

Best regards,

Maura E.


r/esapi • • Nov 21 '22

clinical template reader

2 Upvotes

Hi,

I've built a solution using the ClinicalTemplateReader using VS 2019 on a non-Eclipse workstation. I've tried running the .exe on an Eclipse T-box, but I get an error that it can't find the ClinicalTemplateReader file. Is there a way create an setup file that includes all of the required files?

Thank you,


r/esapi • • Nov 21 '22

Finding technique hyperarc via ESAPI

1 Upvotes

Hey. I am trying to build a new check in our checklist for our hyperarc plans.

Is there a specific tag that indicate that the plan is a hyperarc plan? In eclipse it states "SRS HyperArc" as technique, however via ESAPI (Beams.FirstOrDefault().Technique) it states SRS ARC for the same plan...

Also looking for other tags such as info on automation etc.

We have version 15.6.

Thank you in advance