{"action":"created","issue":{"url":"https://api.github.com/repos/pydicom/pynetdicom3/issues/203","repository_url":"https://api.github.com/repos/pydicom/pynetdicom3","labels_url":"https://api.github.com/repos/pydicom/pynetdicom3/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/pydicom/pynetdicom3/issues/203/comments","events_url":"https://api.github.com/repos/pydicom/pynetdicom3/issues/203/events","html_url":"https://github.com/pydicom/pynetdicom3/issues/203","id":355803716,"node_id":"MDU6SXNzdWUzNTU4MDM3MTY=","number":203,"title":"Storescu throws JPEG error when sending DICOM to storescp.py","user":{"login":"ankitgoyal100","id":3400675,"node_id":"MDQ6VXNlcjM0MDA2NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/3400675?v=4","gravatar_id":"","url":"https://api.github.com/users/ankitgoyal100","html_url":"https://github.com/ankitgoyal100","followers_url":"https://api.github.com/users/ankitgoyal100/followers","following_url":"https://api.github.com/users/ankitgoyal100/following{/other_user}","gists_url":"https://api.github.com/users/ankitgoyal100/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitgoyal100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitgoyal100/subscriptions","organizations_url":"https://api.github.com/users/ankitgoyal100/orgs","repos_url":"https://api.github.com/users/ankitgoyal100/repos","events_url":"https://api.github.com/users/ankitgoyal100/events{/privacy}","received_events_url":"https://api.github.com/users/ankitgoyal100/received_events","type":"User","site_admin":false},"labels":[{"id":451175126,"node_id":"MDU6TGFiZWw0NTExNzUxMjY=","url":"https://api.github.com/repos/pydicom/pynetdicom3/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-08-31T00:58:43Z","updated_at":"2018-09-01T00:35:04Z","closed_at":"2018-08-31T03:53:40Z","author_association":"NONE","body":"### Description\r\n`storescu` throws the following error:\r\n```\r\nW: DIMSE Warning: (STORESCU,ANY-SCP): sendMessage: unable to convert dataset from 'JPEG Lossless, Non-hierarchical, 1st Order Prediction' transfer syntax to 'Little Endian Implicit'\r\nE: Store Failed, file: 063.dcm:\r\nE: 0006:020e DIMSE Failed to send message\r\nE: Store SCU Failed: 0006:020e DIMSE Failed to send message\r\n```\r\nwhen I send a DICOM image to `storescp.py` here: https://github.com/pydicom/pynetdicom3/blob/master/pynetdicom3/apps/storescp/storescp.py\r\n\r\n### Expected behaviour\r\nThe DICOM image is received & processed properly\r\n\r\n### Actual behaviour\r\nThis error is thrown:\r\n```\r\nW: DIMSE Warning: (STORESCU,ANY-SCP): sendMessage: unable to convert dataset from 'JPEG Lossless, Non-hierarchical, 1st Order Prediction' transfer syntax to 'Little Endian Implicit'\r\nE: Store Failed, file: 063.dcm:\r\nE: 0006:020e DIMSE Failed to send message\r\nE: Store SCU Failed: 0006:020e DIMSE Failed to send message\r\n```\r\n\r\n### Steps to reproduce\r\n`storescu -xs localhost 11112 063.dcm`\r\n\r\n### Your environment\r\nPlease run the following and paste the output.\r\n```bash\r\n$ python -c \"import platform; print(platform.platform())\": Darwin-17.7.0-x86_64-i386-64bit\r\n$ python -c \"import sys; print('Python', sys.version)\": ('Python', '2.7.15 (default, Aug 22 2018, 16:36:18) \\n[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]')\r\n$ python -c \"import pydicom; print('pydicom', pydicom.__version__)\": ('pydicom', '1.1.0')\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pydicom/pynetdicom3/issues/comments/417819885","html_url":"https://github.com/pydicom/pynetdicom3/issues/203#issuecomment-417819885","issue_url":"https://api.github.com/repos/pydicom/pynetdicom3/issues/203","id":417819885,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzgxOTg4NQ==","user":{"login":"ankitgoyal100","id":3400675,"node_id":"MDQ6VXNlcjM0MDA2NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/3400675?v=4","gravatar_id":"","url":"https://api.github.com/users/ankitgoyal100","html_url":"https://github.com/ankitgoyal100","followers_url":"https://api.github.com/users/ankitgoyal100/followers","following_url":"https://api.github.com/users/ankitgoyal100/following{/other_user}","gists_url":"https://api.github.com/users/ankitgoyal100/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitgoyal100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitgoyal100/subscriptions","organizations_url":"https://api.github.com/users/ankitgoyal100/orgs","repos_url":"https://api.github.com/users/ankitgoyal100/repos","events_url":"https://api.github.com/users/ankitgoyal100/events{/privacy}","received_events_url":"https://api.github.com/users/ankitgoyal100/received_events","type":"User","site_admin":false},"created_at":"2018-09-01T00:35:04Z","updated_at":"2018-09-01T00:35:04Z","author_association":"NONE","body":"I was able to get it working, here is the relevant portion of code:\r\n```\r\nae = AE(ae_title='STORESCP', port=PORT)\r\nae.bind_addr = ''\r\nae.acse_timeout = 60\r\nae.maximum_pdu_size = 131072\r\n\r\ntransfer_syntaxes = DEFAULT_TRANSFER_SYNTAXES + [JPEGLossless]\r\nfor context in StoragePresentationContexts:\r\n    ae.add_supported_context(context.abstract_syntax, transfer_syntaxes)\r\n\r\nae.on_c_store = on_c_store\r\nae.start()\r\n```\r\nand\r\n```\r\ndef on_c_store(dataset, context, info):\r\n        meta = Dataset()\r\n        meta.MediaStorageSOPClassUID = dataset.SOPClassUID\r\n        meta.MediaStorageSOPInstanceUID = dataset.SOPInstanceUID\r\n        meta.ImplementationClassUID = PYNETDICOM_IMPLEMENTATION_UID\r\n        meta.TransferSyntaxUID = context.transfer_syntax\r\n        # The following is not mandatory, set for convenience\r\n        meta.ImplementationVersionName = PYNETDICOM_IMPLEMENTATION_VERSION\r\n\r\n        dataset.file_meta = meta\r\n        dataset.is_little_endian = context.transfer_syntax.is_little_endian\r\n        dataset.is_implicit_VR = context.transfer_syntax.is_implicit_VR\r\n\r\n        filename = '{0!s}-{1!s}-{2!s}'.format(dataset.SOPInstanceUID, dataset.SeriesInstanceUID, dataset.InstanceNumber) + '.dcm'\r\n        dataset.save_as(filename, write_like_original=False)\r\n```\r\n\r\nHowever, when transmitting some of my other DICOM images (from a different vendor), I get this error: \r\n```\r\nW: DIMSE Warning: (STORESCU,ANY-SCP): sendMessage: unable to convert dataset from 'JPEG 2000 (Lossless only)' transfer syntax to 'Little Endian Implicit'\r\nE: Store Failed, file: 1.2.826.0.1.3680043.214.5414878731899477765335911018955383438-21.dcm:\r\nE: 0006:020e DIMSE Failed to send message\r\nE: Store SCU Failed: 0006:020e DIMSE Failed to send message\r\n```\r\nIs there a way to add support for both types of DICOM images from both vendors?"}}
{"actor":{"display_login":"ankitgoyal100"}}