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

Is two structures overlap?

Open yvsblanc opened this issue 3 years ago • 7 comments

Is there a way to know if two Structures overlaps. I can use St.AND () using "SegmentVolume", but then how do I know if the result is empty? (That's what I could do with structures but then I can't use boolean...).

yvsblanc avatar Feb 26 '21 12:02 yvsblanc

Have you tried checking the Volume of the structure resulting from the Boolean AND?

fizxmike avatar Feb 26 '21 13:02 fizxmike

There is also an Structure bool „IsEmpty“ that is easy to check

Kiragroh avatar Feb 26 '21 13:02 Kiragroh

I cant'check the volume because the result is a SegmentVolume and not a structure, Then I can't either use the "IsEmpty" method

yvsblanc avatar Feb 26 '21 13:02 yvsblanc

What about looking at the volume?

Sent from Yahoo Mail on Android

On Fri, Feb 26, 2021 at 7:20 AM, yvsblanc[email protected] wrote:

I cant'check the volume because the result is a SegmentVolume and not a structure, Then I can't either use the "IsEmpty" method

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jwtx1980 avatar Feb 26 '21 13:02 jwtx1980

No. You use SegmentVolume on a Structure and can exchange this for „IsEmpty“.

example: var saumstructure = ss.AddStructure(„PTV“, saumId); saumstructure.SegmentVolume = ptv.Sub(saumstructure); if (saumstructure.IsEmpty) blaBlaBlup

Kiragroh avatar Feb 26 '21 13:02 Kiragroh

Thank you, I'll try this

yvsblanc avatar Feb 26 '21 16:02 yvsblanc

And for everyone that want to check Overlap in a Single-File-Plugin or do not have Writable scripts because of older Eclipse-Version or because of Rights-issues or because it is simpler to use. Please check out this link:

https://github.com/mtparagon5/ESAPI-Projects/blob/2a65eb5e6112276708083fbedf72ad4268dc64cc/Plugins/DvhLookups_v07.cs#L234

Very very helpful functions for ESAPI beginners but this link brings you exactly to Calculate Overlap methods. Simple Copy&Paste and you can use these methods in all your scripts. I have something similar but this is the base I found a few years ago and use it in some form till today.

Kiragroh avatar Feb 26 '21 19:02 Kiragroh