DCMTK: DcmStorageSCP Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
DcmStorageSCP Class Reference

Interface class for a Storage Service Class Provider (SCP). More...

Inheritance diagram for DcmStorageSCP:

## Public Types
enum | E_DirectoryGenerationMode { DGM_NoSubdirectory , DGM_SeriesDate , DGM_Default = DGM_NoSubdirectory }
| modes for generating subdirectories More...
enum | E_FilenameGenerationMode { FGM_SOPInstanceUID , FGM_UniqueFromNewUID , FGM_ShortUniquePseudoRandom , FGM_CurrentSystemTime , FGM_Default = FGM_SOPInstanceUID }
| modes for generating filenames More...
enum | E_DatasetStorageMode { DGM_StoreToFile , DGM_StoreBitPreserving , DSM_Ignore , DSM_Default = DGM_StoreToFile }
| modes specifying whether and how to store the received datasets More...

## Public Member Functions
| DcmStorageSCP ()
| default constructor
virtual | ~DcmStorageSCP ()
| destructor
virtual void | clear ()
| clear the internal member variables, i.e. set them to their default values
const OFString & | getOutputDirectory () const
| get the output directory to be used for the storage of the received DICOM datasets.
E_DirectoryGenerationMode | getDirectoryGenerationMode () const
| get the mode for generating subdirectories used to store the received datasets
E_FilenameGenerationMode | getFilenameGenerationMode () const
| get the mode for generating filenames for the received datasets
const OFString & | getFilenameExtension () const
| get the filename extension that is appended to the generated filenames
E_DatasetStorageMode | getDatasetStorageMode () const
| get the mode specifying whether and how to store the received datasets
OFCondition | setOutputDirectory (const OFString &directory)
| specify the output directory to be used for the storage of the received DICOM datasets.
void | setDirectoryGenerationMode (const E_DirectoryGenerationMode mode)
| set the mode for generating subdirectories used to store the received datasets.
void | setFilenameGenerationMode (const E_FilenameGenerationMode mode)
| set the mode for generating filenames for the received datasets.
void | setFilenameExtension (const OFString &extension)
| specify the filename extension to be appended to the generated filenames.
void | setDatasetStorageMode (const E_DatasetStorageMode mode)
| set the mode specifying how to store the received datasets.
OFCondition | loadAssociationConfiguration (const OFString &filename, const OFString &profile)
| load an association negotiation profile from a configuration file.
Public Member Functions inherited from DcmSCP
| DcmSCP ()
| Constructor.
virtual | ~DcmSCP ()
| Virtual destructor, frees internal memory.
virtual OFCondition | listen ()
| Starts providing the implemented services to SCUs.
virtual OFCondition | openListenPort ()
| Alternative interface to providing the implemented services to SCUs.
virtual OFCondition | acceptAssociations ()
| Alternative interface to providing the implemented services to SCUs.
OFCondition | setEnableVerification (const OFString &profile="DEFAULT")
| Enables negotiation of the Verification SOP Class.
virtual OFCondition | addPresentationContext (const OFString &abstractSyntax, const OFList< OFString > &xferSyntaxes, const T_ASC_SC_ROLE requestorRole=ASC_SC_ROLE_DEFAULT, const OFString &profile="DEFAULT")
| Add abstract syntax to presentation contexts the SCP is able to negotiate with SCUs.
void | setPort (const Uint16 port)
| Set SCP's TCP/IP listening port.
void | setAETitle (const OFString &aetitle)
| Set AE title of the server.
void | setRespondWithCalledAETitle (const OFBool useCalled)
| Set SCP to use the called AE title from the SCU request for the response, i.e. the SCP will always respond with setting it's own name to the one the SCU used for calling.
virtual OFCondition | loadAssociationCfgFile (const OFString &assocFile)
| Loads association configuration file.
virtual OFCondition | setAndCheckAssociationProfile (const OFString &profileName)
| If an association profile should be selected, either by loading an association configuration file or using the addPresentationContext() function, one of those can be selected and checked for validity using this method.
void | forceAssociationRefuse (const OFBool doRefuse)
| Force every association request to be refused by SCP, no matter what the SCU is offering.
void | setMaxReceivePDULength (const Uint32 maxRecPDU)
| Set maximum PDU size the SCP is able to receive.
void | setConnectionBlockingMode (const DUL_BLOCKOPTIONS blockingMode)
| Set whether waiting for a TCP/IP connection should be blocking or non-blocking.
void | setDIMSEBlockingMode (const T_DIMSE_BlockingMode blockingMode)
| Set whether DIMSE messaging should be blocking or non-blocking.
void | setDIMSETimeout (const Uint32 dimseTimeout)
| Set the timeout to be waited for incoming DIMSE message packets.
void | setACSETimeout (const Uint32 acseTimeout)
| Set the timeout used during ACSE messaging protocol.
void | setConnectionTimeout (const Uint32 timeout)
| Set the timeout that should be waited for connection requests.
void | setVerbosePCMode (const OFBool mode)
| Set whether to show presentation contexts in verbose or debug mode.
void | setHostLookupEnabled (const OFBool mode)
| Enables or disables looking up the host name from a connecting system.
void | setProgressNotificationMode (const OFBool mode)
| Set the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively.
void | setAlwaysAcceptDefaultRole (const OFBool enabled)
| Option to always accept a default role as association acceptor.
Uint16 | getPort () const
| Returns TCP/IP port number SCP listens for new connection requests.
const OFString & | getAETitle () const
| Returns SCP's own AE title.
OFBool | getRespondWithCalledAETitle () const
| Returns whether SCP uses the called AE title from SCU requests to respond to connection requests instead of a configured AE title.
OFBool | getRefuseAssociation () const
| Returns whether SCP should refuse any association request no matter what the SCU proposes.
Uint32 | getMaxReceivePDULength () const
| Returns maximum PDU length configured to be received by SCP.
DUL_BLOCKOPTIONS | getConnectionBlockingMode () const
| Returns whether receiving of TCP/IP connection requests is done in blocking or unblocking mode.
T_DIMSE_BlockingMode | getDIMSEBlockingMode () const
| Returns whether receiving of DIMSE messages is done in blocking or unblocking mode.
Uint32 | getDIMSETimeout () const
| Returns DIMSE timeout (only applicable in blocking mode)
Uint32 | getACSETimeout () const
| Returns ACSE timeout.
Uint32 | getConnectionTimeout () const
| Returns connection timeout.
OFBool | getVerbosePCMode () const
| Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.
OFBool | getHostLookupEnabled () const
| Returns whether a connecting system's host name is looked up.
OFBool | getProgressNotificationMode () const
| Returns the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively.
virtual DcmSCPConfig & | getConfig ()
| Get access to the configuration of the SCP.
virtual OFCondition | setConfig (const DcmSCPConfig &config)
| Set the DcmSCPConfig object to use for configuring this DcmSCP object.
OFBool | isConnected () const
| Returns whether SCP is currently connected.
Uint16 | numAssociations () const
| Returns number of associations currently running.
OFString | getCalledAETitle () const
| Returns AE title the SCU used as called AE title in association request.
OFString | getPeerAETitle () const
| Returns AE title (calling AE title) the SCU used for association request.
OFString | getPeerIP () const
| Returns IP address of connected SCU.
Uint32 | getPeerMaxPDULength () const
| Returns maximum PDU size the communication peer (i.e. the SCU) is able to receive.

