本文整理汇总了C++中DcmDataset::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ DcmDataset::remove方法的具体用法?C++ DcmDataset::remove怎么用?C++ DcmDataset::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DcmDataset
的用法示例。
在下文中一共展示了DcmDataset::remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
int AddMetaData::process(GadgetContainerMessage<DcmFileFormat> * m1)
{
DcmFileFormat * dcm = m1->getObjectPtr();
GadgetContainerMessage<std::string> * f;
GadgetContainerMessage<ISMRMRD::MetaContainer>* meta;
if(dcm)
{
f=AsContainerMessage<std::string>(m1->cont());
}
else
{ GERROR("No filename set for DICOM file\n");
return GADGET_FAIL;
}
if(f)
{
meta= AsContainerMessage<ISMRMRD::MetaContainer>(f->cont());
}
else
{
GERROR("No meta data found for DICOM\n");
return GADGET_FAIL;
}
unsigned int BUFSIZE = 1024;
char *buf = new char[BUFSIZE];
const char* checkbuf;
OFCondition status;
DcmTagKey key;
DcmDataset *dataset = dcm->getDataset();
float rescaleIntercept;//= meta->getObjectPtr()->as_double(GADGETRON_IMAGE_SCALE_OFFSET);
float rescaleSlope;//= meta->getObjectPtr()->as_double(GADGETRON_IMAGE_SCALE_RATIO);
static bool studyUIDmade=false;
std::time_t rawtime;
std::time(&rawtime);
std::tm *timeinfo = std::localtime(&rawtime);
if(meta->getObjectPtr()->exists("GADGETRON_IMAGE_SCALE_OFFSET") && meta->getObjectPtr()->exists("GADGETRON_IMAGE_SCALE_RATIO"))
{
rescaleIntercept=meta->getObjectPtr()->as_double(GADGETRON_IMAGE_SCALE_OFFSET);
rescaleIntercept=meta->getObjectPtr()->as_double(GADGETRON_IMAGE_SCALE_OFFSET);
// Window Center
key.set(0x0028, 0x1050);
dataset->remove(key);
// Window Width
key.set(0x0028, 0x1051);
dataset->remove(key);
rescaleIntercept = -1.0*rescaleIntercept*rescaleSlope;
rescaleSlope= 1.0/rescaleSlope;
key.set(0x0028,0x1052);
ACE_OS::snprintf(buf, BUFSIZE, "%f", rescaleIntercept);//
WRITE_DCM_STRING(key, buf);
key.set(0x0028,0x1053);
ACE_OS::snprintf(buf, BUFSIZE, "%f", rescaleSlope);//meta->getObjectPtr()->as_double("Intercept"));
WRITE_DCM_STRING(key, buf);
key.set(0x0028, 0x0030);
ACE_OS::snprintf(buf, BUFSIZE, "%.6f\\%.6f", pixel_spacing_Y, pixel_spacing_X);
WRITE_DCM_STRING(key, buf);
}
key.set(0x0008,0x1030); //Study Description
dataset->findAndGetString(key, checkbuf, false);
if(checkbuf==NULL || !strcmp(checkbuf, "XXXXXXXX"))
{
ACE_OS::snprintf(buf, BUFSIZE, "%s", "Gadgetron^IEV");
WRITE_DCM_STRING(key, buf);
}
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";
//.........这里部分代码省略.........