DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sun, 2018-01-21, 15:02

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Using DCMPRINT low level
PostPosted: Fri, 2007-10-26, 00:02 
Offline

Joined: Fri, 2007-07-27, 20:40
Posts: 3
Hi all,

I am developing DICOM viewer application with MS Visual Studio 2005.
I have evaluation lisence of DCMPRINT. The Documantation is too poor.(maybe reason evaluation lisence?) There is no documantation on DCMPRINT classes and their functions.

- Is there any way to print DcmFileFormat class or DicomImage class without save to x.dcm file on local drive. (For example rendered annotation and/or length measurements over orginal image. (to gain time) )

- Is there any way to print N-th frame from multiframe images using tcpprt.

Thank in advance.

Kubilay

_________________
Kubilay


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 2007-10-31, 10:03 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Tue, 2004-11-02, 17:22
Posts: 1209
Location: Oldenburg, Germany
While the documentation certainly leaves much to be deserved, you can generate hypertext API documentation with doxygen, together with the DCMTK sources. I am writing this from memory, but in principle using the print client works as follows:
  • Create a DicomImage instance (using DCMTK's DicomImage class from module dcmimgle/dcmimage to manage the DICOM image you want to print. This class has methods to apply window level/width, VOI LUTs, etc.
  • Create an instance of class PSVDicomObject (declared in dcmtk/dcmprint/psvdic1.h) and use getDataset() to retrieve a pointer to the dataset managed by this object
  • write the frame you want to have printed into this dataset using DicomImage::writeFrameToDataset()
  • send the pixel data to the print server using PSVModelImageBox::downloadImageObject(), which takes a reference to the PSVDicomObject instance as a parameter
Of course this implies that the network connection has already been established, a basic film session and a basic film box been created.


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 2007-11-03, 04:42 
Offline

Joined: Fri, 2007-07-27, 20:40
Posts: 3
Hi Marco,

Thanks for answer.

Your descriptions very helpfull for me. But I am trying easyer way:

-I create new class in psvaoutoi.cxx (I dont want to chance psvauto.cxx):
Quote:
class PSVAutoImageView : public PSVView

That is same as yours PSVAutomaticView class except OFList<OFString>& fileNames. I replace that with PSVDicomObject. Main chances below

Quote:

private: System::Void button11_Click(System::Object^ sender, System::EventArgs^ e) {
const char *local_aetitle=NULL;
const char *printer_aetitle=NULL;
const char *printer_address=NULL;

WSAData winSockData;
WORD winSockVersionNeeded = MAKEWORD( 1, 1 );
WSAStartup(winSockVersionNeeded, &winSockData);

PSVDebug debug(LOGFILENAME,1);

const char *opt_automode = "1";
PSVDicomObject *ImageList;

const char *opt_cfgfile=CFGFILENAME;
ImageList = new PSVDicomObject("C:\\DICOM Images\\Demo\\VOLBRAIN.DCM", debug);

DIMSE_debug(OFFalse);
OFBool opt_verbose=Parameter->Verbose;
dcmConnectionTimeout.set(OFstatic_cast(Sint32, Parameter->ConnectionTimeout));

PSVDicomStringAE clientAE(debug);
PSVDicomStringAE serverAE(debug);

local_aetitle=Parameter->pLocalAETitle;
clientAE = local_aetitle;

printer_aetitle=Parameter->pServerAETitle;
serverAE=printer_aetitle;

STD_NAMESPACE ifstream cfgfile(opt_cfgfile);
if (!cfgfile) {
return;
}
PSVConfig config(cfgfile,debug);

PSVString autoDF(debug);
if (opt_automode)
autoDF = opt_automode;

long maxPDU = ASC_DEFAULTMAXPDU;
dcmEnableBackwardCompatibility.set(0x100); // enable DUL compatibility options
PSVNetwork network(0, 0, 30, OFFalse, OFFalse, debug, OFstatic_cast(DIC_UL, maxPDU));
if (! network.statusOK()) {
return;
}

PSVTCPIostreamClient tcpclient(config, clientAE, serverAE, OFFalse, Parameter->pTarget, debug);
tcpclient.startAssociationRequest(network);
if (tcpclient.associationEstablished()) {
PSVModelPrinter printer(tcpclient, debug);
PSVModelBasicFilmSession session(config, tcpclient, debug);
unsigned short status = session.initialize();
if (!STATUS_IS_SUCCESS(status)) {
return;
}
PSVAutoImageView autoview(session, autoDF, config, ImageList, debug);
autoview.execute(CERR);
// release association
tcpclient.releaseAssociation();
} else {
PSVAssociation *assoc = tcpclient.getAssociation();
if (assoc && assoc->associationEstablished())
assoc->abort();
return;
}
delete ImageList;
WSACleanup();
return;
}



(I will create PSVDicomObject from DicomImage as your suggestion later)
...
Quote:
// find entry j+fileOffset
/* if (ImageList.size() <= (unsigned long)j+fileOffset) tmpstring = "";
else
{
first = ImageList.begin();
for (l = j+fileOffset; l; --l) ++first;
}
if (tmpstring.length() > 0)
{
out << AUTO_DOWNLOAD << tmpstring << OFendl;
*/
pconfig->save_cursor();

/////////////////////////////////////////////////////////////////////////////////

status = imageBox->downloadImageObject(*pconfig,*ImageList,"");
// status = imageBox->downloadImageFile(*pconfig, tmpstring.getpchar());

//////////////////////////////////////////////////////////////////////////////////


pconfig->restore_cursor();
if (status != 0)
out << AUTO_STATUS << imageBox->translateStatus(status) << OFendl;
else
{
pconfig->set_section(0, L0_FRAME);
if (pconfig->section_valid(0))
{
tmpstring = pconfig->get_key_value();
tmpstring.convertto(j);
k = imageBox->countNumberOfFrames();
if (k>1)
{
if (j>0) j-=1; else j=0;
if (j >= k) j=k-1;
out << AUTO_SETFRAME << j+1 << OFendl;
pconfig->save_cursor();
status = imageBox->setFrame(*pconfig, j);
if (status != 0)
out << AUTO_STATUS << imageBox->translateStatus(status) << OFendl;
pconfig->restore_cursor();
}
}
pconfig->set_section(0, L0_VOI);
if (pconfig->section_valid(0))
{
tmpstring = pconfig->get_key_value();
tmpstring.convertto(j);
k = imageBox->countVOIs();
k=2;
if (k>0)
{
if (j>0) j-=1; else j=0;
if (j >= k) j=k-1;
out << AUTO_SETVOI << j+1 << OFendl;
pconfig->save_cursor();
status = imageBox->setVOI(*pconfig, j);
if (status != 0)
out << AUTO_STATUS << imageBox->translateStatus(status) << OFendl;
pconfig->restore_cursor();
}
}
}
pconfig->set_section(0, L0_POLARITY);
if (pconfig->section_valid(0))
{
tmpstring = pconfig->get_key_value();
out << AUTO_SETPOLARITY << tmpstring << OFendl;
pconfig->save_cursor();
status = imageBox->setPolarity(tmpstring.getpchar());
if (status != 0)
out << AUTO_STATUS << imageBox->translateStatus(status) << OFendl;
pconfig->restore_cursor();
}
pconfig->set_section(0, L0_MAGNIFICATION);
if (pconfig->section_valid(0))
{
tmpstring = pconfig->get_key_value();
out << AUTO_SETIMAGNIFICATION << tmpstring << OFendl;
pconfig->save_cursor();
status = imageBox->setMagnification(tmpstring.getpchar());
if (status != 0)
out << AUTO_STATUS << imageBox->translateStatus(status) << OFendl;
pconfig->restore_cursor();
}
pconfig->set_section(0, L0_SMOOTHING);
if (pconfig->section_valid(0))
{
tmpstring = pconfig->get_key_value();
out << AUTO_SETISMOOTHING << tmpstring << OFendl;
pconfig->save_cursor();
status = imageBox->setSmoothing(tmpstring.getpchar());
if (status != 0)
out << AUTO_STATUS << imageBox->translateStatus(status) << OFendl;
pconfig->restore_cursor();
}
pconfig->set_section(0, L0_REQUESTEDSIZE);
if (pconfig->section_valid(0))
{
tmpstring = pconfig->get_value();
tmpstring.convertto(dbl);
out << AUTO_SETIMAGESIZE << dbl << "mm" << OFendl;
pconfig->save_cursor();
status = imageBox->setRequestedImageSize(dbl);
if (status != 0)
out << AUTO_STATUS << imageBox->translateStatus(status) << OFendl;
pconfig->restore_cursor();
}
// }




I can print images but images as VOILUT=1 in tcpprt.conf remarked.
Images too dark. But images ok when I send to same image with tcpprt_e.exe with same tcpprt.cnf file. Where is the mistake I couldn't find?

Comments:
-imageBox->countVOIs(); value =0
-PSVModelImageBox::imageObjectOwned will not set 1. Because that variable private.

Thanks in advance.

_________________
Kubilay


Top
 Profile  
 
 Post subject:
PostPosted: Mon, 2007-11-12, 14:15 
Offline

Joined: Fri, 2007-07-27, 20:40
Posts: 3
I solved that problem. I anyone ask I can send final source code.

Last Question before permannent Licencing:

- My evaluation licenced tool not included tcpsvr source code. Is permanent licenced included that.

_________________
Kubilay


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 2007-11-13, 11:58 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Tue, 2004-11-02, 17:22
Posts: 1209
Location: Oldenburg, Germany
Quote:
My evaluation licenced tool not included tcpsvr source code. Is permanent licenced included that.
There are different permanent licenses available - with or without full source code access to the print server component, at different prices. The print client component is always shipped in source code, because you need that to integrate with your own application. For details send e-mail to dicom /at/ offis /dot/ de.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group