Beispiel #1
0
        public List <SeriesImage> GetInstanceImages(string[] instanceUIDs)
        {
            DataSet            instances;
            List <SeriesImage> seriesImages = new List <SeriesImage>();

            instances = QueryInstances(instanceUIDs);
            foreach (DataRow row in instances.Tables[DataTableHelper.InstanceTableName].Rows)
            {
                string referencedFile = row.Field <string>("ReferencedFile");

                using (DicomDataSet dicomDs = new DicomDataSet())
                {
                    RasterImage image;

                    dicomDs.Load(referencedFile, DicomDataSetLoadFlags.None);
                    image = GetImage(dicomDs);
                    if (image != null)
                    {
                        string      seriesIntanceUID = dicomDs.GetValue <string>(DicomTag.SeriesInstanceUID, string.Empty);
                        string      sopInstanceUID   = dicomDs.GetValue <string>(DicomTag.SOPInstanceUID, string.Empty);
                        SeriesImage si = new SeriesImage(seriesIntanceUID, sopInstanceUID, image);

                        seriesImages.Add(si);
                    }
                }
            }

            return(seriesImages);
        }
Beispiel #2
0
        public List <SeriesImage> GetAllPatientImages(string patientID)
        {
            List <SeriesImage> seriesImages;
            DataSet            instances;


            seriesImages = new List <SeriesImage>();
            instances    = QueryCurrentPatient(patientID);

            foreach (DataRow row in instances.Tables[DataTableHelper.InstanceTableName].Rows)
            {
                RasterImage image;
                string      referencedFile = row.Field <string>("ReferencedFile");

                using (var dicomDs = new DicomDataSet())
                {
                    dicomDs.Load(referencedFile, DicomDataSetLoadFlags.None);
                    double xDpi = 0;
                    double yDpi = 0;
                    AddInsUtils.GetDpi(dicomDs, out xDpi, out yDpi);
                    image = GetImage(dicomDs);
                    if (image != null)
                    {
                        string      seriesIntanceUID = dicomDs.GetValue <string>(DicomTag.SeriesInstanceUID, string.Empty);
                        string      sopInstanceUID   = dicomDs.GetValue <string>(DicomTag.SOPInstanceUID, string.Empty);
                        SeriesImage si = new SeriesImage(seriesIntanceUID, sopInstanceUID, image, xDpi, yDpi);

                        seriesImages.Add(si);
                    }
                }
            }
            return(seriesImages);
        }