I am working with a WSI Dicom image and I am trying to extract "Total Pixel Matrix Columns " tag's value. If I read the metadata and output it, I can see that this tag exists in the file.
Code: Select all
(0048, 0001) Imaged Volume Width FL: 9.72800064086914
(0048, 0002) Imaged Volume Height FL: 18.944000244140625
(0048, 0003) Imaged Volume Depth FL: 9.999999747378752e-05
(0048, 0006) Total Pixel Matrix Columns UL: 38912
(0048, 0007) Total Pixel Matrix Rows UL: 75776
Code: Select all
auto dcm_ff = DcmFileFormat();
dcm_ff.loadFile("/mnt/hdd8/axle/data/1.3.46.670589.45.1.1.13461215855660.1.2548.1506597645355.5.dcm");
auto dcm_tag_key = DcmTagKey(0x0048,0x0007) ;
std::cout << dcm_tag_key.toString() << std::endl;
unsigned long int height;
auto tmp = dcm_ff.getDataset()->findAndGetUint64(dcm_tag_key, height);
std::cout << "code = " << tmp.text() << std::endl;
std::cout<< "height = " << height << std::endl;
Thanks!