本文整理汇总了C++中DcmDataset::findAndGetElement方法的典型用法代码示例。如果您正苦于以下问题:C++ DcmDataset::findAndGetElement方法的具体用法?C++ DcmDataset::findAndGetElement怎么用?C++ DcmDataset::findAndGetElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DcmDataset
的用法示例。
在下文中一共展示了DcmDataset::findAndGetElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tstr
//.........这里部分代码省略.........
res = ditem->findAndGetUint16(DCM_Rows, imageRows).good();
if (!res)
{
LOG0("IO/IODicom::Read: Cannot fetch rows");
return false;
}
res = ditem->findAndGetUint16(DCM_Columns, imageColumns).good();
if (!res)
{
LOG0("IO/IODicom::Read: Cannot fetch columns");
return false;
}
oMetaDataObject.SetSize(PGMath::Vector3D<int>(imageColumns, imageRows, 1));
#ifdef _DEBUG
LOG2("\tIODicom::Read: Size: Rows: %d, Columns: %d", imageRows, imageColumns);
#endif
// number of bits
Uint16 imageBitsAllocated = 0;
res = ditem->findAndGetUint16(DCM_BitsAllocated, imageBitsAllocated).good();
if (!res)
{
LOG0("IO/IODicom::Read: Cannot fetch bits allocated");
return false;
}
oMetaDataObject.SetNumberOfBits(imageBitsAllocated);
#ifdef _DEBUG
LOG1("\tIODicom::Read: bits allocated: %d", imageBitsAllocated);
#endif
// spacing
Float64 sx=1, sy=1;
DcmElement *elem = 0;
OFCondition cond = dataset->findAndGetElement(DCM_PixelSpacing, elem);
if(!cond.good())
{
LOG1("IO/IODicom::Read:Warning Cannot fetch pixel spacing (%s)", cond.text());
} else
{
cond = elem->getFloat64(sx, 0);
if(!cond.good())
{
LOG1("IO/IODicom::Read:Warning Cannot fetch pixel X spacing (%s)", cond.text());
}
cond = elem->getFloat64(sy, 1);
if(!cond.good())
{
LOG1("IO/IODicom::Read:Warning Cannot fetch pixel Y spacing (%s)", cond.text());
}
}
if (sx!=sy)
{
LOG2("IO/IODicom::Read:Warning: X/Y spacings (%3.2f, %3.2f) mismatch. Ignoring anisotrpy", sx, sy);
sy = sx;
}
#ifdef _DEBUG
LOG2("\tIODicom::Read: pixel X and Y spacings (%3.5f %3.5f)",sx, sy);
#endif
oMetaDataObject.SetSpacing(PGMath::Vector3D<float>(sx, sy, 1));
// STUDY UID
OFString studyUIDStr;
res = dataset->findAndGetOFString(DCM_StudyInstanceUID, studyUIDStr).good();