## Protected Member Functions
virtual OFCondition | handleIncomingCommand (T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presInfo)
| handler that is called for each incoming command message.
virtual Uint16 | checkAndProcessSTORERequest (const T_DIMSE_C_StoreRQ &reqMessage, DcmFileFormat &fileformat)
| check the given C-STORE request and dataset for validity.
virtual OFCondition | generateSTORERequestFilename (const T_DIMSE_C_StoreRQ &reqMessage, OFString &filename)
| generate a directory and file name for a DICOM dataset that will be received.
virtual void | notifyInstanceStored (const OFString &filename, const OFString &sopClassUID, const OFString &sopInstanceUID, DcmDataset *dataset=NULL) const
| notification handler that is called for each DICOM object that has been received with a C-STORE request and stored as a DICOM file
virtual OFCondition | generateDirAndFilename (OFString &filename, OFString &directoryName, OFString &sopClassUID, OFString &sopInstanceUID, DcmDataset *dataset=NULL)
| generate a directory and file name for a DICOM dataset that has been received.
Protected Member Functions inherited from DcmSCP
void | findPresentationContext (const T_ASC_PresentationContextID presID, OFString &abstractSyntax, OFString &transferSyntax)
| This call returns the presentation context belonging to the given presentation context ID.
virtual OFCondition | abortAssociation ()
| Aborts the current association by sending an A-ABORT request to the SCU.
virtual void | notifyAssociationRequest (const T_ASC_Parameters &params, DcmSCPActionType &desiredAction)
| Overwrite this function to be notified about an incoming association request.
virtual OFBool | checkCalledAETitleAccepted (const OFString &calledAE)
| Overwrite this function if called AE title should undergo custom checking.
virtual OFBool | checkCallingAETitleAccepted (const OFString &callingAE)
| Overwrite this function if calling AE title should undergo checking.
virtual OFBool | checkCallingHostAccepted (const OFString &hostOrIP)
| Overwrite this function if calling IP / host name should undergo checking.
virtual void | notifyAssociationAcknowledge ()
| Overwrite this function to be notified about an incoming association request.
virtual void | notifyReleaseRequest ()
| Overwrite this function to be notified about an incoming association release request.
virtual void | notifyAbortRequest ()
| Overwrite this function to be notified about an incoming association abort request.
virtual void | notifyAssociationTermination ()
| Overwrite this function to be notified when an association is terminated.
virtual void | notifyConnectionTimeout ()
| Overwrite this function to be notified about a connection timeout in non-blocking mode (see setConnectionBlockingMode() and setConnectionTimeout() methods).
virtual void | notifyDIMSEError (const OFCondition &cond)
| Overwrite this function to be notified when a DIMSE error occurs.
virtual void | notifySENDProgress (const unsigned long byteCount)
| This function is called while sending DIMSE messages, i.e. on each PDV of a dataset.
virtual void | notifyRECEIVEProgress (const unsigned long byteCount)
| This function is called while receiving DIMSE messages, i.e. on each PDV of a dataset.
virtual OFBool | stopAfterCurrentAssociation ()
| This method can be used to return from the listen() loop in a controlled way.
virtual OFBool | stopAfterConnectionTimeout ()
| This method can be used to return from the listen() loop in a controlled way.
virtual OFCondition | handleECHORequest (T_DIMSE_C_EchoRQ &reqMessage, const T_ASC_PresentationContextID presID)
| Standard handler for Verification Service Class (DICOM Echo).
virtual OFCondition | handleSTORERequest (T_DIMSE_C_StoreRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset)
| Receive C-STORE request on the currently opened association, store the accompanying dataset in memory and send a corresponding response.
virtual OFCondition | receiveSTORERequest (T_DIMSE_C_StoreRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset)
| Receive C-STORE request (and store accompanying dataset in memory).
virtual OFCondition | receiveSTORERequest (T_DIMSE_C_StoreRQ &reqMessage, const T_ASC_PresentationContextID presID, const OFString &filename)
| Receive C-STORE request (and store accompanying dataset directly to file).
virtual OFCondition | sendSTOREResponse (const T_ASC_PresentationContextID presID, const T_DIMSE_C_StoreRQ &reqMessage, const Uint16 rspStatusCode)
| Respond to the C-STORE request (with details from the request message)
virtual OFCondition | sendSTOREResponse (const T_ASC_PresentationContextID presID, const Uint16 messageID, const OFString &sopClassUID, const OFString &sopInstanceUID, const Uint16 rspStatusCode, DcmDataset *statusDetail=NULL)
| Respond to the C-STORE request (with given details)
virtual Uint16 | checkSTORERequest (T_DIMSE_C_StoreRQ &reqMessage, DcmDataset *reqDataset)
| Check given C-STORE request and dataset for validity.
virtual OFCondition | receiveFINDRequest (T_DIMSE_C_FindRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset)
| Receive C-FIND request.
virtual OFCondition | handleFINDRequest (T_DIMSE_C_FindRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset)
| Handle C-FIND request.
virtual OFCondition | sendFINDResponse (const T_ASC_PresentationContextID presID, const Uint16 messageID, const OFString &sopClassUID, DcmDataset *rspDataset, const Uint16 rspStatusCode, DcmDataset *statusDetail=NULL)
| Respond to the C-FIND request.
virtual OFCondition | checkForCANCEL (T_ASC_PresentationContextID presID, const Uint16 messageID)
| Check for C-CANCEL.
virtual OFCondition | receiveMOVERequest (T_DIMSE_C_MoveRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, OFString &moveDest)
| Receive C-MOVE request on the currently active association.
virtual OFCondition | handleMOVERequest (T_DIMSE_C_MoveRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, OFString &moveDest)
| Receive C-MOVE request on the currently active association.
virtual OFCondition | sendMOVEResponse (const T_ASC_PresentationContextID presID, const Uint16 messageID, const OFString &sopClassUID, DcmDataset *rspDataset, const Uint16 rspStatusCode, DcmDataset *statusDetail=NULL, const Uint16 numRemain=0, const Uint16 numComplete=0, const Uint16 numFail=0, const Uint16 numWarn=0)
| Respond to the C-MOVE request.
virtual OFCondition | receiveACTIONRequest (T_DIMSE_N_ActionRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, Uint16 &actionTypeID)
| Receive N-ACTION request on the currently opened association.
virtual OFCondition | handleACTIONRequest (T_DIMSE_N_ActionRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, Uint16 &actionTypeID)
| Receive N-ACTION request on the currently opened association.
virtual OFCondition | sendACTIONResponse (const T_ASC_PresentationContextID presID, const Uint16 messageID, const OFString &sopClassUID, const OFString &sopInstanceUID, const Uint16 rspStatusCode)
| Respond to the N-ACTION request.
virtual OFCondition | handleEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, Uint16 &eventTypeID)
| Receive N-EVENT-REPORT request on the currently opened association and send a corresponding response.
virtual OFCondition | sendEVENTREPORTRequest (const T_ASC_PresentationContextID presID, const OFString &sopInstanceUID, const Uint16 messageID, const Uint16 eventTypeID, DcmDataset *reqDataset, Uint16 &rspStatusCode)
| Send N-EVENT-REPORT request on the current association and receive a corresponding response.
virtual Uint16 | checkEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &reqMessage, DcmDataset *reqDataset)
| Check given N-EVENT-REPORT request and dataset for validity.
virtual OFCondition | waitForAssociationRQ (T_ASC_Network *network)
| This function takes care of receiving, negotiating and accepting/refusing an association request.
virtual OFCondition | processAssociationRQ ()
| Actually process association request.
virtual OFCondition | negotiateAssociation ()
| This function checks all presentation contexts proposed by the SCU whether they are supported or not.
virtual void | refuseAssociation (const DcmRefuseReasonType reason)
| This function takes care of refusing an association request.
virtual void | handleAssociation ()
| This function takes care of handling the other DICOM application's request.
OFCondition | sendDIMSEMessage (const T_ASC_PresentationContextID presID, T_DIMSE_Message *message, DcmDataset *dataObject, DcmDataset *statusDetail=NULL, DcmDataset **commandSet=NULL)
| Send a DIMSE command and possibly also a dataset from a data object via network to another DICOM application.
OFCondition | receiveDIMSECommand (T_ASC_PresentationContextID *presID, T_DIMSE_Message *message, DcmDataset **statusDetail, DcmDataset **commandSet=NULL, const Uint32 timeout=0)
| Receive DIMSE command (excluding dataset!) over the currently open association.
OFCondition | receiveDIMSEDataset (T_ASC_PresentationContextID *presID, DcmDataset **dataObject)
| Receive one dataset (of instance data) via network from another DICOM application.
OFCondition | receiveSTORERequestDataset (T_ASC_PresentationContextID *presID, T_DIMSE_C_StoreRQ &reqMessage, const OFString &filename)
| Receive one C-STORE request dataset via network from another DICOM application and store it directly to file (i.e. exactly as received without any conversions)

