Overlay data Probleam

I can’t read overlay data (6000, 3000). The code below.
The result is always “AAAAAAAAAAAAAAAAA…”

    using ItkPixelType = signed short;
	constexpr unsigned int Dimension = 2;
	

	using ImageType = itk::Image<ItkPixelType, Dimension>;
	using ReaderType = itk::ImageFileReader<ImageType>;

	ReaderType::Pointer reader = ReaderType::New();
	using ImageIOType = itk::GDCMImageIO;
	ImageIOType::Pointer dicomIO = ImageIOType::New();

	reader->SetFileName(filename);
	reader->SetImageIO(dicomIO);

	try {
		reader->Update();
	}
	catch (itk::ExceptionObject &ex) {
		std::cout << ex << std::endl;
		return EXIT_FAILURE;
	}

	using DictionaryType = itk::MetaDataDictionary;
	const DictionaryType &dictionary = dicomIO->GetMetaDataDictionary();

	using MetaDataStringType = itk::MetaDataObject<std::string>;

	using MetaDataUint8Type = itk::MetaDataObject<unsigned char>;

	std::string overlay_data;
	dicomIO->GetValueFromTag("6000|3000", overlay_data);

Thanks,
wq

What do other DICOM tag readers (e.g. Slicer) say your file contains in “6000|3000”? What does this example print?

Sorry, I can’t open your link. I read my dicom with RadiAnt DICOM Viewer, and it shows (6000, 3000) 0000 0000 0000 0000 …

You may need to do base64 decoding for binary tags. See Supported DICOM metadata types.

Here is an updated link for the example.

1 Like

Overlay is a very, very old way of storing a few binary bitmap layers that can be displayed over the image. It is also very limited in that there is no standard way of specifying what the overlay contains (with proper standard terminology), number of layers are limited, the layers are stored along with the image (so if you change the layers then you need to store the entire image again), etc. Most modern software do not use this DICOM tag (especially not for quantitative analysis) and you cannot expect any software or libraries to add support for it today.

Instead, segmentations should be stored in DICOM Segmentation Objects, and measurements in DICOM Structured Reports.