The problem i have is that on the client side (SCU) when i try to send image it gaves me the 'Bad Presentation Context ID' error again.
I'm using the same Transfer Syntax in both
DcmSCP is suited for receiving images like a PACS does (however, per default it does not store the images, you must overwrite something like handleIncomingCStoreMessage()).
for every presentation context you add the list of 5 transfer syntaxes. Please note that for a association request from the SCU, the server must choose one of those and it chooses to accept the first one that matches in the proposed transfer syntax list, which is Little Endian Implicit. (this is what I guess from what I know).
"sendMessage" sounds like this is the SCU log, right? So the SCU chooses to send on the Little Endian Implicit presentation context (which is probably the one accepted by the SCP, see above), but is not able to decompress it accordingly from JPEG2000 (which is a commercial add-on for DCMTK).
So you should force the SCU only(!) proposing JPEG2000 of your CT Image Storage presentation contexts (at the moment, your only one). Then the server would have no chance but to accept that transfer syntax and thus the client would not need to do the de-compression.
P.S: Please note that there is no code that performs actual work when you try to do query/retrieve with the server, i.e. that has to be programmed yourself. Or have a look at the dcmqrscp tool that implements a little PACS (though it is based on the old C API and does not make use of DcmSCP).
that sounds very weird. Are you sure that you do not use a send routine that tries implicitly (or even explicitly) to send in little endian implicit? Do you use the right JPEG2000 transfer syntax?