## Static Protected Attributes
static const char * | DEF_StandardSubdirectory
| default value for the name of the subdirectory that might be used for the "normal" case
static const char * | DEF_UndefinedSubdirectory
| default value for the name of the subdirectory that might be used for the "exceptional" case
static const char * | DEF_FilenameExtension
| default value for the filename extension appended to the generated filenames

## Private Attributes
OFString | OutputDirectory
| name of the output directory that is used to store the received datasets
OFString | StandardSubdirectory
| name of the subdirectory that might be used for the "normal" case, i.e. if the name of the subdirectory could be generated according to the current mode
OFString | UndefinedSubdirectory
| name of the subdirectory that might be used for the "exceptional" case, i.e. if the name of the subdirectory could not be generated according to the current mode
OFString | FilenameExtension
| filename extension appended to the generated filenames
E_DirectoryGenerationMode | DirectoryGeneration
| mode that is used to generate subdirectories to store the received datasets
E_FilenameGenerationMode | FilenameGeneration
| mode that is used to generate filenames for the received datasets
OFFilenameCreator | FilenameCreator
| unique pseudo-random filename creator, which also checks for existing files
E_DatasetStorageMode | DatasetStorage
| mode specifying how to store the received datasets (also allows for skipping the storage)

## Additional Inherited Members
Static Protected Member Functions inherited from DcmSCP
static DUL_PRESENTATIONCONTEXT * | findPresentationContextID (LST_HEAD *head, T_ASC_PresentationContextID presentationContextID)
| Helper function to return presentation context information by given presentation context ID.
static OFBool | getPresentationContextInfo (const T_ASC_Association *assoc, const Uint8 presID, DcmPresentationContextInfo &presInfo)
| Helper function to return presentation context information by given presentation context ID.
static OFBool | addStatusDetail (DcmDataset **statusDetail, const DcmElement *elem)
| Add given element to existing status detail object or create new one.
static void | callbackSENDProgress (void *callbackContext, unsigned long byteCount)
| Callback function used for sending DIMSE messages.
static void | callbackRECEIVEProgress (void *callbackContext, unsigned long byteCount)
| Callback function used for receiving DIMSE messages.

