本文整理汇总了C++中DcmDataset::tagExistsWithValue方法的典型用法代码示例。如果您正苦于以下问题:C++ DcmDataset::tagExistsWithValue方法的具体用法?C++ DcmDataset::tagExistsWithValue怎么用?C++ DcmDataset::tagExistsWithValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DcmDataset
的用法示例。
在下文中一共展示了DcmDataset::tagExistsWithValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
//.........这里部分代码省略.........
key.set(0x0008,0x103E); //Series Description
//if(!dataset->tagExistsWithValue(key))
//{
std::string type;
if(meta)
type=meta->getObjectPtr()->as_str(GADGETRON_DATA_ROLE);
else
type="MRI Images";
ACE_OS::snprintf(buf, BUFSIZE, "%s", type.c_str());
WRITE_DCM_STRING(key, buf);
//}
key.set(0x0020,0x0010);//Study ID
dataset->findAndGetString(key, checkbuf, false);
if(checkbuf==NULL || !strcmp(checkbuf, "XXXXXXXX"))
{
WRITE_DCM_STRING(key, "1");
// be sure to use the same one for all series you generate
}
//Study UID should be created in IEVChannelSumGadget.
key.set(0x0020,0x000D);//Study UID
dataset->findAndGetString(key, checkbuf, false);
if(checkbuf==NULL || !strcmp(checkbuf, "XXXXXXXX"))
{
WRITE_DCM_STRING(key, meta->getObjectPtr()->as_str("StudyInstanceUID"));
// be sure to use the same one for all series you generate
}
std::strftime(buf, 100, "%Y%m%d", timeinfo);
key.set(0x0008,0x0020);//Study Date
dataset->findAndGetString(key, checkbuf, false);
if(checkbuf==NULL || !strcmp(checkbuf, "19000101"))
{
WRITE_DCM_STRING(key, buf);
}
key.set(0x0008,0x0030);//Study Time
dataset->findAndGetString(key, checkbuf, false);
if(checkbuf==NULL || !strcmp(checkbuf, "121212"))
{
WRITE_DCM_STRING(key, buf);
}
key.set(0x0008,0x0021);//Series Date
if(!dataset->tagExistsWithValue(key))
{
WRITE_DCM_STRING(key, buf);
}
key.set(0x0008,0x0012);//Instance Creation Date
if(!dataset->tagExistsWithValue(key))
{
WRITE_DCM_STRING(key, buf);
}
std::strftime(buf, 100, "%H%M%S", timeinfo);
key.set(0x0008,0x0031);//Series Time
if(!dataset->tagExistsWithValue(key))
{
WRITE_DCM_STRING(key, buf);
}
key.set(0x0008,0x0013);//Instance Creation Time
if(!dataset->tagExistsWithValue(key))
{
WRITE_DCM_STRING(key, buf);
}
key.set(0x0018,0x0081);//Echo Time
WRITE_DCM_STRING(key, meta->getObjectPtr()->as_str("TE"));
delete[] buf;
//add try catch
if(-1==this->next()->putq(m1))
{
m1->release();
GERROR("Unable to pass on message\n");
return GADGET_FAIL;
}
return GADGET_OK;
}