`
qimo601
  • 浏览: 3416690 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

DCMTK从一组DICOM序列图像中获取一项

阅读更多

 

Howto: Get information from a sequence item

The following example shows, how to get the Code Meaning from the Procedure Code Sequence.

 

#include "dcmtk/config/osconfig.h" 
#include "dcmtk/dcmdata/dctk.h"
 
int main(int argc, char *argv[]) 
{
    DcmFileFormat fileformat;
    if (fileformat.loadFile("test.dcm").good())
    {
        DcmItem *item = NULL;
        DcmDataset *dataset = fileformat.getDataset();
        if (dataset->findAndGetSequenceItem(DCM_ProcedureCodeSequence, item, 0 /* first item */).good())
        {
            OFString codeMeaning;
            if (item->findAndGetOFString(DCM_CodeMeaning, codeMeaning).good())
            {
                /* output value of "codeMeaning" or do something else with this information */
            }
        }
    }
    return 0;
}
 

------------------------------------------------------------------

柳北风儿

http://qimo601.iteye.com

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics