GDCM 3.2.1

Public Types | Static Public Member Functions | List of all members
gdcm::CompositeNetworkFunctions Class Reference

Composite Network Functions. More...

`#include <gdcmCompositeNetworkFunctions.h>`

## Public Types
typedef std::vector< KeyValuePairType > | KeyValuePairArrayType
typedef std::pair< Tag, std::string > | KeyValuePairType

## Static Public Member Functions
static bool | CEcho (const char *remote, uint16_t portno, const char *aetitle=nullptr, const char *call=nullptr)
static bool | CFind (const char *remote, uint16_t portno, const BaseRootQuery *query, std::vector< DataSet > &retDataSets, const char *aetitle=nullptr, const char *call=nullptr)
static bool | CMove (const char *remote, uint16_t portno, const BaseRootQuery *query, uint16_t portscp, const char *aetitle=nullptr, const char *call=nullptr, const char *outputdir=nullptr)
static BaseRootQuery * | ConstructQuery (ERootType inRootType, EQueryLevel inQueryLevel, const DataSet &queryds, EQueryType queryType=eFind)
static BaseRootQuery * | ConstructQuery (ERootType inRootType, EQueryLevel inQueryLevel, const KeyValuePairArrayType &keys, EQueryType queryType=eFind)
static bool | CStore (const char *remote, uint16_t portno, const Directory::FilenamesType &filenames, const char *aetitle=nullptr, const char *call=nullptr)

## Detailed Description

Composite Network Functions.

These functions provide a generic API to the DICOM functions implemented in GDCM. Advanced users can use this code as a template for building their own versions of these functions (for instance, to provide progress bars or some other way of handling returned query information), but for most users, these functions should be sufficient to interface with a PACS to a local machine. Note that these functions are not contained within a static class or some other class-style interface, because multiple connections can be instantiated in the same program. The DICOM standard is much more function oriented rather than class oriented in this instance, so the design of this API reflects that functional approach. These functions implements the following SCU operations:

- C-ECHO SCU
- C-FIND SCU
- C-STORE SCU
- C-MOVE SCU (+internal C-STORE SCP)

Examples
  SendFileSCU.cs.

## Member Typedef Documentation

## ◆ KeyValuePairArrayType

typedef std::vector< KeyValuePairType > gdcm::CompositeNetworkFunctions::KeyValuePairArrayType

## ◆ KeyValuePairType

typedef std::pair<Tag, std::string> gdcm::CompositeNetworkFunctions::KeyValuePairType

## Member Function Documentation

## ◆ CEcho()

bool gdcm::CompositeNetworkFunctions::CEcho | ( | const char * | remote,
|  | uint16_t | portno,
|  | const char * | aetitle = nullptr,
|  | const char * | call = nullptr )
| static

The most basic network function. Use this function to ensure that the remote server is responding on the given IP and port number as expected.

Parameters

  aetitle | when not set will default to 'GDCMSCU'
  call | when not set will default to 'ANY-SCP'

Warning
  This is an error to set remote to NULL or portno to 0

Returns
  true if it worked.

Examples
  SendFileSCU.cs.

## ◆ CFind()

bool gdcm::CompositeNetworkFunctions::CFind | ( | const char * | remote,
|  | uint16_t | portno,
|  | const BaseRootQuery * | query,
|  | std::vector< DataSet > & | retDataSets,
|  | const char * | aetitle = nullptr,
|  | const char * | call = nullptr )
| static

This function will use the provided query to determine what files a remote server contains that match the query strings. The return is a vector of datasets that contain tags as reported by the server. If the dataset is empty, then it is possible that an error condition was encountered; in which case, the user should monitor the error and warning streams.

Parameters

  aetitle | when not set will default to 'GDCMSCU'
  call | when not set will default to 'ANY-SCP'

Warning
  This is an error to set remote to NULL or portno to 0

Returns
  true if it worked.

## ◆ CMove()

bool gdcm::CompositeNetworkFunctions::CMove | ( | const char * | remote,
|  | uint16_t | portno,
|  | const BaseRootQuery * | query,
|  | uint16_t | portscp,
|  | const char * | aetitle = nullptr,
|  | const char * | call = nullptr,
|  | const char * | outputdir = nullptr )
| static

This function will use the provided query to get files from a remote server. NOTE that this functionality is essentially equivalent to C-GET in the DICOM standard; however, C-GET has been deprecated, so this function allows for the user to ask a remote server for files matching a query and return them to the local machine. Files will be written to the given output directory. If the operation succeeds, the function returns true. This function is a prime candidate for being overwritten by expert users; if the datasets should remain in memory, for instance, that behavior can be changed by creating a user-level version of this function.

Parameters

  aetitle | when not set will default to 'GDCMSCU'
  call | when not set will default to 'ANY-SCP' This is an error to set remote to NULL or portno to 0 when
  outputdir | is not set default to current dir ('.')

Returns
  true if it worked.

## ◆ ConstructQuery() [1/2]

BaseRootQuery * gdcm::CompositeNetworkFunctions::ConstructQuery | ( | ERootType | inRootType,
|  | EQueryLevel | inQueryLevel,
|  | const DataSet & | queryds,
|  | EQueryType | queryType = eFind )
| static

This function will take a list of strings and tags and fill in a query that can be used for either CFind or CMove (depending on the input boolean

Parameters

  inMove). | Note that the caller is responsible for deleting the constructed query. This function is used to build both a move and a find query (true for inMove if it's move, false if it's find)

References gdcm::eFind.

## ◆ ConstructQuery() [2/2]

BaseRootQuery * gdcm::CompositeNetworkFunctions::ConstructQuery | ( | ERootType | inRootType,
|  | EQueryLevel | inQueryLevel,
|  | const KeyValuePairArrayType & | keys,
|  | EQueryType | queryType = eFind )
| static

Deprecated

References gdcm::eFind.

## ◆ CStore()

bool gdcm::CompositeNetworkFunctions::CStore | ( | const char * | remote,
|  | uint16_t | portno,
|  | const Directory::FilenamesType & | filenames,
|  | const char * | aetitle = nullptr,
|  | const char * | call = nullptr )
| static

This function will place the provided files into the remote server. The function returns true if it worked for all files.

Warning
  the server side can refuse an association on a given file

Parameters

  aetitle | when not set will default to 'GDCMSCU'
  call | when not set will default to 'ANY-SCP'

Warning
  This is an error to set remote to NULL or portno to 0

Returns
  true if it worked for all files

Examples
  SendFileSCU.cs.

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

- gdcmCompositeNetworkFunctions.h