本文整理汇总了C++中DcmDataset::putAndInsertOFStringArray方法的典型用法代码示例。如果您正苦于以下问题:C++ DcmDataset::putAndInsertOFStringArray方法的具体用法?C++ DcmDataset::putAndInsertOFStringArray怎么用?C++ DcmDataset::putAndInsertOFStringArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DcmDataset
的用法示例。
在下文中一共展示了DcmDataset::putAndInsertOFStringArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printMessage
OFCondition I2DOutputPlugSC::convert(DcmDataset &dataset) const
{
if (m_debug)
printMessage(m_logStream, "I2DOutputPlugSC: Inserting SC specific attributes");
OFCondition cond;
cond = dataset.putAndInsertOFStringArray(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage);
return EC_Normal;
}
示例2: queryDcm
bool DcmSend::queryDcm(QList <QString> &QueryPatientName, QList <QString> &QueryPatientID, QList <QString> &QueryAccessionNumber)
{
OFVector<QRResponse*> findResponses;
DcmDataset req;
req.insertEmptyElement(DCM_PatientName);
req.insertEmptyElement(DCM_PatientID);
req.insertEmptyElement(DCM_AccessionNumber);
req.putAndInsertOFStringArray(DCM_QueryRetrieveLevel, "STUDY");
req.putAndInsertOFStringArray(DCM_StudyInstanceUID, "");
T_ASC_PresentationContextID presID = findUncompressedPC(UID_FINDStudyRootQueryRetrieveInformationModel, Sender);
if (presID == 0)
{
DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND");
return 1;
}
result = Sender.sendFINDRequest(presID, &req,&findResponses);
if (result.bad())
return false;
OFString NamePatient;
OFString PatientID;
OFString AccessionNumber;
for (int i=0;i<findResponses.size();i++){
if (findResponses.at(i)->m_dataset != NULL){
result= findResponses.at(i)->m_dataset->findAndGetOFString(DCM_PatientName,NamePatient);
result= findResponses.at(i)->m_dataset->findAndGetOFString(DCM_AccessionNumber,AccessionNumber);
result= findResponses.at(i)->m_dataset->findAndGetOFString(DCM_PatientID,PatientID);
QueryPatientName << NamePatient.data();
QueryPatientID << PatientID.data();
QueryAccessionNumber << AccessionNumber.data();
}
}
return true;
}
示例3: Fixture
Fixture()
{
OFCondition condition;
condition = dataset.putAndInsertOFStringArray(DCM_PatientID, "DJ123");
if(condition.bad())
{
throw odil::dcmtk::Exception(condition);
}
condition = dataset.putAndInsertUint16(DCM_MessageID, 1234);
if(condition.bad())
{
throw odil::dcmtk::Exception(condition);
}
}
示例4: gendicom
int gendicom(const char* file_name, const std::vector<float> &data,
unsigned int rows, unsigned int cols)
{
char uid[100];
DcmFileFormat fileformat;
DcmDataset *dataset = fileformat.getDataset();
OFCondition result = EC_Normal;
if (result.good()) result = dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage);
//if (result.good()) result = dataset->putAndInsertString(DCM_MediaStorageSOPClassUID, UID_SecondaryCaptureImageStorage); //same as SOP
if (result.good()) result = dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
//if (result.good()) result = dataset->putAndInsertString(DCM_MediaStorageSOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
if (result.good()) result = dataset->putAndInsertString(DCM_SeriesInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
if (result.good()) result = dataset->putAndInsertString(DCM_StudyInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
//if (result.good()) result = dataset->putAndInsertString(DCM_TransferSyntaxUID, UID_LittleEndianExplicitTransferSyntax);
//if (result.good()) result = dataset->putAndInsertUint16(DCM_FileMetaInformationVersion, 1);
if (result.good()) result = dataset->putAndInsertString(DCM_ImageType, "DERIVED");
if (result.good()) result = dataset->putAndInsertString(DCM_Modality, "MR");
if (result.good()) result = dataset->putAndInsertString(DCM_ConversionType, "WSD");
if (result.good()) result = dataset->putAndInsertString(DCM_DerivationDescription, "IRGN Processed MR Reconstruction");
if (result.good()) result = dataset->putAndInsertString(DCM_SecondaryCaptureDeviceManufacturer, "IMT TUGRAZ");
if (result.good()) result = dataset->putAndInsertString(DCM_SecondaryCaptureDeviceManufacturerModelName, "IMT Cuda Workstation");
if (result.good()) result = dataset->putAndInsertString(DCM_PatientName, "Doe^John");
// set instance creation date and time
OFString s;
if (result.good()) result = DcmDate::getCurrentDate(s);
if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationDate, s);
if (result.good()) result = DcmTime::getCurrentTime(s);
if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_InstanceCreationTime, s);
//--- Write image-data ---
std::vector<Uint16> uint16_data;
float val=0;
float min_val;
float max_val = *std::max_element(data.begin(),data.end());
for(unsigned int i=0; i<data.size(); ++i)
{
val = (data[i]/max_val)*65535;
uint16_data.push_back(Uint16(val));
}
max_val = *std::max_element(uint16_data.begin(),uint16_data.end());
min_val = *std::min_element(uint16_data.begin(),uint16_data.end());
std::cout<<"\n max-val: "<<max_val;
std::cout<<"\n min-val: "<<min_val;
unsigned bits=16;
Uint16 bitsAllocated=((bits-1)/8+1)*8;
Uint16 bitsStored=bits;
Uint16 highBit=bits-1;
if (result.good()) result = dataset->putAndInsertUint16(DCM_BitsAllocated, bitsAllocated);
if (result.good()) result = dataset->putAndInsertUint16(DCM_BitsStored, bitsStored);
if (result.good()) result = dataset->putAndInsertUint16(DCM_HighBit, highBit);
if (result.good()) result = dataset->putAndInsertUint16(DCM_Rows, rows);
if (result.good()) result = dataset->putAndInsertUint16(DCM_Columns, cols);
if (result.good()) result = dataset->putAndInsertUint16(DCM_PixelRepresentation, 0); // 1 signed, 0 unsigned
if (result.good()) result = dataset->putAndInsertOFStringArray(DCM_PhotometricInterpretation, "MONOCHROME2");
if (result.good()) result = dataset->putAndInsertUint16(DCM_SamplesPerPixel, 1);
if (result.good()) result = dataset->putAndInsertUint16(DCM_SmallestImagePixelValue, min_val);
if (result.good()) result = dataset->putAndInsertUint16(DCM_LargestImagePixelValue, max_val);
Uint8* pixelData = (Uint8*)&uint16_data[0];
Uint32 pixelLength;
pixelLength = uint16_data.size()*2; //number of elements in vector * 2bytes (for Uint16)
dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength);
OFCondition status = fileformat.saveFile(file_name, EXS_LittleEndianExplicit);
if (result.bad())
std::cerr << "Error: cannot write DICOM file (" << result.text() << ")" << std::endl;
if (status.bad())
std::cerr << "Error: cannot write DICOM file (" << status.text() << ")" << std::endl;
return 0;
}
示例5: main
int main()
{
dcmtkpp::Network network;
network.set_role(NET_ACCEPTORREQUESTOR);
network.set_port(11112);
network.initialize();
dcmtkpp::Association association;
association.set_own_ae_title("myself");
association.set_peer_host_name("pacs.example.com");
association.set_peer_port(11112);
association.set_peer_ae_title("pacs");
association.add_presentation_context(
UID_MOVEStudyRootQueryRetrieveInformationModel,
{ UID_LittleEndianImplicitTransferSyntax });
association.add_presentation_context(
UID_MRImageStorage,
{ UID_LittleEndianImplicitTransferSyntax },
ASC_SC_ROLE_SCP);
association.add_presentation_context(
UID_VerificationSOPClass,
{ UID_LittleEndianImplicitTransferSyntax });
association.associate(network);
dcmtkpp::MoveSCU scu;
scu.set_network(&network);
scu.set_association(&association);
scu.set_move_destination(association.get_own_ae_title());
scu.echo();
DcmDataset * query = new DcmDataset();
query->putAndInsertOFStringArray(DCM_PatientID, "1234");
query->putAndInsertOFStringArray(DCM_QueryRetrieveLevel, "SERIES");
query->putAndInsertOFStringArray(DCM_StudyInstanceUID, "1.2.3.4.5");
query->putAndInsertOFStringArray(DCM_SeriesInstanceUID, "1.2.3.4.5.1");
scu.set_affected_sop_class(UID_MOVEStudyRootQueryRetrieveInformationModel);
std::cout << "--------\n";
std::cout << "Callback\n";
std::cout << "--------\n\n";
scu.move(query, print_informations);
std::cout << "\n";
std::cout << "------\n";
std::cout << "vector\n";
std::cout << "------\n\n";
std::vector<DcmDataset*> result = scu.move(query);
for(auto dataset: result)
{
print_informations(dataset);
}
for(auto & dataset: result)
{
delete dataset;
dataset = 0;
}
association.release();
network.drop();
}