HELP:: StoreSCU can not be called twice in application.

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
szpku2003
Posts: 2
Joined: Wed, 2009-01-07, 10:37

HELP:: StoreSCU can not be called twice in application.

#1 Post by szpku2003 »

Hi, Dear All:

I am trying to embed the StoreSCU module into my application source code.

The outside module may call StoreSCU module upon user's operation.

But I found that the first time I called storeSCU it runs ok, but after the first call, it will report error :

Following is the debug calling stack:
=========================
msvcr80d.dll!strcat(unsigned char * dst=0xcccccccc, unsigned char * src=0x99bda1e6) 行182 Asm
> WSBase.dll!DU_getStringDOElement(DcmItem * obj=0x010792a0, DcmTagKey t={...}, char * s=0x0012edd0) 行168 + 0xd 字节 C++
WSBase.dll!DU_findSOPClassAndInstanceInDataSet(DcmItem * obj=0x010792a0, char * sopClass=0x0012edd0, char * sopInstance=0x0012ed84, bool tolerateSpacePaddedUIDs=false) 行233 + 0x19 字节 C++
WSBase.dll!storeSCU(T_ASC_Association * assoc=0x01063db8, const char * fname=0x016f0a90) 行521 + 0x25 字节 C++
WSBase.dll!cstore(T_ASC_Association * assoc=0x01063db8, const OFString & fname={...}) 行633 + 0x19 字节 C++

==============================

And I also found that after the fist time called storeSCU method, other DCMTK method can not run properly until I restart the application.

So I am wondering that is there any global variables inside storescu, that after first time call StoreSCU, it did not reset to good satus properly.

So when I call StoreSCU or EchoSCU after it, it can not run.


I Debugged the application , I found the error is occured here:

DCMNET Module diutil.cxx Line 152:

OFBool
DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s)
{
DcmByteString *elem;
DcmStack stack;
OFCondition ec = EC_Normal;
char* aString;
//==== the reason may due to the second time I call storeScu,
//====This line , the search operation can not search a tag : 0008,0022
//Is this problem due to DCMFileFormat load operation did not load proper DCMDataset ?

ec = obj->search(t, stack);
elem = (DcmByteString*) stack.top();
if (ec == EC_Normal && elem != NULL) {
if (elem->getLength() == 0) {
s[0] = '\0';
} else {
ec = elem->getString(aString);
//====== for aString is null, and ec is illegal call, so it failed
strcpy(s, aString);
}
}
return (ec == EC_Normal);
}

Anybody help me ,give me some clue , thanks so much!!!

szpku2003
Posts: 2
Joined: Wed, 2009-01-07, 10:37

T

#2 Post by szpku2003 »

is there any posiibilities related with this line:

if (!dcmDataDict.isDictionaryLoaded())


For my understanding , The first call caused StoreSCU and ECHOSCU can not run anymore, so I think it may due to these two module share the Dictionary,

But anybody can exaplain me for furthere detail?

Thanks you !!

agilehawk
Posts: 1
Joined: Tue, 2008-09-23, 02:29

I also encountered the same problem, concerned about !

#3 Post by agilehawk »

I also encountered the same problem, concerned about

Emma_cao
Posts: 13
Joined: Mon, 2016-12-05, 10:51

Re: HELP:: StoreSCU can not be called twice in application.

#4 Post by Emma_cao »

I also encoutered this problem. I found if I delete dcmDataDict.clear(); it will work normally, but I don't know why. :oops:

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: HELP:: StoreSCU can not be called twice in application.

#5 Post by Michael Onken »

Hi,

storescu.cc is not meant to be used as a library. Instead you could and should use the Storage SCU (dstorscu.cc./h) derived from DcmSCU (scu.cc/h), both available in dcmnet.

Michael

Post Reply

Who is online

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