When Decompressing DICOM get "Tag not found" error

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
vignesh
Posts: 14
Joined: Mon, 2020-01-20, 11:44

When Decompressing DICOM get "Tag not found" error

#1 Post by vignesh »

Hi,

I am using DCMTK 3.6.4 version. when decompressing DICOM file ,i am facing "Tag not found" error.

Sample Code :

Code: Select all

int main(int argc, char* argv[])
{
	DJDecoderRegistration::registerCodecs();
	DJEncoderRegistration::registerCodecs();

	OFCondition status = EC_Normal;
	DcmFileFormat file;
	std::string filepath = "F:/test_data/1.dcm";
	status = file.loadFile(filepath.c_str());
	if (status.good())
	{
		DcmDataset *data = file.getDataset();
		status = data->chooseRepresentation(EXS_LittleEndianExplicit, NULL);
		if (status.good())
			std::cout << "DeCompression Succeed" << std::endl;
		else
			std::cout << "Failed to DeCompress :" << status.text() << std::endl;
	}
}
and also i have verified in dcmdjpeg utility, here also facing same error

Code: Select all

F: Tag not found: decompressing file: F:/test_data/output.dcm
I have attached dicom file https://drive.google.com/file/d/1--oUNF ... drive_link


Thanks in advance.
Last edited by vignesh on Wed, 2024-08-14, 10:37, edited 1 time in total.

J. Riesmeier
DCMTK Developer
Posts: 2541
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: When Decompressing DICOM get "Tag not found" error

#2 Post by J. Riesmeier »

Unfortunately, the log output of dcmdjpeg is not very useful in this case, but after looking at the dump output of the DICOM file, it seems that the mandatory Photometric Interpretation (0028,0004) attribute is missing in the main dataset. Also using dcmj2pnm gives you more details (e.g. another data element is missing):

Code: Select all

E: can't change to unencapsulated representation for pixel data
W: DcmElement: Mandatory element SamplesPerPixel (0028,0002) is missing
E: can't decompress first frame: Corrupted data
E: can't determine 'PhotometricInterpretation' of decompressed image
E: mandatory attribute 'PhotometricInterpretation' is missing or can't be determined
F: Missing attribute
By the way, DCMTK 3.6.4 is rather old. The current release is version 3.6.8.

vignesh
Posts: 14
Joined: Mon, 2020-01-20, 11:44

Re: When Decompressing DICOM get "Tag not found" error

#3 Post by vignesh »

Hi Riesmeier,

Thanks for your response.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest