Hello Everyone,
I'm trying to determine the volume of a specific isodose level. Ultimately I will take that volume and do comparisions with structure volume (SBRT constraints: high dose spill, conformality calcs). Currently I tried two ways to calculate the volume of 105%
dose in a test plan.
 Iterate through dose matrix voxels for a given dose plane and compare voxel's dose value to see if greater then my comparison dose e.g. 105%. Do this for all dose planes and to determine volume = #counts * XResYResZRes. This was based off of the
post
https://variandeveloper.codeplex.com/wikipage?title=Code%20Sample%20%20Iterate%20through%203D%20Image&referringTitle=Eclipse%20Scripting%20Tips%20and%20Tricks
 Create a Dose Profile for a given dose origin + Y + Z Start and X End. Iterate through dose profile to find doseProfile[i].Value > Dose To Compare. Volume calculated as # countsXResYRes*ZRes. This was based off of the post
https://variandeveloper.codeplex.com/wikipage?title=Code%20Sample%20%20Dose%20Voxel%20Data&referringTitle=Eclipse%20Scripting%20Tips%20and%20Tricks.
Both methods calculate within ~1cc of each other for a prostate test plan that is calculating the volume of 105%.
1st method 2.5mm calc grid gives 40.17cc volume for 105% dose
1st method 1mm calc grid gives 38.9cc volume for 105% dose
2nd method 2.5mm calc grid gives 39.08cc volume for 105% dose
2nd method 1mm calc grid gives 38.63cc volume for 105% dose
I was wondering which of these methods was more accurate?
The part I'm a little confused about is when I manually calculate these values for comparison by converting an isodose level to structure in Eclipse I get the following:
Convert 105% to structure on 2.5mm calc grid: 38.16cc volume for 105% dose
Convert 105% to structure on 1mm calc grid: 29.99cc volume for 105% dose
An 8cc difference for the same plan depending on if a 2.5mm calc grid or 1mm calc grid is used seems large. How is the convert isodose to structure doing the conversion?
Which of the 3 methods, voxel search, dose profile, manual isodose to structure conversion is the true volume?
Thanks,
Kurt
Voxel Search Method:
Dose planDose = planItem.Dose;
int count = 0;
int[,] dosePlaneVoxels = new int[planDose.XSize, planDose.YSize];
for ( int z = 0; z < planDose.ZSize; z++ )
{
planDose.GetVoxels( z, dosePlaneVoxels );
for ( int y = 0; y < planDose.YSize; y++ )
{
for ( int x = 0; x < planDose.XSize; x++ )
{
DoseValue voxelDose =
planDose.VoxelToDoseValue( dosePlaneVoxels[x, y] );
if ( voxelDose.Dose >= doseToCompare.Dose )
{
count++;
} // End if voxelDose >= _doseToCompare
} // End for to cycle through x dimension
} // End for to cycle through y dimension
} // End for loop to cycle through z dose planes
volumeDoseTotal = ( count * planDose.XRes * planDose.YRes * planDose.ZRes );
Dose Profile Method
Dose planDose = planItem.Dose;
int count = 0;
int xcountDose = planDose.XSize;
double[] doseArrayDose = new double[xcountDose];
// Cycle through dose grid in z and y direction
for ( double z = 0; z < planDose.ZSize * planDose.ZRes; z += planDose.ZRes )
{
for ( double y = 0; y < planDose.YSize * planDose.YRes; y += planDose.YRes )
{
// counts of dose values along x for given y and z
VVector start = planDose.Origin + planDose.YDirection * y +
planDose.ZDirection * z;
VVector end = start + planDose.XDirection * planDose.XRes *
planDose.XSize;
DoseProfile doseProfile = null;
// Search for dose in x direction
for ( int i = 0; i < doseArrayDose.Count(); i++ )
{
if ( doseProfile == null )
{
doseProfile = planDose.GetDoseProfile( start, end,
doseArrayDose );
}
double planDoseValue = doseProfile[i].Value;
if (planDoseValue > doseToCompare.Dose )
{
count++;
}
}
doseProfile = null;
}
}
volumeDoseTotal = ( count * planDose.XRes * planDose.YRes * planDose.ZRes );
