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


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

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


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

示例1: writeXMLfromPatient

/**
* \author Jules Gorny - ALCoV team, ISIT, UMR 6284 UdA – CNRS
**/
void writeXMLfromPatient(QString xmlPath, Patient* pat)
{
	QString tab = "    ";
	QFile file(xmlPath);
    file.open(QIODevice::WriteOnly | QIODevice::Text);
    QTextStream out(&file);

    out << "<Patient Id=\"" << pat->getId() << "\">\n";

	QVector<Property> propertiesPat = pat->getProperties();
	for(int p=0; p<propertiesPat.size(); p++)
	{
		Property prop = propertiesPat[p];
		out << tab << "<Property tag=\"" << prop.getTag() << "\" tagName=\"" << prop.getTagName() << "\" value=\"" << prop.getValue() << "\"/>\n";
	}

	QVector<Image*> imgs = pat->getImgs();
	for(int i=0; i<imgs.size(); i++)
	{
		Image* img = imgs[i];
		out << tab << "<" << img->getType() << ">\n";

		QVector<Study*> studies = img->getStudies();
		for(int st=0; st<studies.size(); st++)
		{
			Study* study = studies[st];
			out << tab << tab << "<Study description=\"" << study->getDescription() << "\">\n";

			QVector<Property> propertiesStud = study->getProperties();
			for(int p=0; p<propertiesStud.size(); p++)
			{
				Property prop = propertiesStud[p];
				out << tab << tab << tab << "<Property tag=\"" << prop.getTag() << "\" tagName=\"" << prop.getTagName() << "\" value=\"" << prop.getValue() << "\"/>\n";
			}

			QVector<Series*> series = study->getSeries();
			for(int se=0; se<series.size(); se++)
			{
				Series* serie = series[se];
				out << tab << tab << tab << "<Series description=\"" << serie->getDescription() << "\">\n";
				
				QVector<Property> propertiesSeries = serie->getProperties();
				for(int p=0; p<propertiesSeries.size(); p++)
				{
					Property prop = propertiesSeries[p];
					out << tab << tab << tab << tab << "<Property tag=\"" << prop.getTag() << "\" tagName=\"" << prop.getTagName() << "\" value=\"" << prop.getValue() << "\"/>\n";
				}

				QVector<Extract*> extracts = serie->getExtracts();
				for(int e=0; e<extracts.size(); e++)
				{
					Extract* extract = extracts[e];
					extract->fillFilesCommonProperty();
					out << tab << tab << tab << tab << "<Extract number=\"" << QString::number(extract->getNumber()) << "\">\n";

					QVector<Property> propertiesExtr = extract->getProperties();
					for(int p=0; p<propertiesExtr.size(); p++)
					{
						Property prop = propertiesExtr[p];
						out << tab << tab << tab << tab << tab << "<Property tag=\"" << prop.getTag() << "\" tagName=\"" << prop.getTagName() << "\" value=\"" << prop.getValue() << "\"/>\n";
					}

					QVector<File*> files = extract->getFiles();
					for(int f=0; f<files.size(); f++)
					{
						File* file = files[f];
						out << tab << tab << tab << tab << tab << "<File location=\"" << file->getPath() << "\">\n";

						QVector<Property> properties = file->getProperties();
						for(int p=0; p<properties.size(); p++)
						{
							Property prop = properties[p];
							out << tab << tab << tab << tab << tab << tab << "<Property tag=\"" << prop.getTag() << "\" tagName=\"" << prop.getTagName() << "\" value=\"" << prop.getValue() << "\"/>\n";
						}
						out << tab << tab << tab << tab << tab << "</File>\n";
					}
					out << tab << tab << tab << tab << "</Extract>\n";
				}
				out << tab << tab << tab << "</Series>\n";
			}
			out << tab << tab << "</Study>\n";
		}
		out << tab << "</" << img->getType() << ">\n";
	}
    out << "</Patient>";

    // optional, as QFile destructor will already do it:
    file.close(); 
}
开发者ID:JulesGorny,项目名称:Medical-Data-Anonymization-DICOM-DCMTK,代码行数:92,代码来源:xmlTools.cpp


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