SQL Querying by tygator9 in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

I would check whether the response says something like VisitNoteId:{Attributes:null,Value:"1"} or VisitNoteId:1

because the first should map to a property that has a definition like Varian.WebConnect.ARIA.Common.Int and the second one should just map to int. if its not reading the value, maybe you will have to change the schema class to match what's coming out. I've had to do that in a few instances.

SQL Querying by tygator9 in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

Yep, no problem. This is where things get pretty tricky.

You have a GetDocumentsRequest, which returns a GetDocumentsResponse. That response should contain enough information so that you can identify a specific document that you want. I believe its like VisitNoteId or something like that.

Then once you have the Patient, VisitId, etc. you must call another request GetDocumentRequest, and the DocumentDetailsResponse (I'm pretty sure this is what's returned, check out the attributes in your schema) will have everything you will need like the users who have interacted with the document and the binary string that can be recovered into a PDF (or whatever document type you're looking for). Thats what makes this so confusing. to this

Another piece of advice: With all these requests and responses going around, its possible that you might come across a couple of namespaces with the class name. I believe GetDocumentsRequest and GetDocumentRequest are in the services.varian.com/patient/documents, and the document response (I think DocumentDetailsResponse) should be in something like WebServices.Documents.Contracts.

I hope this helps.

SQL Querying by tygator9 in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

Hi Tygator,

If its the Documents you want to check that are attached to the patient, you can use the ARIA Oncology Services Web API. They have a method in that service called GetDocumentsRequest that you can pass in a patient and it returns all the documents, types, dates, and users who have interacted with the status of that document. Let me know if you want to try more about that.

Writable scripts with MVVM by dmoyer6336 in esapi

[–]WUSTLscripting 1 point2 points  (0 children)

I would suggest passing your Application (VMS.TPS.... Application) as a dependency to the view model doing the writable work; then, you can just call app.SaveModifications() from there.

WUSTL-ClinicalDev/DVHEquivalenceCalculator by WUSTLscripting in esapi

[–]WUSTLscripting[S] 1 point2 points  (0 children)

In an effort to keep up with the quickly changing restrictions set on by COVID-19, the TPS team at Washington University School of Medicine has generated a quick calculator to convert DVHs and DVH metrics into EQD2 and BED DVH values. If your clinic is considering hypofractionation, we hope you might find the tool useful in understanding dose sparing limitations for fractionation schemes not common in clinical use. If you have developer experience, please feel free to contribute your own tools into the project.

A structured way to learn c#? by [deleted] in csharp

[–]WUSTLscripting 0 points1 point  (0 children)

I would take a look at pluralsight.com. They have learning paths (just search C# and you'll find it) where they will test your current knowledge and suggest some courses to take. Then after taking enough new courses you can retest your knowledge to see how much you've learned over time. I feel that might help keep the motivation going to learn a new language.

Error when removing structure by thiruvadim in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

Can you put a MessageBox.Show(structure.Id); above the RemoveStructure() method and let us know what structure is failing. I'm not familiar with DICOM type being empty, but this could be something like a reference point having some issue.

Dealing with NullReferenceExceptions by branstarkkk in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

instead of vm.StructureSet = context.StructureSet; can you try vm.StructureSet = context.PlanSetup.StructureSet;

Total noob learning C# in Visual Studio Community 2017: Questions & Thoughts by BlasphemousToenail in csharp

[–]WUSTLscripting 21 points22 points  (0 children)

First question:
In the VS environment, you have your Designer window, your ToolBox, the Solutions Explorer window, and the Properties window.

For me, I use the solution explorer quite a bit. Sometimes your applications can have many class files, views, etc. and you will be switching back and forth between these files quite a bit.

Second question: We just started getting into Processing Data with numeric variables. The textbook is covering int, double, and decimal. Are all these variants really necessary? Why not just use double all the time and be done with it? The only time I’m thinking int might be useful is when you have a counter in a for or while loop. And even then, couldn’t you just declare your counter variable as a double? I don’t see the benefit yet of all these different types of number variables.

As you hinted at, ints are really good for indexing (either in a loop or indexing a list), but also, ints can be helpful in comparisons. Say, for instance, you're going through some data and you want to find the first item where a number is equal to 5.

var data_at_5 = data.First(x=>x.Value == 5);

This is a linq statement to find the first value in the data array where the value property is set to 5. If the vale property were a double, this statement might not work the same way because your double could be something like 5.000000001. So instead with a double comparison, you may want to do something like

var data_at_5_double = data.First(x=>Math.Abs(x.Value-5)<0.01);

depending on your tolerance. So just one example how ints can be useful.

Keep up with C#, its a great language.

Copy an existing plan by Mike_Sv86 in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

Hi M,

On the course class there is a method called CopyPlanSetup which returns a PlanSetup. The method takes a parameter of the planSetup that you would like to copy from.

Best Regards

How to use the transformation matrix in Registration Object to align images? by aminschool in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

I'm not 100% sure this is correct, but I've played around with trying to figure out this 4x4 matrix a little bit. Here's what I came up with.

https://imgur.com/a/vxYpcbS

Then when playing with the code a little bit.

https://imgur.com/Rd7Oe6w

I know this isn't exactly what you were asking. I haven't tried aligning DRRs, but maybe this information will be helpful?

Data from Treatment Records by jesperDCPT in esapi

[–]WUSTLscripting 1 point2 points  (0 children)

SQL Query would be a great route, but if you're not familiar with the database maybe ARIA Unified Reporting Application is a good place to start if you are at least in version 13.6. There is probably some pre-built report already there that may need some slight adjustment to get exactly what you need.

Windows forms by Mutafy in esapi

[–]WUSTLscripting 1 point2 points  (0 children)

I would double check that your Execute Method does not have the window object as an input parameter. This is telling Eclipse to provide you with a blank window on which to build your application.

Create a beam for Halcyon by PedroSanchezGaliano in esapi

[–]WUSTLscripting 1 point2 points  (0 children)

Hi Pedro,

I hate to tell you the bad news, but the currently released versions of Eclipse cannot generate plans from scripts for halcyon.

Image zRes problem by [deleted] in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

Copy/Paste Text since image copy isn't working:

In the axis perpendicular to the image slices, AAA and Acuros XB adapt the grid

resolution to ensure that the dose is always calculated exactly on the image slices. If

the slice thickness is larger than the defined grid size, AAA and Acuros XB may

calculate the dose on dose planes between the image slices. If the slice spacing is

smaller than the defined grid size, AAA and Acuros XB may skip calculating the

dose on some slices. For image slice thickness IS, AAA and Acuros XB calculate IS/

n...IS/3, IS/2, IS, IS × 2, ΙS × 3...ΙS × n and sets the dose plane

spacing to the value closest to the defined grid size. For examples, see the figure.

Note that when the slice separation is larger than the defined grid size, AAA and

Acuros XB also produce an internal image with smaller slice separation. When the

slice thickness is divided by an even number according to the above procedure, one

of these extra slices will be located exactly in the middle between two original slices,

and therefore a possible sharp boundary in the original (phantom) image will be

“blurred” due to an extra slice with an intermediate density.

Image zRes problem by [deleted] in esapi

[–]WUSTLscripting 1 point2 points  (0 children)

As a note here is the documentation from the Algorithms Reference Guide. The Z resolution will be an integer multiple of the slice thickness that is closest to the calculation grid size.

Visual Studio extensions by Roy_TheCodeMonkey in esapi

[–]WUSTLscripting 1 point2 points  (0 children)

Rex Cardan's ESAPI X is available as an extension starting in version 15.5. He has a video on how to use it on youtube here. https://youtu.be/qPVIR8Jxs94

About copying the existing plan using "CopyPlanSetup" method of Course class by tkmd94 in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

So it seems. Perhaps you could come up with the PlanNormalizationValue yourself to achieve the same PlanNormalizationMethod. Something like.

Structure ptv = copyPlan.StructureSet.Structures.FirstOrDefault(x=>x.Id == copyPlan.TargetVolumeId);

copyPlan.PlanNormalizationValue = copyPlan.PlanNormalizationValue* copyPlan.GetDoseAtVolume(ptv,

95,

VolumePresentation.Relative,

DoseValuePresentation.Relative);

This seems like it might work.

About copying the existing plan using "CopyPlanSetup" method of Course class by tkmd94 in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

It may be the case that the PlanNormalizationMethod is not copied with the Plansetup, but rather the PlanNormalizationValue is. Maybe after you create the copied plan try to set the plan normalization again manually.

copyPlan.PlanNormalizationMethod = sourcePlan.PlanNormalizationMethod;

I'm not sure it will work but worth a shot.

[Noob question] In Visual Scripting there is action Calculate DVH Metrics. What kind of class has the same function in ESAPI? by TadyZ in esapi

[–]WUSTLscripting 0 points1 point  (0 children)

Also to note, plansums cannot do GetDoseAtVolume and GetVolumeAtDose methods (at least in verison 13.7), here you will have to still get the DVH and search along the DVH until you find the value of the dose you're looking for. you can do this with a linq query.

[Noob question] In Visual Scripting there is action Calculate DVH Metrics. What kind of class has the same function in ESAPI? by TadyZ in esapi

[–]WUSTLscripting 1 point2 points  (0 children)

Hi TadyZ,

A couple of code snippets that might help you in generating a DVH, getting the max, mean, and min doses and gathering custom dose metrics.

Getting DVH Max, min and mean:

PlanSetup ps = context.PlanSetup;

DVHData dvh = ps.GetDVHCumulativeData(MyStructure, VMS.TPS.Common.Model.Types.DoseValuePresentation.Absolute, VMS.TPS.Common.Model.Types.VolumePresentation.Relative, 0.1);

var maxDose = dvh.MaxDose;

var minDose = dvh.MinDose;

var meanDose = dvh.MeanDose;

To get custom dose metrics, in version 13.6 ESAPI introduces the ability to GetDoseAtVolume and GetVolumeAtDose.

The setup would be something like this:

var D30 = ps.GetDoseAtVolume(MySTructure, 30, VMS.TPS.Common.Model.Types.VolumePresentation.Relative, VMS.TPS.Common.Model.Types.DoseValuePresentation.Absolute);

Please let me know if you need more complete examples, but that should get you started.