The IDLffDicomExStorScu::Send function method transfers DICOM files to a remote Storage SCP node.
- The send is complete (all files have been transferred)
- The send encounters an error condition
- The callback function defined by the CALLBACK_FUNCTION property returns zero
Properties Required For a Send
The STORAGE_SCP property must contain the name of a valid Application Entity that supports the Storage SCP service in order for the Send method to succeed. All to other properties used by the Send method have usable default values.
Callbacks and Send Status Information
If the CALLBACK_FUNCTION property contains the name of an IDL function, that function is called each time a DICOM file is sent to the remote node. The function is called with an array of strings containing status information about the send operation as its first parameter. See Using Callbacks With the IDLffDicomExStorScu Object for a discussion of callback functions.
Canceling a Send
To cancel a send operation before all files are transferred, the callback function specified by the CALLBACK_FUNCTION property must return zero.
Syntax
Result = Obj->[IDLffDicomExStorScu::]Send(Files)
Return Value
This method returns the number of DICOM files that were successfully sent.
Arguments
Files
A scalar string or string array containing the fully qualified paths of the DICOM files to be transferred to the remote Storage SCP node.
Keywords
None
Example
The following example code shows how to programmatically configure a local Storage SCP, create a local Storage SCU Application Entity, and transfer files to the Storage SCP.
To run the example, do the following:
- Copy the example code and paste it into an IDL editor window or another text editor of your choice.
- Save the file as stor_scu_send_files.pro.
- Execute stor_scu_send_files.pro in IDL.
PRO stor_scu_send_files
ocfg = OBJ_NEW('IDLffDicomExCfg')
ocfg->SetApplicationEntity, 'my_stor_scp_aen', $
'my_stor_scp', 'localhost', 2510, $
'Storage_SCP_Service_List', 'Storage_SCP'
ocfg->SetValue, 'StorScpServiceAE', 'my_stor_scp_aen'
ocfg->Commit
OBJ_DESTROY, ocfg
ocfg = OBJ_NEW('IDLffDicomExCfg', /SYSTEM)
ocfg->SetApplicationEntity, 'my_stor_scp_aen', $
'my_stor_scp', 'localhost', 2510, $ 'Storage_SCP_Service_List', 'Storage_SCP'
ocfg->SetValue, 'StorScpServiceAE', 'my_stor_scp_aen'
tmpDir = FILEPATH('', /TMP)
ocfg->SetValue, 'StorScpDir', tmpDir
PRINT, 'stor scp dir = ', tmpDir
ocfg->Commit
status = ocfg->StorageScpService('stop')
PRINT, 'Stopping Storage SCP. Status: ', status
WAIT, 5
status = ocfg->StorageScpService('start')
PRINT, 'Starting Storage SCP. Status: ', status
WAIT, 5
OBJ_DESTROY, ocfg
srcfn1 = FILEPATH('mr_brain.dcm',SUBDIR=['examples', 'data'])
oss = OBJ_NEW('IDLffDicomExStorScu')
oss->SetProperty, STORAGE_SCP = 'my_stor_scp_aen'
cnt = oss->Send(srcfn1)
PRINT, 'Number of files transferred: ', cnt
OBJ_DESTROY, oss
END
Version History