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

转载: http://support.dcmtk.org/wiki/dcmtk/howto/getsequenceitem

你可能感兴趣的:(DCMTK,DCMTK例子,DICOM,序列)