How to make use of "dcmnet" in my own application?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ramboy
Posts: 1
Joined: Sun, 2006-04-23, 13:31

How to make use of "dcmnet" in my own application?

#1 Post by ramboy »

Hi,
:?
I have achieved using storescu.exe as a client and storescp.exe as a server to transmit dcm-files under win32.

In order to implement this function in my own application rather than use .exe applications,i attempted to make use of the dcmnet.lib created by dicomtk,however,i found there wasn't any public class available for me.

Should I turn to the source codes of dcmnet in dicomtk(such as echoscu.cxx,movescu.cxx,storescp.cxx etc.) and creat public class by making modification of them? But the complicated and large number of source codes show it would be a lot of difficults to get my goal?

Please help me,Any suggestions would be warmly welcome!!!
Thx.

ramboy

roydobbins
Posts: 25
Joined: Wed, 2005-07-20, 22:42
Location: Payson, Arizona

#2 Post by roydobbins »

One approach to easing the pain of initially getting something working is to use child processes, ie run the .EXE from your application, supply the necessary command line parameters, and collect the results back from the child process.

In this way, you can (at least at first) avoid the problems of trying to link the lib with your application. This can be very difficult, if you have an environment, or compiler which is different from that used to implement the toolkit (the forum is full of issues related to just that).

Once you have your application successfully talking to DICOM, you can begin to explore the approach of linking the library, but always from the standpoint of an already working application --- you will then always have something to compare with and help with solving bugs.

Hope this helps
Regards,
--roy

Alexander Fedotov
Posts: 53
Joined: Thu, 2005-04-14, 15:07
Location: St. Petersburg, Russia

Re: How to make use of "dcmnet" in my own application?

#3 Post by Alexander Fedotov »

[quote="ramboy"]
Should I turn to the source codes of dcmnet in dicomtk(such as echoscu.cxx,movescu.cxx,storescp.cxx etc.) and creat public class by making modification of them?[/quote]

Sorry, it is not clear what you want.

As for me, I use all necessary DCMTK classes "directly".

For example:
#include "dcmtk/dcmdata/dcfilefo.h" // for the file
#include "dcmtk/dcmimgle/dcmimage.h" // for the image
#include "dcmtk/dcmdata/dcdeftag.h" // for the tags

class CDicomImage : public DcmFileFormat
{
...........
};

or this way

class CDicomImage : public DcmFileFormat
{
DcmFileFormat* m_pDcmFileFormat;
...........
};

Sometime I change the source code, like this (dcrleccd.cxx):

// initialize pointer to output data
//pixelPointer = imageData8 + sampleOffset + imageBytesAllocated - byte - 1;
// changed by Fedotov 27.07.2005 according to Dr. Marco Eichelberg
// instructions
pixelPointer = imageData8 + sampleOffset + byte;

Another example (dcmpstat.cxx):
// edited by Fedotov
//result=EC_IllegalCall;
shutterPresentationValue.putUint16(DEFAULT_shutterPresentationValue,0);

Regards,
Alexander

Post Reply

Who is online

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