Пример #1
0
        public void LongArray()
        {
            int[] ints = new int[20];
            for (var i = 0; i < 20; i++)
            {
                ints[i] = i;
            }

            foreach (var i in ints)
            {
                Assert.Equal(i, Chopper.Chop(i, ints));
            }
        }
Пример #2
0
        static void Execute()
        {
            string structPath = @"../../../ExportedPlansEclipse/spstudy_test_008/0Gy/RS.dcm";
            string dosePath   = @"../../../ExportedPlansEclipse/spstudy_test_008/0Gy/RD.dcm";
            //define the number of slices desired in the x,y,z directions:
            int numCutsX  = 2;
            int numCutY   = 1;
            int numCutsZ  = 2;
            int SSFactor  = 4; //supersampling factors
            int SSFactorZ = 1;

            //First load the RT struct dicom file.
            Console.WriteLine("Reading Dicom Struct file...");
            var structFile = DicomFile.Open(structPath).Dataset;

            //Get patient ID:
            string patientID = structFile.GetString(DicomTag.PatientID);

            //Get the desired ROI, and close all contours
            List <double[, ]> contoursTemp = DicomParsing.FindROI(structFile, "paro", true, true);
            string            organName    = DicomParsing.ROIName;

            //Chop it!
            List <List <double[, ]> > contours = Chopper.Chop(contoursTemp, numCutsX, numCutY, numCutsZ, organName);

            //Plot it!
            Console.WriteLine("Would you like to plot the chopped up ROI? (y/n)");
            string input = Console.ReadLine();

            input.ToLower();
            if ((input == "y") || (input == "yes"))
            {
                ContourPlotting.Plot(contours);
            }
            //Now load a dose file.
            DicomDose.MeanDoses(contours, dosePath, patientID, SSFactor, SSFactorZ);
            Testing.RunTests(contours, organName);
            Console.WriteLine("Press any key to end the program.");
            Console.ReadLine();
        }
Пример #3
0
 public void EmptyArray()
 {
     Assert.Equal(-1, Chopper.Chop(3, new int[] { }));
 }
Пример #4
0
 public void NotInArray()
 {
     Assert.Equal(-1, Chopper.Chop(3, new[] { 1 }));
 }