PACS connection
Moderator: Moderator Team
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
MitMal
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Arf, I am lost, I created a class inheriting:
But I'm a little lost in how to change the function:
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:
With a command to simulate the path and another to start the server?
Is it not possible?
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
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;
}
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);
Is it not possible?
Respectueusement,
MitMal
MitMal
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Ok, but how? There is no start or hand function, then start the server?Michael Onken wrote:Hi,
They are not interrelated but can implement the same functionality, i.e. a DICOM storage service.
Michael
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
My solution is as follows (it does not work).
ScpPerso.h a file:
And the ScpPerso.cc (with handleIncomingCommand + start methode found in storescp.cc ):
Finally, the method is called in my program using the function:
But the execution does not work.
The error is on line (In the start function) :
What do you think about my idea ??
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
Code: Select all
#include "scpPerso.h"
OFCondition ScpPerso::handleIncomingCommand(T_DIMSE_Message *msg, const DcmPresentationContextInfo &info) {...}
///////////////////////////////////////////////////////////////////////
int ScpPerso::startSTORESCP(int argc, char *argv[]) {...}
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;
}
The error is on line (In the start function) :
Code: Select all
prepareCmdLineArgs(argc, argv, OFFIS_CONSOLE_APPLICATION);
Respectueusement,
MitMal
MitMal
-
- Posts: 56
- Joined: Mon, 2010-06-14, 16:41
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
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
-
- Posts: 56
- Joined: Mon, 2010-06-14, 16:41
Who is online
Users browsing this forum: Google [Bot] and 0 guests