## Detailed Description

Interface class for a Storage Service Class Provider (SCP).

This class supports C-STORE and C-ECHO messages as an SCP. The received datasets are always stored as DICOM files with the same Transfer Syntax as used for the network transmission. Both the generation of the directory structure and the filenames can be configured by the user.

Note
  The current implementation always requires to load a so-called association negotiation profile from a configuration file, which specifies the list of Presentation Contexts (i.e. combination of SOP Class and Transfer Syntaxes) to be supported by this Storage SCP. If no association negotiation profile is loaded, the SCP will only support the Verification SOP Class (with Default Transfer Syntax, i.e. C-ECHO with Implicit VR Little Endian), which is required for all DICOM Service Class Providers.

## Member Enumeration Documentation

## ◆ E_DatasetStorageMode

enum DcmStorageSCP::E_DatasetStorageMode

modes specifying whether and how to store the received datasets

Enumerator
DGM_StoreToFile | receive dataset in memory, perform some conversions and store it to file
DGM_StoreBitPreserving | receive dataset directly to file, i.e. write data exactly as received
DSM_Ignore | receive dataset in memory, but do not store it to file
DSM_Default | default value

## ◆ E_DirectoryGenerationMode

enum DcmStorageSCP::E_DirectoryGenerationMode

modes for generating subdirectories

