Private tag writing error Illegal call, perhaps wrong parame

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
SachinP
Posts: 3
Joined: Tue, 2017-04-04, 16:28

Private tag writing error Illegal call, perhaps wrong parame

#1 Post by SachinP »

Hi,

With DCMTK 3.6.0, I can write private tag successfully with explicit VR but without VR getting error of "0001:0007 Illegal call, perhaps wrong parameters"


Below given code, please let me know problematic area .

Code: Select all

	DcmDataDictionary &dict = dcmDataDict.wrlock();
	dict.addEntry(new DcmDictEntry(0x0009,0x3345, EVR_DS, "TP", 1, 1, NULL, OFFalse, "comp"));
	dcmDataDict.unlock();

	DcmTag dcmTag(0x0009, 0x0033, EVR_LO);
	OFCondition cond;
	cond = static_cast<DcmItem*>(m_pElement)->putAndInsertString(dcmTag, "comp");

	OFString error_str;
	
	DcmTag dcmTag1(0x0009, 0x3345);
	cond = static_cast<DcmItem*>(m_pElement)->putAndInsertString(dcmTag1, "Test PR");

	DimseCondition::dump(error_str, cond);
	OFLOG_DEBUG(dcmtkWrapperLogger, "Tag = " << PADHEX(dcmTag1.getETag()) << "retValue = " << cond.status() << "ErrorMsg=" << error_str.c_str());

Please check and help to find issue.

Thanks & Regards
Sachin

SachinP
Posts: 3
Joined: Tue, 2017-04-04, 16:28

Re: Private tag writing error Illegal call, perhaps wrong pa

#2 Post by SachinP »

Hi,

It is observed that private tag is taking unknwon VR, actually it shall take VR from dictionary.

What could be reason of not taking proper VR from dictionary?

Regards,
Sachin

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

Re: Private tag writing error Illegal call, perhaps wrong pa

#3 Post by J. Riesmeier »

In line "DcmTag dcmTag1(0x0009, 0x3345);" you either have to provide the VR or the Private Creator as the third (optional) parameter.

SachinP
Posts: 3
Joined: Tue, 2017-04-04, 16:28

Re: Private tag writing error Illegal call, perhaps wrong pa

#4 Post by SachinP »

Hi,

Thanks. With DCMTK 3.6.0 it worked by explicitily passing VR. But in DCM file it shows as below.

(0009,0033) : private mapped to (0009,00FF) LO 1 Comp
(0009,3345) : private mapped to (0009,FF45) UN 1 4E65772050726F746F636F6C

Is correct behaviour? Please confirm bold part.

Thanks and Regards,
Sachin

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

Re: Private tag writing error Illegal call, perhaps wrong pa

#5 Post by J. Riesmeier »

The private data element (0009,3345) shouldn't be stored as "UN" unless you've written the dataset with Implicit VR Little Endian (and the dump tool does not know about your private attributes).

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest