C++ GDCM:获取标记值
我正在尝试读取和写入dicom文件的属性值。 接口应如下所示:C++ GDCM:获取标记值,c++,gdcm,C++,Gdcm,我正在尝试读取和写入dicom文件的属性值。 接口应如下所示: // only need to support std::string, int, float, float*, etc. template<class T> T getTagValue(const DataSet& ds, const Tag& tag); template<class T> void setTagValue(DataSet& ds, const Tag&
// only need to support std::string, int, float, float*, etc.
template<class T>
T getTagValue(const DataSet& ds, const Tag& tag);
template<class T>
void setTagValue(DataSet& ds, const Tag& tag, const T& value);
sf=gdcm.StringFilter()
sf.SetFile(r.GetFile())
print sf.ToStringPair(gdcm.Tag(0x0028,0x0010))
const DataSet &ds = file.GetDataSet();
Attribute<0x0020,0x0032> at;
at.Set( ds );
if( at.GetValue() == 0.0 ) exit(1);
const数据集&ds=file.GetDataSet();
属性在;
at.Set(ds),;
如果(at.GetValue()==0.0)退出(1);
如有任何建议,我们将不胜感激。您已在GDCM邮件列表上发布了一条准确的复制/粘贴消息:
是的,我只是希望得到这个问题的最佳实践。我没想到会有人看到这个问题的两面。再次感谢您的回答。:)
const DataSet &ds = file.GetDataSet();
Attribute<0x0020,0x0032> at;
at.Set( ds );
if( at.GetValue() == 0.0 ) exit(1);