Enumerator
DGM_NoSubdirectory | do not generate any subdirectories
DGM_SeriesDate | generated subdirectories based on the Series Date (0008,0021)
DGM_Default | default value

## ◆ E_FilenameGenerationMode

enum DcmStorageSCP::E_FilenameGenerationMode

modes for generating filenames

Enumerator
FGM_SOPInstanceUID | generate filename from SOP Instance UID (0008,0018)
FGM_UniqueFromNewUID | generate unique filename based on new UID
FGM_ShortUniquePseudoRandom | generate short pseudo-random unique filename
FGM_CurrentSystemTime | generate filename from current system time
FGM_Default | default value

## Member Function Documentation

## ◆ checkAndProcessSTORERequest()

virtual Uint16 DcmStorageSCP::checkAndProcessSTORERequest | ( | const T_DIMSE_C_StoreRQ & | reqMessage,
|  | DcmFileFormat & | fileformat )
| protectedvirtual

check the given C-STORE request and dataset for validity.

This method is called by handleIncomingCommand() before sending the response in order to determine the DIMSE status code to be used for the response message. If this check has been passed successfully, the received dataset is stored as a DICOM file.

Parameters

  reqMessage | C-STORE request message data structure to be checked and processed
  fileformat | DICOM fileformat structure containing the C-STORE request dataset to be checked and processed

