how to save study using dcmtk.3.6.0/3.6.1

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
vishu2111
Posts: 35
Joined: Thu, 2013-11-21, 13:42

how to save study using dcmtk.3.6.0/3.6.1

#1 Post by vishu2111 »

hi,

I want to find study from dicom server and store on local drive.how should I do it using dcmtk 3.6.0/3.6.1? but without using movescu..I need programatically.

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: how to save study using dcmtk.3.6.0/3.6.1

#2 Post by J. Riesmeier »

What about using the DcmSCU class? Here's an example: http://support.dcmtk.org/wiki/dcmtk/how ... cu-example

vishu2111
Posts: 35
Joined: Thu, 2013-11-21, 13:42

Re: how to save study using dcmtk.3.6.0/3.6.1

#3 Post by vishu2111 »

but how to store image on hard drive? I'm not getting the code.

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: how to save study using dcmtk.3.6.0/3.6.1

#4 Post by J. Riesmeier »

For C-MOVE, you need a separate Storage SCP, e.g. the one implemented by the new DcmStorageSCP class.
For C-GET, the DcmSCU class should provide everything you need...

vishu2111
Posts: 35
Joined: Thu, 2013-11-21, 13:42

Re: how to save study using dcmtk.3.6.0/3.6.1

#5 Post by vishu2111 »

please can you provide a simple code to store image?

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: how to save study using dcmtk.3.6.0/3.6.1

#6 Post by J. Riesmeier »

Look into the source code of dcmrecv!

Here the relevant part:

Code: Select all

    /* start with the real work */
    DcmStorageSCP storageSCP;
    OFCondition status;

    OFLOG_INFO(dcmrecvLogger, "configuring service class provider ...");

    /* set general network parameters */
    storageSCP.setPort(opt_port);
    storageSCP.setAETitle(opt_aeTitle);
    storageSCP.setMaxReceivePDULength(opt_maxPDULength);
    storageSCP.setACSETimeout(opt_acseTimeout);
    storageSCP.setDIMSETimeout(opt_dimseTimeout);
    storageSCP.setDIMSEBlockingMode(opt_blockingMode);
    storageSCP.setVerbosePCMode(opt_showPresentationContexts);
    storageSCP.setRespondWithCalledAETitle(opt_useCalledAETitle);
    storageSCP.setHostLookupEnabled(opt_HostnameLookup);
    storageSCP.setDirectoryGenerationMode(opt_directoryGeneration);
    storageSCP.setFilenameGenerationMode(opt_filenameGeneration);
    storageSCP.setFilenameExtension(opt_filenameExtension);
    storageSCP.setDatasetStorageMode(opt_datasetStorage);

    /* load association negotiation profile from configuration file (if specified) */
    if ((opt_configFile != NULL) && (opt_profileName != NULL))
    {
        status = storageSCP.loadAssociationConfiguration(opt_configFile, opt_profileName);
        if (status.bad())
        {
            OFLOG_FATAL(dcmrecvLogger, "cannot load association configuration: " << status.text());
            return EXITCODE_INVALID_ASSOCIATION_CONFIG;
        }
    } else {
        /* report a warning message that the SCP will not accept any Storage SOP Classes */
        OFLOG_WARN(dcmrecvLogger, "no configuration file specified, SCP will only support the Verification SOP Class");
    }

    /* specify the output directory (also checks whether directory exists and is writable) */
    status = storageSCP.setOutputDirectory(opt_outputDirectory);
    if (status.bad())
    {
        OFLOG_FATAL(dcmrecvLogger, "cannot specify output directory: " << status.text());
        return EXITCODE_INVALID_OUTPUT_DIRECTORY;
    }

    OFLOG_INFO(dcmrecvLogger, "starting service class provider and listening ...");

    /* start SCP and listen on the specified port */
    status = storageSCP.listen();
    if (status.bad())
    {
        OFLOG_FATAL(dcmrecvLogger, "cannot start SCP and listen on port " << opt_port << ": " << status.text());
        return EXITCODE_CANNOT_START_SCP_AND_LISTEN;
    }

vishu2111
Posts: 35
Joined: Thu, 2013-11-21, 13:42

Re: how to save study using dcmtk.3.6.0/3.6.1

#7 Post by vishu2111 »

thank you..I will try...

vishu2111
Posts: 35
Joined: Thu, 2013-11-21, 13:42

Re: how to save study using dcmtk.3.6.0/3.6.1

#8 Post by vishu2111 »

still I am unable to get file from pacs server

Post Reply

Who is online

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