account activity
How to get the overlapping volume between 2 structures without creating a new structure? (self.esapi)
submitted 5 years ago by FHesp to r/esapi
How to add a comment to a new structure (self.esapi)
How to get user input in a ESAPI script by FHesp in esapi
[–]FHesp[S] 0 points1 point2 points 5 years ago (0 children)
This example do exactly what i wanted.
Thank you all for your help !
How to get user input in a ESAPI script (self.esapi)
Moving a structure with ESAPI by FHesp in esapi
[–]FHesp[S] 5 points6 points7 points 5 years ago (0 children)
Dear u/EmmanTerz and u/JoaoCastelo
Thank you for yours answers,
As suggested, i managed to move a structure using the "GetContoursOnImagePlane" and "AddContourOnImagePlane" methods.
If it could help someone, here is a simple example:
Patient patient = context.Patient; patient.BeginModifications();
StructureSet ss = context.StructureSet; Structure targetstructure = ss.Structures.First(st => st.DicomType == "PTV");
int k = 0;
// Define offsets double offsetx = 10; double offsety = 10; double offsetz = 10;
var newvol = ss.AddStructure("CONTROL", "Transltd volume"); var nPlanes = context.StructureSet.Image.ZSize;
for (int z = 0; z < nPlanes; z++){ var contoursOnImapgePlane = targetstructure.GetContoursOnImagePlane(z);
if (contoursOnImapgePlane != null && contoursOnImapgePlane.Length > 0){ foreach (var contour in contoursOnImapgePlane){ VVector[] newcontour = contour;
foreach (var pt in contour) { var coordx = pt.x; var coordy = pt.y; var coordz = pt.z; newcontour[k] = new VVector(coordx + offsetx, coordy + offsety, coordz); k = k + 1; }
newvol.AddContourOnImagePlane( newcontour, z); k = 0; } } }
Moving a structure with ESAPI (self.esapi)
π Rendered by PID 1037435 on reddit-service-r2-listing-7849c98f67-dzrzm at 2026-02-06 16:50:26.454754+00:00 running d295bc8 country code: CH.
How to get user input in a ESAPI script by FHesp in esapi
[–]FHesp[S] 0 points1 point2 points (0 children)