DICOM 시퀀스 이미지 세트에서 DCMTK 가져오기


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

좋은 웹페이지 즐겨찾기