当前位置: 首页>>代码示例>>C#>>正文


C# StudyXml.Select方法代码示例

本文整理汇总了C#中StudyXml.Select方法的典型用法代码示例。如果您正苦于以下问题:C# StudyXml.Select方法的具体用法?C# StudyXml.Select怎么用?C# StudyXml.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StudyXml的用法示例。


在下文中一共展示了StudyXml.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update


//.........这里部分代码省略.........
            StudyDateRaw = attribute.ToString();
            StudyDate = DateParser.Parse(StudyDateRaw);

            attribute = dataSet[DicomTags.StudyTime];
            StudyTimeRaw = attribute.ToString();
            time = TimeParser.Parse(StudyTimeRaw);
            if (time.HasValue)
                StudyTimeTicks = time.Value.TimeOfDay.Ticks;
            else
                StudyTimeTicks = null;

            if (dataSet.Contains(DicomTags.ProcedureCodeSequence))
            {
                attribute = dataSet[DicomTags.ProcedureCodeSequence];
                if (!attribute.IsEmpty && !attribute.IsNull)
                {
                    DicomSequenceItem sequence = ((DicomSequenceItem[])attribute.Values)[0];
                    ProcedureCodeSequenceCodeValue = sequence[DicomTags.CodeValue].ToString();
                    ProcedureCodeSequenceCodingSchemeDesignator = sequence[DicomTags.CodingSchemeDesignator].ToString();
                }
            }

            attribute = dataSet[DicomTags.PatientSpeciesDescription];
            PatientSpeciesDescription = attribute.ToString();

            if (dataSet.Contains(DicomTags.PatientSpeciesCodeSequence))
            {
                attribute = dataSet[DicomTags.PatientSpeciesCodeSequence];
                if (!attribute.IsEmpty && !attribute.IsNull)
                {
                    DicomSequenceItem sequence = ((DicomSequenceItem[])attribute.Values)[0];
                    PatientSpeciesCodeSequenceCodingSchemeDesignator = sequence[DicomTags.CodingSchemeDesignator].ToString();
                    PatientSpeciesCodeSequenceCodeValue = sequence[DicomTags.CodeValue].ToString();
                    PatientSpeciesCodeSequenceCodeMeaning = sequence[DicomTags.CodeMeaning].ToString();
                }
            }

            attribute = dataSet[DicomTags.PatientBreedDescription];
            PatientBreedDescription = attribute.ToString();

            if (dataSet.Contains(DicomTags.PatientBreedCodeSequence))
            {
                attribute = dataSet[DicomTags.PatientBreedCodeSequence];
                if (!attribute.IsEmpty && !attribute.IsNull)
                {
                    DicomSequenceItem sequence = ((DicomSequenceItem[])attribute.Values)[0];
                    PatientBreedCodeSequenceCodingSchemeDesignator = sequence[DicomTags.CodingSchemeDesignator].ToString();
                    PatientBreedCodeSequenceCodeValue = sequence[DicomTags.CodeValue].ToString();
                    PatientBreedCodeSequenceCodeMeaning = sequence[DicomTags.CodeMeaning].ToString();
                }
            }

            attribute = dataSet[DicomTags.ResponsiblePerson];
            ResponsiblePerson = new PersonName(attribute.ToString());

            attribute = dataSet[DicomTags.ResponsiblePersonRole];
            ResponsiblePersonRole = attribute.ToString();

            attribute = dataSet[DicomTags.ResponsibleOrganization];
            ResponsibleOrganization = attribute.ToString();

            attribute = dataSet[DicomTags.SpecificCharacterSet];
            SpecificCharacterSet = attribute.ToString();

            var modalities = _studyXml
                                .Select(s => s.First()[DicomTags.Modality].GetString(0, null))
                                .Where(value => !String.IsNullOrEmpty(value)).Distinct();
            ModalitiesInStudy = DicomStringHelper.GetDicomStringArray(modalities);

            var stationNames = _studyXml
                                .Select(s => s.First()[DicomTags.StationName].GetString(0, null))
                                .Where(value => !String.IsNullOrEmpty(value)).Distinct();
            StationNamesInStudy = DicomStringHelper.GetDicomStringArray(stationNames);

            var institutionNames = _studyXml
                                    .Select(s => s.First()[DicomTags.InstitutionName].GetString(0, null))
                                    .Where(value => !String.IsNullOrEmpty(value)).Distinct();
            InstitutionNamesInStudy = DicomStringHelper.GetDicomStringArray(institutionNames);

            var sopClasses = (from series in _studyXml
                              from instance in series
                              where instance.SopClass != null
                              select instance.SopClass.Uid).Distinct();
            SopClassesInStudy = DicomStringHelper.GetDicomStringArray(sopClasses);

            #region Meta Info

            var sourceAEs = (from series in _studyXml
                            from instance in series
                            where !String.IsNullOrEmpty(instance.SourceAETitle)
                             select instance.SourceAETitle).Distinct();
            SourceAETitlesInStudy = DicomStringHelper.GetDicomStringArray(sourceAEs);

            #endregion

            //these have to be here, rather than in Initialize b/c they are 
            // computed from the series, which are parsed from the xml.
            NumberOfStudyRelatedSeries = _studyXml.NumberOfStudyRelatedSeries;
            NumberOfStudyRelatedInstances = _studyXml.NumberOfStudyRelatedInstances;
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:101,代码来源:Study.cs


注:本文中的StudyXml.Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。