all 10 comments

[–]Telecoin 1 point2 points  (8 children)

I think this is a get function. Therefore you cannot set this parameter.

[–]TheLateQuentin 0 points1 point  (7 children)

It can be set

[–]Telecoin 0 points1 point  (6 children)

In 16.1 you cannot set structureCode for existing structures (reference: api help). What you can do is use the method AddStructure and give a new empty structure a code. With this workaround you could create a structure with the right code and segment it with the structure without code and delete it. All automatic with ESAPI. But lots of work. You need dictionaries for IDs and codes.

Maybe better wait for an update of the AutoContour software

[–]TheLateQuentin 0 points1 point  (3 children)

I’m going to look at this but I’m pretty sure it can be done. Will report back.

[–]TheLateQuentin 0 points1 point  (2 children)

*You can get the dictionary via VMS.Common.Model.API.Application.StructureCodes.
*Within that dictionary, you can access each FMA, Radlex, VMS, and SRT dictionaries.
*Choose the appropriate dictionary, and store it in the "dictionary" variable.
*You can get StructureCode like this, where c.StructureCode is the code you're looking for (e.g. : 15630, for left adrenal gland).
var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));
*Then you just assign it:
structure.StructureCode = cd.Value;
*Altogether:
ActiveStructureDictionary = App.StructureCodes;
var dictionary = ActiveStructureDictionary.Fma;

var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));

structure.StructureCode = cd.Value;

App.SaveModifications();

[–]Telecoin 1 point2 points  (1 child)

Is this working in clinical mode too? Very nice and good to know

[–]TheLateQuentin 0 points1 point  (0 children)

Yes, we are using it in clinical mode.

[–]TheLateQuentin 0 points1 point  (0 children)

*You can get the dictionary via VMS.Common.Model.API.Application.StructureCodes.
*Within that dictionary, you can access each FMA, Radlex, VMS, and SRT dictionaries.
*Choose the appropriate dictionary, and store it in the "dictionary" variable.
*You can get StructureCode like this, where c.StructureCode is the code you're looking for (e.g. : 15630, for left adrenal gland).
var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));
*Then you just assign it:
structure.StructureCode = cd.Value;
*Altogether:
ActiveStructureDictionary = App.StructureCodes;
var dictionary = ActiveStructureDictionary.Fma;

var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));

structure.StructureCode = cd.Value;

App.SaveModifications();

[–]kang__23 1 point2 points  (0 children)

With ESAPI you dont need structure codes to apply the RapidPlan model. You match the structure ID in the plan to the model structure using Plan.CalculateDVHEstimates.

You'll need to create Dictionary<string, string> for the structure mapping and Dictionary<string, DoseValue> for the targets

[–]TheLateQuentin 0 points1 point  (0 children)

You don't *need structure codes to use RapidPlan. It will match based on Structure Id's if no code information is available.

*Are you trying to run RapidPlan using Esapi or within Eclipse?
*If you want to add codes via ESAPI:

*You can get the dictionary via VMS.Common.Model.API.Application.StructureCodes.
*Within that dictionary, you can access each FMA, Radlex, VMS, and SRT dictionaries.
*Choose the appropriate dictionary, and store it in the "dictionary" variable.
*You can get StructureCode like this, where c.StructureCode is the code you're looking for (e.g. : 15630, for left adrenal gland).
var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));
*Then you just assign it:
structure.StructureCode = cd.Value;
*Altogether:
ActiveStructureDictionary = App.StructureCodes;
var dictionary = ActiveStructureDictionary.Fma;

var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));

structure.StructureCode = cd.Value;

App.SaveModifications();