文件中Tag值"/>
dcmtk读取dcm文件中Tag值
读取病人信息等,可根据宏定义自由设置读取其他信息,代码如下:
{ DcmFileFormat fileformat;OFCondition dcmFile = fileformat.loadFile("G:/DXL/DXL_CCTA/1.2.392.200036.9116.2.1220972159.1406529370.671878.1.1_anon.dcm"); //读取Dicom图像if (!dcmFile.good()) //判断Dicom文件是否读取成功{std::cout << "file Load error" << std::endl;return;}DcmDataset *dataset = fileformat.getDataset(); //得到Dicom的数据集OFString patientname;dataset->findAndGetOFString(DCM_PatientName, patientname); //获取病人姓名qDebug() << "patientname:" << QString::fromStdString(patientname) << endl;OFString isRGB;dataset->findAndGetOFString(DCM_PhotometricInterpretation, isRGB); // DCM图片的图像模式unsigned short bit_count(0);dataset->findAndGetUint16(DCM_BitsStored, bit_count); //获取像素的位数 bit
}
更多推荐
dcmtk读取dcm文件中Tag值
发布评论