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();


	try {
	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);


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