예제 #1
0
        /// <summary>
        /// Adds a <see cref="SeriesInformation"/> data
        /// </summary>
        /// <param name="message"></param>
        public void Add(DicomMessageBase message)
        {
            if (PatientInfo == null)
            {
                PatientInfo = new PatientInformation(message.DataSet);
            }

            if (Series == null)
            {
                Series = new List <SeriesInformation>();
            }

            string            seriesInstanceUid = message.DataSet[DicomTags.SeriesInstanceUid].ToString();
            SeriesInformation theSeries         = Series.Find(ser => ser.SeriesInstanceUid == seriesInstanceUid);

            if (theSeries == null)
            {
                SeriesInformation newSeries = new SeriesInformation(message.DataSet)
                {
                    NumberOfInstances = 1
                };
                Series.Add(newSeries);
            }
            else
            {
                theSeries.NumberOfInstances++;
            }
        }
예제 #2
0
        public StudyInformation(IDicomAttributeProvider attributeProvider)
        {
            if (attributeProvider[DicomTags.StudyId] != null)
            {
                StudyId = attributeProvider[DicomTags.StudyId].ToString();
            }

            if (attributeProvider[DicomTags.AccessionNumber] != null)
            {
                AccessionNumber = attributeProvider[DicomTags.AccessionNumber].ToString();
            }

            if (attributeProvider[DicomTags.StudyDate] != null)
            {
                StudyDate = attributeProvider[DicomTags.StudyDate].ToString();
            }

            if (attributeProvider[DicomTags.ModalitiesInStudy] != null)
            {
                Modalities = attributeProvider[DicomTags.ModalitiesInStudy].ToString();
            }

            if (attributeProvider[DicomTags.StudyInstanceUid] != null)
            {
                StudyInstanceUid = attributeProvider[DicomTags.StudyInstanceUid].ToString();
            }

            if (attributeProvider[DicomTags.StudyDescription] != null)
            {
                StudyDescription = attributeProvider[DicomTags.StudyDescription].ToString();
            }


            if (attributeProvider[DicomTags.ReferringPhysiciansName] != null)
            {
                ReferringPhysician = attributeProvider[DicomTags.ReferringPhysiciansName].ToString();
            }

            PatientInfo = new PatientInformation(attributeProvider);

            DicomAttribute seriesUidAttr;

            if (attributeProvider.TryGetAttribute(DicomTags.SeriesInstanceUid, out seriesUidAttr))
            {
                SeriesInformation series = new SeriesInformation(attributeProvider);
                Add(series);
            }
        }