本文整理汇总了C#中StudyXml.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# StudyXml.GetEnumerator方法的具体用法?C# StudyXml.GetEnumerator怎么用?C# StudyXml.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StudyXml
的用法示例。
在下文中一共展示了StudyXml.GetEnumerator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadInstance
/// <summary>
/// Load the first instance from the first series of the StudyXml file for a study.
/// </summary>
/// <param name="location">The storage location of the study.</param>
/// <returns></returns>
protected static DicomFile LoadInstance(StudyStorageLocation location)
{
string studyXml = Path.Combine(location.GetStudyPath(), location.StudyInstanceUid + ".xml");
if (!File.Exists(studyXml))
{
return null;
}
FileStream stream = FileStreamOpener.OpenForRead(studyXml, FileMode.Open);
var theDoc = new XmlDocument();
StudyXmlIo.Read(theDoc, stream);
stream.Close();
stream.Dispose();
var xml = new StudyXml();
xml.SetMemento(theDoc);
IEnumerator<SeriesXml> seriesEnumerator = xml.GetEnumerator();
if (seriesEnumerator.MoveNext())
{
SeriesXml seriesXml = seriesEnumerator.Current;
IEnumerator<InstanceXml> instanceEnumerator = seriesXml.GetEnumerator();
if (instanceEnumerator.MoveNext())
{
InstanceXml instance = instanceEnumerator.Current;
var file = new DicomFile("file.dcm",new DicomAttributeCollection(), instance.Collection)
{TransferSyntax = instance.TransferSyntax};
return file;
}
}
return null;
}