fo-dicom / fo-dicom-samples

Sample applications associated with the fo-dicom framework
Other
153 stars 143 forks source link

DicomCGetResponse #87

Closed andrelncampos closed 1 year ago

andrelncampos commented 1 year ago

I created a DICOM Server with C-STORE (Ok), C-FIND (Ok), but I'm struggling with C-GET. I had just got de DICOM File and its dataset. But what do I need to return? I've tried that:

DicomFile myDicomFile= await DicomFile.OpenAsync(pathFile); DicomDataset ds = myDicomFile.Dataset; yield return new DicomCGetResponse(request, DicomStatus.Success) { Dataset=ds };

But just don't work. Someone could put me on the direction.

gofal commented 1 year ago

The DicomCGetResponse should be the final response to close the whole C-Get association.

the client opens the association with the C-get Request. This connection will stay open until the final CGetresponse is returned. Meanwhile the Server and the Client switch roles. the Server creates CStoreRequests for each file and sends them through this open network connection.

See here for a sample method: https://github.com/fo-dicom/fo-dicom-samples/blob/7fdb0cff22923200e4b62344e5ed9d2af9b7ef45/Desktop/QueryRetrieve%20SCP/QRService.cs#L304