예제 #1
0
        public static Tuple <List <List <double[, ]> >, string, List <double[]> > ParotidChop(ref ExternalPlanSetup plan, HNPlan hnPlan, List <List <Structure> > matchingStructures, StructureSet ss, ScriptContext context)
        {
            /*
             * 1. Find contralateral parotid (one with least overlap, largest sum of distance from PTVs), get contours
             * 2.) split this up into its separate contours
             * 3. make new structure for each
             * 4. make constraint for each based on importance
             */

            //1.
            Structure contraPar = Segmentation.FindContraPar(plan, ss, hnPlan, matchingStructures, context);
            //Now get contours for it
            // GetContours function will return the list of contours, as well as a list of all z-planes which contours were taken from, in a tuple
            var tuple = Segmentation.GetContours(contraPar, context);
            List <double[, ]> contours = tuple.Item1;
            List <double[]>   planes   = tuple.Item2;


            //2. Now the parotid segmentation!
            int numCutsZ = 2;
            int numCutsX = 2;
            int numCutsY = 1;
            List <List <double[, ]> > choppedContours = Segmentation.Chop(contours, numCutsX, numCutsY, numCutsZ, contraPar.Name);

            return(Tuple.Create(choppedContours, contraPar.Name, planes));
        }