New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Req: StoreScp example #45
Comments
Yeah, sorry, updating the user docs is on my list of things to do. If you're going to save the dataset using |
Hi, Thanks for the response. |
If you're acting as a storage SCP then its up to you to decide the encoding you want to use when storing the dataset. However, keep in mind that all Big Endian byte ordering Transfer Syntaxes were retired last year (as per the DICOM standard, PS3.5 Section 7.3). |
Hi. |
Its up to you to add the DICOM Meta Information Header if you're storing in DICOM File Format (see the DICOM Standard Part 10). For transfers the header is discarded. At the moment there's no easy way to get the transfer syntax UID after transfer, future changes will make this possible. |
The transfer syntax UID can now be accessed via the |
Can you please give an instruction about how to acquire images using DICOM server? I tried to use your storecp.py code but it did not work for me. I tried to make it simpler and it keeps the port open but not saving images and it is giving me this error: Can you please help me? |
Could you post the entire log at the debug level please? |
I managed to get storescp.py working; however, it is giving me the same error. If I do not set any "bind_addr", the error is just seen while I send images from the device and it is just one line:
The device and computer are seeing each other without any issue and I can get verification for the connection by the ultrasound device that they are connected; but no file can be transferred. But, if I insert the IP address for "bind_addr", I get the following:
I should say that I can ping the address but it not being recognized by the code and giving the upper error when having the address. |
From the log output it looks like the SCU is sending an A-ABORT after the association is accepted, so the issue is probably on the SCU side. If the SCP were aborting the log would say "Aborting Association" Can you test to see whether you can send from your ultrasound device to DCMTK's storescp app or similar? Having another look, it appears as though the SCU is requesting the Extended Negotation and Common Extended Negotation but neither appears to have any items. This may be a bug in pynetdicom3, so could you double check the output of DCMTK's storescp app for that section of the log and copy it here? Its the bit where it says:
This shouldn't cause an abort as extended negotiation is optional, but its a bit strange. |
I have tried different applications and it is working for them. But, just to make sure that I am not missing anything: I need to set the port number and aet but not the IP. Because all of the software needed the IP. Is it correct? |
storecp from dcmtk361 gives me the following similar error: |
But, ginkgocadx works well and it can transfer the files. However, I need it in python. Any suggestions? or idea to troubleshoot the issue? |
Could you create a new issue please? I'm going to post some test code for a SCP, could you run it and post the logging output in the new issue? I'm assuming that the ultrasound device you mentioned requires either one or both of Ultrasound Image Storage and Ultrasound Multiframe Image Storage, if this is incorrect please add the presentation context(s) required by the device. Do you have a conformance statement for the US device? import logging
from pydicom.dataset import Dataset
from pynetdicom3 import AE, PYNETDICOM_IMPLEMENTATION_UID
from pynetdicom3.sop_class import UltrasoundImageStorage, UltrasoundMultiframeImageStorage
LOGGER = logging.getLogger('pynetdicom3')
LOGGER.setLevel(logging.DEBUG)
ae = AE(port=11112)
ae.add_supported_context(UltrasoundImageStorage)
ae.add_supported_context(UltrasoundMultiframeImageStorage)
def on_c_store(ds, context, info):
meta = Dataset()
meta.MediaStorageSOPClassUID = ds.SOPClassUID
meta.MediaStorageSOPInstanceUID = ds.SOPInstanceUID
meta.ImplementationClassUID = PYNETDICOM_IMPLEMENTATION_UID
meta.TransferSyntaxUID = context.transfer_syntax
# Add the file meta to the dataset
ds.file_meta = meta
ds.is_little_endian = context.transfer_syntax.is_little_endian
ds.is_implicit_VR = context.transfer_syntax.is_implicit_VR
# Save the dataset using the SOP Instance UID as the filename
ds.save_as(ds.SOPInstanceUID)
# Return a 'Success' status
return 0x0000
ae.on_c_store = on_c_store
ae.start() |
Hi,
I am trying to set up a storescp to receive Dicom images.
This is what the code looks like now
So when i send a dicom image i get the following error
The storescp example on your project is empty.
Can you guide me as to what i am doing wrong here? The dicom file i am sending has the file meta tag in it.
The text was updated successfully, but these errors were encountered: