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


C++ Series::addExtract方法代码示例

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


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

示例1: fillPatientFromXMLFile


//.........这里部分代码省略.........
			{
				line = line.trimmed();
				study = new Study();
				int start = line.indexOf("\"")+1, end = line.lastIndexOf("\"");
				QString descr = line.mid(start, end-start);
				study->setDescription(descr);
				img->addStudy(study);
			}
			//Series
			else if( line.startsWith(tab + tab + tab + "<") )
			{
				if( line.contains("<Property") )
				{
					QString tag, tagName, value;
					int start = line.indexOf("tag=")+5, end = line.indexOf("\"", start);
					tag = line.mid(start, end-start);
					start = line.indexOf("tagName=")+9; end = line.indexOf("\"", start);
					tagName = line.mid(start, end-start);
					start = line.indexOf("value=")+7; end = line.indexOf("\"", start);
					value = line.mid(start, end-start);
					Property prop(tag, tagName, value);
					study->addProperty(prop);
				}
				else if( line.contains("<Series") )
				{
					line = line.trimmed();
					series = new Series();
					int start = line.indexOf("\"")+1, end = line.lastIndexOf("\"");
					QString descr = line.mid(start, end-start);
					series->setDescription(descr);
					study->addSeries(series);
				}
			}
			//Extract
			else if( line.startsWith(tab + tab + tab + tab + "<") )
			{
				
				if( line.contains("<Property") )
				{
					QString tag, tagName, value;
					int start = line.indexOf("tag=")+5, end = line.indexOf("\"", start);
					tag = line.mid(start, end-start);
					start = line.indexOf("tagName=")+9; end = line.indexOf("\"", start);
					tagName = line.mid(start, end-start);
					start = line.indexOf("value=")+7; end = line.indexOf("\"", start);
					value = line.mid(start, end-start);
					Property prop(tag, tagName, value);
					series->addProperty(prop);
				}
				else if( line.contains("<Extract") )
				{
					line = line.trimmed();
					int start = line.indexOf("\"")+1, end = line.lastIndexOf("\"");
					extr = new Extract(line.mid(start, end-start).toInt());
					series->addExtract(extr);
				}
			}
			//File or Property (from Extract)
			else if( line.startsWith(tab + tab + tab + tab + tab + "<") )
			{
				if( line.contains("<Property") )
				{
					QString tag, tagName, value;
					int start = line.indexOf("tag=")+5, end = line.indexOf("\"", start);
					tag = line.mid(start, end-start);
					start = line.indexOf("tagName=")+9; end = line.indexOf("\"", start);
					tagName = line.mid(start, end-start);
					start = line.indexOf("value=")+7; end = line.indexOf("\"", start);
					value = line.mid(start, end-start);
					Property prop(tag, tagName, value);
					extr->addProperty(prop);
				}
				else if( line.contains("<File") )
				{
					line = line.trimmed();
					int start = line.indexOf("\"")+1, end = line.lastIndexOf("\"");
					QString location = line.mid(start, end-start);
					file = new File(location);
					extr->addFile(file);
				}
			}
			//Property
			else if( line.startsWith(tab + tab + tab + tab + tab + tab + "<") )
			{
				line = line.trimmed();
				QString tag, tagName, value;
				int start = line.indexOf("tag=")+5, end = line.indexOf("\"", start);
				tag = line.mid(start, end-start);
				start = line.indexOf("tagName=")+9; end = line.indexOf("\"", start);
				tagName = line.mid(start, end-start);
				start = line.indexOf("value=")+7; end = line.indexOf("\"", start);
				value = line.mid(start, end-start);
				Property prop(tag, tagName, value);
				file->addProperty(prop);
			}
		}  
	}

	f.close();
}
开发者ID:JulesGorny,项目名称:Medical-Data-Anonymization-DICOM-DCMTK,代码行数:101,代码来源:xmlTools.cpp


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