I debugged your issue with SendSCU.
I got an image with JPEG 2000 Lossy compression. I established a connection with my SCP with it and pushed the image.
Following is the Associate log:
Implementation Version: CharruaSoft
Maximum PDU Size: 16384
Called AE Title: remote
Calling AE Title: local
Presentation Contexts: 1
Presentation Context: 1 [Proposed]
Abstract: CT Image Storage
Transfer: Explicit VR Little Endian
Transfer: JPEG 2000 Image Compression
Transfer: Implicit VR Little Endian: Default Transfer Syntax for DICOM
Note that SendSCU is proposing just one presentation context (PC) with three transfer syntaxes in it. Now it is up to SCP which TS to accept. Good thing here is that, SCU is auto-detecting the original TS of image to be sent.
for 8 bit simple 2 MB file it generates a huge 90 MB file.
This is because your SCP is accepting first transfer syntax and send ASSOCIATE-ACCEPT
back to SendSCU. SendSCU then (as expected) decompresses the image on the fly and hence the increase in size.
I tried to send using StoreSCU from dcm4che itself and it works fine.
I am sure StoreSCU must be proposing:
- only one TS - the Lossy one OR
- multiple TS each in separate PC. SCP accepts each PC. StoreSCU uses the best one - Lossy OR
- multiple TS with Lossy TS at the top
In any of the above case, StoreSCU will not decompress the image and there will not be a size issue. May be you should get the similar log for it as did above.
CharruaSoft SendSCU is able to send to other SCPs for eg: mymedicalimages.com properly.
It is decision of SCP which TS to accept if multiple TS are proposed in one PC. As the SCP you mentioned is hosted on internet, most probably it accepts Lossy TS (to improve performance and save bandwidth) on priority and hence the resultant file size is small. You should check their Conformance statement. If you upload it here, I may help out a bit.
If I select JPEG lossy 8 bit compression from CharruaSoft sendscu, it works and doesn't create a huge 90 mb file.
Following is the Associate log in that case:
Implementation Version: CharruaSoft
Maximum PDU Size: 16384
Called AE Title: remote
Calling AE Title: local
Presentation Contexts: 1
Presentation Context: 1 [Proposed]
Abstract: CT Image Storage
Transfer: JPEG 2000 Image Compression
Transfer: Implicit VR Little Endian: Default Transfer Syntax for DICOM
Note that JPEG 2000 is the first TS proposed here. SCP accepts it and everything just works fine.
But I have no control over CharruaSoft sendSCU tool. I want java dcm4che SCP to handle that.
I never used dcm4che tool; I cannot help here. You can check dcm4che document to see how you can configure which TS to accept that is proposed in PCs. Hopefully, there is a setting/switch to handle that behavior. This is your only way to go if you want to handle this with SCP on the fly.
Other alternative is offline TS conversion with -t
switch as explained here.
-t,--transfer-syntax <uid>
transcode sources to specified Transfer Syntax. At default use Explicit VR Little Endian