How to get the following info from Brachy treatment plan

Developer
Dec 11, 2015 at 8:26 PM
I am working on a project which need the following info from Eclipse API or Aria database for a Brachy treatment plan:
1> Minimum time in Catheter
2> Source Treatment Activity
3> Total Air Kerma Strength
4> Total Curie Seconds

Note: The last three items can be viewed from TreatmentPlanning->Window->Brief Report Window

I would appreciate any help or guidance you are able to give me.
Coordinator
Dec 23, 2015 at 8:13 PM
1) What do you mean by minimum time in Catheter? A minimum of all non-zero dwell times, or just sum of all dwell times?

2) Source Treatment Activity
RadioactiveSource source
double airkerma = source.Strength;
double decay =  Decay(source, plan.TreatmentDateTime.Value);
double sourceTreatmentActivity = airkerma * decay / source.RadioactiveSourceModel.ActivityConversionFactor;
where
double Decay(RadioactiveSource source, DateTime trtDate)
    {
      double halfLife = source.RadioactiveSourceModel.HalfLife;
      if (source.NominalActivity)
      {
        trtDate = source.CalibrationDate.Value;
      }
      double decayTime = -(trtDate - source.CalibrationDate.Value).TotalSeconds;
      return Math.Exp(decayTime * Math.Log(2.0) / halfLife);
    }
3) Total Air Kerma Strength
 double sumStrength = 0;
 foreach (var x in plan.Catheters)
      {
        foreach (SourcePosition sp in x.SourcePositions)
        {
          var source = sp.RadioactiveSource;
          sumStrength += sp.DwellTime * source.Strength / 3600 * Decay(source, plan.TreatmentDateTime.Value);
        }
     }
4) Total Curie Seconds
double sum = 0;
 foreach (var x in plan.Catheters)
      {
        foreach (SourcePosition sp in x.SourcePositions)
        {
          var source = sp.RadioactiveSource;
          double decay = Decay(source, plan.TreatmentDateTime.Value);
          double activityInMilliCurie = source.Strength / source.RadioactiveSourceModel.ActivityConversionFactor * decay;
          sum += sp.DwellTime * activityInMilliCurie;        
        }
     }
  sum = sum / 1000;
Developer
Dec 24, 2015 at 5:36 PM
Thank you Stuomaal.

Based on your code, the following info can be retrieved correctly.

2> Source Treatment Activity
3> Total Air Kerma Strength
4> Total Curie Seconds


Clarify "minimum time in Catheter" -- the info can be found in Applicator: CatheterID - Time[s] of TreatmentPlanning->Window->Brief Report Window too.

Here displaying Time[s] for each position of a catheter. We need get the Time[s] info and identify the min time for each catheter.

Thank you very much for your further help!

Hope you have a wonderful Christmas.

Angell
Developer
Dec 24, 2015 at 7:09 PM
Stuomaal,

I already figured out the "minimum time in Catheter".
Thanks,

Angell