Returns
  DIMSE status code to be used for the C-STORE response

## ◆ generateDirAndFilename()

virtual OFCondition DcmStorageSCP::generateDirAndFilename | ( | OFString & | filename,
|  | OFString & | directoryName,
|  | OFString & | sopClassUID,
|  | OFString & | sopInstanceUID,
|  | DcmDataset * | dataset = NULL )
| protectedvirtual

generate a directory and file name for a DICOM dataset that has been received.

The naming scheme can be specified by the methods setDirectoryGenerationMode(), setFilenameGenerationMode() and setFilenameExtension(). Please note that this method only generates the names but neither creates the directory structure nor the DICOM file.

Parameters

  filename | reference to variable that will store the resulting filename
  directoryName | reference to variable that will store the resulting directory name (including the main output directory)
  sopClassUID | SOP Class UID of the DICOM object. This is both an input and output parameter. If an empty value is passed to this method, the value of the data element SOP Class UID (0008,0016) is determined from the DICOM dataset.
  sopInstanceUID | SOP Instance UID of the DICOM object. This is both an input and output parameter. If an empty value is passed to this method, the value of the data element SOP Instance UID (0008,0018) is determined from the dataset.
  dataset | pointer to dataset for which the directory and file name is to be generated (optional)

Returns
  status, EC_Normal if successful, an error code otherwise

## ◆ generateSTORERequestFilename()

virtual OFCondition DcmStorageSCP::generateSTORERequestFilename | ( | const T_DIMSE_C_StoreRQ & | reqMessage,
|  | OFString & | filename )
| protectedvirtual

generate a directory and file name for a DICOM dataset that will be received.

The naming scheme can be specified by the methods setDirectoryGenerationMode(), setFilenameGenerationMode() and setFilenameExtension(). Please note that this method also creates the directory structure (if needed).

Parameters

  reqMessage | C-STORE request message data structure used to generate the filename (depending on the specified options)
  filename | reference to variable that will store the resulting filename

Returns
  status, EC_Normal if successful, an error code otherwise

## ◆ getDatasetStorageMode()

E_DatasetStorageMode DcmStorageSCP::getDatasetStorageMode | ( |  | ) | const

get the mode specifying whether and how to store the received datasets

Returns
  current mode specifying whether and how to store the received datasets (see DcmStorageSCP::E_DatasetStorageMode)

## ◆ getDirectoryGenerationMode()

E_DirectoryGenerationMode DcmStorageSCP::getDirectoryGenerationMode | ( |  | ) | const

get the mode for generating subdirectories used to store the received datasets

Returns
  current mode for generating subdirectories (see DcmStorageSCP::E_DirectoryGenerationMode)

## ◆ getFilenameExtension()

const OFString & DcmStorageSCP::getFilenameExtension | ( |  | ) | const

get the filename extension that is appended to the generated filenames

Returns
  current filename extension that is appended to the generated filenames

## ◆ getFilenameGenerationMode()

E_FilenameGenerationMode DcmStorageSCP::getFilenameGenerationMode | ( |  | ) | const

get the mode for generating filenames for the received datasets

Returns
  current mode for generating filenames (see DcmStorageSCP::E_FilenameGenerationMode)

## ◆ getOutputDirectory()

const OFString & DcmStorageSCP::getOutputDirectory | ( |  | ) | const

get the output directory to be used for the storage of the received DICOM datasets.

Depending on the current mode for generating subdirectories (see getDirectoryGenerationMode()), further substructures are created automatically.

Returns
  name of the output directory that is used for storing the received DICOM datasets

## ◆ handleIncomingCommand()

virtual OFCondition DcmStorageSCP::handleIncomingCommand | ( | T_DIMSE_Message * | incomingMsg,
|  | const DcmPresentationContextInfo & | presInfo )
| protectedvirtual

handler that is called for each incoming command message.

