本文整理汇总了C++中DcmDataset::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ DcmDataset::insert方法的具体用法?C++ DcmDataset::insert怎么用?C++ DcmDataset::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DcmDataset
的用法示例。
在下文中一共展示了DcmDataset::insert方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: query_series_instances
/*
* query the number instances of a series
*/
int query_series_instances(const std::string& studyinstanceuid, const std::string& seriesinstanceuid, const std::string& server, const std::string& local_aet) {
DcmDataset query;
DcmElement* e = NULL;
e = newDicomElement(DCM_QueryRetrieveLevel);
e->putString("IMAGE");
query.insert(e);
e = newDicomElement(DCM_StudyInstanceUID);
e->putString(studyinstanceuid.c_str());
query.insert(e);
e = newDicomElement(DCM_SeriesInstanceUID);
e->putString(seriesinstanceuid.c_str());
query.insert(e);
e = newDicomElement(DCM_SOPInstanceUID);
query.insert(e);
e = newDicomElement(DCM_InstanceNumber);
query.insert(e);
std::cout << "NEW QUERY:" << std::endl;
query.print(COUT);
NetClient<FindAssociation> a;
a.QueryServer(&query, server, local_aet, UID_FINDStudyRootQueryRetrieveInformationModel);
DcmStack* result = a.GetResultStack();
std::cout << "query_series_instances = " << result->card() << std::endl;
return result->card();
}
示例2: query_series_from_net
void query_series_from_net(const std::string& studyinstanceuid, const std::string& server, const std::string& local_aet, const sigc::slot< void, const Glib::RefPtr< ImagePool::Series >& >& resultslot) {
DcmDataset query;
DcmElement* e = NULL;
e = newDicomElement(DCM_QueryRetrieveLevel);
e->putString("SERIES");
query.insert(e);
e = newDicomElement(DCM_SpecificCharacterSet);
query.insert(e);
e = newDicomElement(DCM_StudyInstanceUID);
e->putString(studyinstanceuid.c_str());
query.insert(e);
e = newDicomElement(DCM_SeriesInstanceUID);
query.insert(e);
e = newDicomElement(DCM_SeriesNumber);
query.insert(e);
e = newDicomElement(DCM_Modality);
query.insert(e);
e = newDicomElement(DCM_SeriesDescription);
query.insert(e);
e = newDicomElement(DCM_SeriesTime);
query.insert(e);
e = newDicomElement(DCM_StationName);
query.insert(e);
e = newDicomElement(DCM_NumberOfSeriesRelatedInstances);
query.insert(e);
std::cout << "NEW QUERY:" << std::endl;
query.print(COUT);
NetClient<FindAssociation> a;
a.QueryServer(&query, server, local_aet, UID_FINDStudyRootQueryRetrieveInformationModel);
DcmStack* result = a.GetResultStack();
for(unsigned int i=0; i<result->card(); i++) {
DcmDataset* dset = (DcmDataset*)result->elem(i);
dset->print(COUT);
resultslot(create_query_series(dset));
}
}
示例3: query_study_series
/*
* query all seriesinstanceuid's and the number series of a study
*/
int query_study_series(const std::string& studyinstanceuid, const std::string& server, const std::string& local_aet, std::list<std::string>& seriesinstanceuids) {
DcmDataset query;
DcmElement* e = NULL;
e = newDicomElement(DCM_QueryRetrieveLevel);
e->putString("SERIES");
query.insert(e);
e = newDicomElement(DCM_StudyInstanceUID);
e->putString(studyinstanceuid.c_str());
query.insert(e);
e = newDicomElement(DCM_SeriesInstanceUID);
query.insert(e);
e = newDicomElement(DCM_SeriesNumber);
query.insert(e);
e = newDicomElement(DCM_Modality);
query.insert(e);
std::cout << "NEW QUERY:" << std::endl;
query.print(COUT);
NetClient<FindAssociation> a;
a.QueryServer(&query, server, local_aet, UID_FINDStudyRootQueryRetrieveInformationModel);
DcmStack* result = a.GetResultStack();
DcmDataset* dset;
OFString ofstr;
seriesinstanceuids.clear();
for(int i = 0; i < result->card(); i++) {
dset = (DcmDataset*)result->elem(i);
if(dset->findAndGetOFString(DCM_SeriesInstanceUID, ofstr).good()) {
seriesinstanceuids.push_back(ofstr.c_str());
}
}
std::cout << result->card() << " Responses" << std::endl;
int count = result->card();
return count;
}
示例4: getDcmDatasetOfImagesToRetrieve
DcmDataset* RetrieveDICOMFilesFromPACS::getDcmDatasetOfImagesToRetrieve(const QString &studyInstanceUID, const QString &seriesInstanceUID, const QString &sopInstanceUID)
{
DcmDataset *dcmDatasetToRetrieve = new DcmDataset();
QString retrieveLevel = "STUDY";
DcmElement *elemSpecificCharacterSet = newDicomElement(DCM_SpecificCharacterSet);
// ISO_IR 100 és Latin1
elemSpecificCharacterSet->putString("ISO_IR 100");
dcmDatasetToRetrieve->insert(elemSpecificCharacterSet, OFTrue);
DcmElement *elem = newDicomElement(DCM_StudyInstanceUID);
elem->putString(qPrintable(studyInstanceUID));
dcmDatasetToRetrieve->insert(elem, OFTrue);
if (!seriesInstanceUID.isEmpty())
{
DcmElement *elem = newDicomElement(DCM_SeriesInstanceUID);
elem->putString(qPrintable(seriesInstanceUID));
dcmDatasetToRetrieve->insert(elem, OFTrue);
retrieveLevel = "SERIES";
}
if (!sopInstanceUID.isEmpty())
{
DcmElement *elem = newDicomElement(DCM_SOPInstanceUID);
elem->putString(qPrintable(sopInstanceUID));
dcmDatasetToRetrieve->insert(elem, OFTrue);
retrieveLevel = "IMAGE";
}
// Especifiquem a quin nivell es fa el QueryRetrieve
DcmElement *elemQueryRetrieveLevel = newDicomElement(DCM_QueryRetrieveLevel);
elemQueryRetrieveLevel->putString(qPrintable(retrieveLevel));
dcmDatasetToRetrieve->insert(elemQueryRetrieveLevel, OFTrue);
return dcmDatasetToRetrieve;
}
示例5: open_dicomdir_study
static bool open_dicomdir_study(const Glib::ustring& dicomdir, DcmDirectoryRecord *patRec, DcmDirectoryRecord *studyRec, const sigc::slot< void, const Glib::RefPtr< ImagePool::Study >& >& resultslot) {
bool seriesFound(false);
DcmDirectoryRecord *subRec;
assert(studyRec->getRecordType()==ERT_Study);
subRec = studyRec->nextSub(NULL);
while ( subRec && !seriesFound ) {
switch ( subRec->getRecordType() ) {
case ERT_Series:
// Check if valid series (contains at least 1 image)
seriesFound = true;
break;
case ERT_Private:
break;
default:
std::cout << "WARNING: Bad DICOMDIR SubRecord type[" << subRec->getRecordType() << "] for Study found\n";
}
subRec = studyRec->nextSub(subRec);
}
if ( seriesFound ) {
DcmDataset study;
DcmElement *el;
if ( studyRec->findAndCopyElement(DCM_SpecificCharacterSet, el) == ECC_Normal )
study.insert(el);
if ( studyRec->findAndCopyElement(DCM_StudyInstanceUID, el) == ECC_Normal )
study.insert(el);
if ( studyRec->findAndCopyElement(DCM_StudyDate, el) == ECC_Normal )
study.insert(el);
if ( studyRec->findAndCopyElement(DCM_StudyTime, el) == ECC_Normal )
study.insert(el);
if ( studyRec->findAndCopyElement(DCM_StudyDescription, el) == ECC_Normal )
study.insert(el);
if ( patRec->findAndCopyElement(DCM_PatientsName, el) == ECC_Normal )
study.insert(el);
if ( patRec->findAndCopyElement(DCM_PatientsBirthDate, el) == ECC_Normal )
study.insert(el);
if ( patRec->findAndCopyElement(DCM_PatientsSex, el) == ECC_Normal )
study.insert(el);
resultslot(create_query_study(&study, std::string("DICOMDIR:") + dicomdir));
}
return seriesFound;
}
示例6: open_dicomdir_series_result
static void open_dicomdir_series_result(const Glib::ustring &dicomdir, DcmDirectoryRecord *patRec, DcmDirectoryRecord *studyRec, const sigc::slot< void, const Glib::RefPtr< ImagePool::Series >& >& resultslot) {
DcmDirectoryRecord *seriesRec;
DcmDirectoryRecord *sopRec;
assert(studyRec->getRecordType()==ERT_Study);
seriesRec = studyRec->nextSub(NULL);
while ( seriesRec ) {
DcmDataset series;
DcmElement *el;
if ( seriesRec->findAndCopyElement(DCM_SpecificCharacterSet, el) == ECC_Normal )
series.insert(el);
if ( seriesRec->findAndCopyElement(DCM_SeriesDescription, el) == ECC_Normal )
series.insert(el);
if ( seriesRec->findAndCopyElement(DCM_SeriesInstanceUID, el) == ECC_Normal )
series.insert(el);
if ( seriesRec->findAndCopyElement(DCM_Modality, el) == ECC_Normal )
series.insert(el);
if ( seriesRec->findAndCopyElement(DCM_SeriesDate, el) == ECC_Normal )
series.insert(el);
if ( seriesRec->findAndCopyElement(DCM_SeriesTime, el) == ECC_Normal )
series.insert(el);
if ( studyRec->findAndCopyElement(DCM_StudyDescription, el) == ECC_Normal )
series.insert(el);
if ( studyRec->findAndCopyElement(DCM_StationName, el) == ECC_Normal )
series.insert(el);
// Count Related SOP Instances
int nSop=0;
sopRec = seriesRec->nextSub(NULL);
while (sopRec) {
nSop++;
sopRec = seriesRec->nextSub(sopRec);
}
series.putAndInsertUint16(DCM_NumberOfSeriesRelatedInstances, nSop);
resultslot(create_query_series(&series));
seriesRec = studyRec->nextSub(seriesRec);
}
}
示例7: query_from_net
void query_from_net(
const std::string& patientid,
const std::string& name,
const std::string& modality,
const std::string& date_from,
const std::string& date_to,
const std::string& studydescription,
const std::string& accessionnumber,
const std::string& local_aet,
const std::set<std::string>& groups,
const sigc::slot< void, const Glib::RefPtr< ImagePool::Study >& >& resultslot
)
{
// get encodings
std::string dicom_enc = ImagePool::get_encoding();
std::string system_enc = ImagePool::get_system_encoding(dicom_enc);
// create patientsname querystring
std::string patientsname;
if(name.empty()) {
patientsname = "*";
}
else {
patientsname = convert_string_to(name.c_str(), system_enc);
}
std::string description;
if(!studydescription.empty()) {
description = convert_string_to(studydescription.c_str(), system_enc);
}
// create date querystring
std::string date;
if(date_from.empty() && date_to.empty()) {
date = "";
}
else if(date_to.empty()) {
date = date_from + "-";
}
else if(date_from.empty()) {
date = "-" + date_to;
}
else {
date = date_from + "-" + date_to;
}
if(date_from == date_to) {
date = date_from;
}
/*std::string station;
if(!stationname.empty()) {
station = "*" + convert_string_to(stationname.c_str(), system_enc) + "*";
}*/
DcmDataset query;
DcmElement* e = NULL;
e = newDicomElement(DCM_QueryRetrieveLevel);
e->putString("STUDY");
query.insert(e);
e = newDicomElement(DCM_SpecificCharacterSet);
e->putString(dicom_enc.c_str());
query.insert(e);
e = newDicomElement(DCM_PatientsName);
e->putString(patientsname.c_str());
query.insert(e);
e = newDicomElement(DCM_PatientID);
e->putString(convert_string_to(patientid.c_str(), system_enc).c_str());
query.insert(e);
e = newDicomElement(DCM_SOPClassesInStudy);
query.insert(e);
e = newDicomElement(DCM_ModalitiesInStudy);
e->putString(modality.c_str());
query.insert(e);
e = newDicomElement(DCM_PatientsBirthDate);
query.insert(e);
e = newDicomElement(DCM_PatientsSex);
query.insert(e);
e = newDicomElement(DCM_StudyDate);
e->putString(date.c_str());
query.insert(e);
e = newDicomElement(DCM_StudyTime);
query.insert(e);
e = newDicomElement(DCM_NumberOfStudyRelatedSeries);
query.insert(e);
e = newDicomElement(DCM_NumberOfStudyRelatedInstances);
query.insert(e);
//.........这里部分代码省略.........