PACS connection

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#46 Post by Mitmal »

Ahhh yes, it's a very good way which I will follow, thank you
Respectueusement,
MitMal

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#47 Post by Mitmal »

Perfect, it's even wrote:

Code: Select all

This function is most likely to be implemented by a derived class implementing a specific SCP behaviour
Respectueusement,
MitMal

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

#48 Post by Michael Onken »

Yes, I know, I wrote it :-)

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#49 Post by Mitmal »

Arf, I am lost, I created a class inheriting:

Code: Select all

#ifndef SCPPERSO_H
#define SCPPERSO_H
#include "scp.h"
#include "dcmtk/dcmnet/diutil.h"
#include "dcmtk/config/osconfig.h"

class ScpPerso : public DcmSCP
{
/*
	ScpPerso();
	~ScpPerso();
*/
	OFCondition handleIncomingCommand(T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presContextInfo);
}
#endif // SCPPERSO_H
But I'm a little lost in how to change the function:

Code: Select all

#include "scpPerso.h"

/*
ScpPerso::ScpPerso() 
{
}

ScpPerso::~DcmSCP()
{
}
*/

OFCondition ScpPerso::handleIncomingCommand(T_DIMSE_Message *msg, const DcmPresentationContextInfo &info)
{
	OFCondition cond;
	if( msg->CommandField == DIMSE_C_ECHO_RQ )
	{
		cond = handleECHORequest( msg->msg.CEchoRQ, info.presentationContextID );
	} 
	else 
	{
		OFString tempStr;
		DCMNET_ERROR("Cannot handle this kind of DIMSE command (0x"	<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4)	<< OFstatic_cast(unsigned int, msg->CommandField) << ")");
		DCMNET_DEBUG(DIMSE_dumpMessage(tempStr, *msg, DIMSE_INCOMING));
		cond = DIMSE_BADCOMMANDTYPE;
	}
	return cond;
}
Can I get help?
I would give the AET, the port of destination and the path of the images to the server.
Like to execute the command: storescp.exe --aetitle "AETxxx" -od "pathxxx" PORTxxx

What about the idea:

Code: Select all

DcmSCP *storescp = new DcmSCP();
	OFString OFaet = aet;				storescp->setAETitle(OFaet);
	UINT16 Uint16port = port.toInt();	storescp->setPort(Uint16port);
With a command to simulate the path and another to start the server?
Is it not possible?
Respectueusement,
MitMal

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#50 Post by Mitmal »

I am not progressing with the class ScpPerso, I do not see at all what to do.
In what should I change?

I do not understand the link between class and scp.cc storescp, can still help me??
Respectueusement,
MitMal

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

#51 Post by Michael Onken »

Hi,

They are not interrelated but can implement the same functionality, i.e. a DICOM storage service.

Michael

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#52 Post by Mitmal »

Can you help me with an example please??
Respectueusement,
MitMal

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

#53 Post by Michael Onken »

Hi,

sorry, no...you really have to understand DICOM first, then the usage of the classes is really 99% self-explanatory. Don't get me wrong, I like to help you but I cannot understand the topic for you or write the code.

Michael

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#54 Post by Mitmal »

I understand, only I do not know where to look to understand.
Do you have a link for me?
Respectueusement,
MitMal

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#55 Post by Mitmal »

Michael Onken wrote:Hi,

They are not interrelated but can implement the same functionality, i.e. a DICOM storage service.

Michael
Ok, but how? There is no start or hand function, then start the server?
I look in the class STORESCP.cc, I wanted to take the code for the main function, but it does not work. Is it a good idea?
Respectueusement,
MitMal

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#56 Post by Mitmal »

My solution is as follows (it does not work).
ScpPerso.h a file:

Code: Select all

#ifndef SCPPERSO_H
#define SCPPERSO_H
#include <QtGui>
#include "scp.h"
#include "dcmtk/dcmnet/diutil.h"
#include "dcmtk/config/osconfig.h"
#include "dcmtk/ofstd/ofstdinc.h"

class ScpPerso : public DcmSCP
{
public :
	/** Permet de manipuler un ensemble de commandes entrantes et de réagir en conséquence, par exemple \ réponse envoi via DIMSE_sendXXXResponse (). 
	Le gestionnaire de la norme ne connaît que la façon de traiter une demande d'écho en appelant handleEchoRequest (). 
	(Cette fonction est plus susceptible d'être mis en œuvre par une Classe dérivée mise en œuvre d'un comportement spécifique SCP.)
   */
	OFCondition handleIncomingCommand(T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presContextInfo);
	int startSTORESCP(int argc, char *argv[]);
};
#endif // SCPPERSO_H
And the ScpPerso.cc (with handleIncomingCommand + start methode found in storescp.cc ):

Code: Select all

#include "scpPerso.h"

OFCondition ScpPerso::handleIncomingCommand(T_DIMSE_Message *msg, const DcmPresentationContextInfo &info) {...}
///////////////////////////////////////////////////////////////////////
int ScpPerso::startSTORESCP(int argc, char *argv[]) {...}
Finally, the method is called in my program using the function:

Code: Select all

bool MedicTool2::initServiceStore(QString port, QString aet, QString path)
{
	//DcmSCP *storescp = new DcmSCP();
	//OFString OFaet = aet;				storescp->setAETitle(OFaet);
	//Uint16 Uint16port = port.toInt();	storescp->setPort(Uint16port);
	ScpPerso *scpP = new ScpPerso();
	path.replace("\\","/");
	//La commande doit etre du type : storescp.exe --aetitle "NEUROGDC2" -od "C:\Users\ARNGDC2\Desktop\Recuperation" 104
	int nbr = 3;
	char **commande = new char*[3];
	
	char commande1[256]; sprintf(commande1,"%s%s%s","--aetitle \"",aet,"\"");
	commande[0] = commande1;
	
	char commande2[256]; sprintf(commande2,"%s%s%s","-od \"",path,"\"");
	commande[1] = commande2;

	char* sport = new char[port.size() + 1]; strcpy(sport, port.toStdString().c_str());// pour le caractère de fin de chaine '\0'
	commande[2] = sport;

	scpP->startSTORESCP(nbr, commande);
	return true;
}
But the execution does not work.
The error is on line (In the start function) :

Code: Select all

prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
What do you think about my idea ??
Respectueusement,
MitMal

Roadrunner
Posts: 56
Joined: Mon, 2010-06-14, 16:41

#57 Post by Roadrunner »

Read the 2nd and the 3rd post

viewtopic.php?t=3043&highlight=receivedimsedataset

remove the DIMSE_storeProvider 'part' (and below) but
leave the lines between bzero and DIMSE_store...
for the sendSTOREResponse (which line you have to insert for
sending the positve or negative response).

Frank

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#58 Post by Mitmal »

Great, but now I look how I should call the function: handleIncomingCommand.
How do I retrieve parameters T_DIMSE_Message * incomingMsg and const DcmPresentationContextInfo & presContextInfo?
Respectueusement,
MitMal

Mitmal
Posts: 112
Joined: Mon, 2011-04-18, 19:36
Location: France

#59 Post by Mitmal »

Is it just with scpP->listen(); ???
Respectueusement,
MitMal

Roadrunner
Posts: 56
Joined: Mon, 2010-06-14, 16:41

#60 Post by Roadrunner »

Yes, with scp->listen you start the service.
How do I retrieve parameters T_DIMSE_Message * incomingMsg and
const DcmPresentationContextInfo & presContextInfo?
Well i am using the storescp.cfg from the etc directory so in configure there which sop class and transfer syntax i want to accept.

Frank

Locked

Who is online

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