This handler supports C-ECHO and C-STORE requests. All other messages will be reported as an error. After a valid C-STORE request has been received, the request and associated dataset will be checked and further processed by checkAndProcessSTORERequest().

Parameters

  incomingMsg | pointer to data structure containing the DIMSE message
  presInfo | additional information on the Presentation Context used

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmSCP.

## ◆ loadAssociationConfiguration()

OFCondition DcmStorageSCP::loadAssociationConfiguration | ( | const OFString & | filename,
|  | const OFString & | profile )

load an association negotiation profile from a configuration file.

This profile specifies which Presentation Contexts (i.e. combination of SOP Class and Transfer Syntaxes) are supported by this Storage SCP. If no association negotiation profile is loaded, the SCP will only support the Verification SOP Class (with Default Transfer Syntax, i.e. C-ECHO with Implicit VR Little Endian), which is required for all DICOM Service Class Providers. The format and semantics of this configuration file are described in asconfig.txt file.

Parameters

  filename | filename of the configuration file to be loaded
  profile | name of the profile specified in the configuration file to be used

Returns
  status, EC_Normal if successful, an error code otherwise

## ◆ notifyInstanceStored()

virtual void DcmStorageSCP::notifyInstanceStored | ( | const OFString & | filename,
|  | const OFString & | sopClassUID,
|  | const OFString & | sopInstanceUID,
|  | DcmDataset * | dataset = NULL ) const
| protectedvirtual

notification handler that is called for each DICOM object that has been received with a C-STORE request and stored as a DICOM file

Parameters

  filename | filename (with full path) of the object stored
  sopClassUID | SOP Class UID of the object stored
  sopInstanceUID | SOP Instance UID of the object stored
  dataset | pointer to dataset of the object stored (or NULL if the dataset has been stored directly to file). Please note that this dataset will be deleted by the calling method, so do not store any references to it!

## ◆ setDatasetStorageMode()

void DcmStorageSCP::setDatasetStorageMode | ( | const E_DatasetStorageMode | mode | ) |

set the mode specifying how to store the received datasets.

This mode also allows for specifying whether to store the received datasets at all. The default value is specified by DcmStorageSCP::DSM_Default.

Parameters

  mode | mode to be set specifying whether and how to store the received datasets (see DcmStorageSCP::E_DatasetStorageMode)

## ◆ setDirectoryGenerationMode()

void DcmStorageSCP::setDirectoryGenerationMode | ( | const E_DirectoryGenerationMode | mode | ) |

set the mode for generating subdirectories used to store the received datasets.

These subdirectories are created below the specified output directory. The default value is specified by DcmStorageSCP::DGM_Default.

Parameters

  mode | mode to be set for generating subdirectories (see DcmStorageSCP::E_DirectoryGenerationMode)

## ◆ setFilenameExtension()

void DcmStorageSCP::setFilenameExtension | ( | const OFString & | extension | ) |

specify the filename extension to be appended to the generated filenames.

The default value is specified by DcmStorageSCP::DEF_FilenameExtension (empty string). A typical non-empty value would be ".dcm" (i.e. that "." has to be specified explicitly).

Parameters

  extension | filename extension appended to the generated filenames

## ◆ setFilenameGenerationMode()

void DcmStorageSCP::setFilenameGenerationMode | ( | const E_FilenameGenerationMode | mode | ) |

set the mode for generating filenames for the received datasets.

The default value is specified by DcmStorageSCP::FGM_Default.

Parameters

  mode | mode to be set for generating filenames (see DcmStorageSCP::E_FilenameGenerationMode)

## ◆ setOutputDirectory()

OFCondition DcmStorageSCP::setOutputDirectory | ( | const OFString & | directory | ) |

specify the output directory to be used for the storage of the received DICOM datasets.

Depending on the current mode for generating subdirectories (see getDirectoryGenerationMode()), further substructures are created automatically. Before setting the new directory name, it is checked whether the specified directory exists and is writable. By default, the current directory is used.

Parameters

  directory | name of the output directory to be used

Returns
  status, EC_Normal if successful, an error code otherwise

The documentation for this class was generated from the following file:

- dcmnet/include/dcmtk/dcmnet/dstorscp.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2