示例#1
0
        public void Load(DicomFile[] files, DicomDoseObject dicomObject, IProgress <double> progress)
        {
            //Load standard DICOM stuff.
            base.Load(files, dicomObject, progress);

            DicomFile file0      = files[0];
            var       gridLoader = new GridBasedStructureDicomLoader();

            dicomObject.Grid           = gridLoader.Load(files, progress);
            dicomObject.Grid.Scaling   = file0.Dataset.Get <float>(DicomTag.DoseGridScaling, 1.0f);
            dicomObject.Grid.ValueUnit = unitFromString(file0.Dataset.Get <string>(DicomTag.DoseUnits, "Relative"));
            dicomObject.Grid.Name      = Path.GetFileNameWithoutExtension(file0.File.Name);
        }
示例#2
0
        public void Load(DicomFile[] files, DicomImageObject dicomObject, IProgress <double> progress)
        {
            base.Load(files, dicomObject, progress);

            var gridLoader = new GridBasedStructureDicomLoader();

            dicomObject.Grid = gridLoader.Load(files, progress);
            dicomObject.Grid.DefaultPhysicalValue = -1024;
            dicomObject.Grid.Scaling   = 1;
            dicomObject.Grid.ValueUnit = Geometry.Unit.HU;
            dicomObject.Grid.Name      = dicomObject.Modality + ": " + dicomObject.PatientName;

            try
            {
                dicomObject.LUT.Window = files[0].Dataset.Get <int>(DicomTag.WindowWidth);
                dicomObject.LUT.Level  = files[0].Dataset.Get <int>(DicomTag.WindowCenter);
            }catch (Exception e)
            {
                //Here we should try to set to the median pixel or something
            }
        }
示例#3
0
        public void Load(DicomFile[] files, DicomImageObject dicomObject, IProgress <double> progress)
        {
            base.Load(files, dicomObject, progress);

            var gridLoader = new GridBasedStructureDicomLoader();

            dicomObject.Grid = gridLoader.Load(files, progress);
            dicomObject.Grid.DefaultPhysicalValue = -1024;
            dicomObject.Grid.Scaling   = 1;
            dicomObject.Grid.ValueUnit = Geometry.Unit.HU;
            dicomObject.Grid.Name      = dicomObject.Modality + ": " + dicomObject.PatientName;

            try
            {
                dicomObject.LUT.Window = files[0].Dataset.GetSingleValueOrDefault <int>(DicomTag.WindowWidth, 2048);
                dicomObject.LUT.Level  = files[0].Dataset.GetSingleValueOrDefault <int>(DicomTag.WindowCenter, 1024);
#pragma warning disable CS0168 // The variable 'e' is declared but never used
            }catch (Exception e)
#pragma warning restore CS0168 // The variable 'e' is declared but never used
            {
                //Here we should try to set to the median pixel or something
            }
        }
示例#4
0
        public void Load(DicomFile file, DicomDoseObject dicomObject, IProgress <double> progress)
        {
            var gridLoader = new GridBasedStructureDicomLoader();

            dicomObject.SerriesNumber      = file.Dataset.GetSingleValueOrDefault <string>(DicomTag.SeriesNumber, "");
            dicomObject.SerriesDescription = file.Dataset.GetSingleValueOrDefault <string>(DicomTag.SeriesDescription, "");
            dicomObject.ClassUID           = file.Dataset.GetSingleValueOrDefault <string>(DicomTag.SOPClassUID, "");
            dicomObject.InstanceUID        = file.Dataset.GetSingleValueOrDefault <string>(DicomTag.SOPInstanceUID, "");
            String tempstring = file.Dataset.GetSingleValueOrDefault <string>(DicomTag.ReferencedRTPlanSequence, "");

            DicomReferencedSOP tt = file.Dataset.GetReferencedSOP(DicomTag.ReferencedRTPlanSequence);

            if (tt != null)
            {
                dicomObject.ReferencedClassUID    = tt.Class.UID;
                dicomObject.ReferencedInstanceUID = tt.Instance.UID;
            }

            dicomObject.Grid           = gridLoader.Load(file);
            dicomObject.Grid.Scaling   = file.Dataset.GetSingleValueOrDefault <float>(DicomTag.DoseGridScaling, 1.0f);
            dicomObject.Grid.ValueUnit = unitFromString(file.Dataset.GetSingleValueOrDefault <string>(DicomTag.DoseUnits, "Relative"));
            dicomObject.Grid.Name      = Path.GetFileNameWithoutExtension(file.File.Name);
        }