Wednesday, May 22, 2013
Google Custom Search

Our Community

Membership Membership:
Latest New User Latest: LizzieW
New Today New Today: 6
New Yesterday New Yesterday: 13
User Count Overall: 28663

People Online People Online:
Visitors Visitors: 11
Members Members: 1
Total Total: 12

Online Now Online Now:
01: gemidoc

ClearCanvas Community Forums

We've moved our Developer Forums!
To better assist our open source community, we have moved our repository and developer forums to GitHub. You can access the new developer forums on our ClearCanvas GitHub issues board.

Problem with presentation contexts in StoreScp code
Last Post 2012-07-27 09:56 AM by steve. 5 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
seandoyle
Basic Member
Basic Member
Posts:18

--
2011-07-01 11:06 AM

Hi -

I know that the real bug here is that I'm misunderstanding something :-).

A DICOM SCU that is trying to send data to a CC ImageServer is failing because it the images are compressed and the SCU can't decompress the images before they are sent. The images are in 1.2.840.10008.1.2.4.57  (JPEG Lossless Process 14). Here's the error I get:

Abstract Syntax 1.2.840.10008.5.1.4.1.1.2/CT Image Storage with Transfer Syntax 1.2.840.10008.1.2.4.57/JPEG Lossless, Non-Hierarchical (Process 14) not supported.

If the images are saved to disk I can import them in Osirix or the CC workstation and successfully send to the server. If I try to load the files using storescu.exe - I get an error message similar to the one above. The manual workaround is something that I want to avoid because it's just extra work for people that are insanely busy. 

So - I decided to try to write a small StorageScp service that would read these images in and then retransmit them (decompressing if necessary) to the ImageServer.  But I haven't been able to get this to work.

If I set up the presentation contexts like this:

            pcid = assoc.AddPresentationContext(SopClass.CtImageStorage);

            assoc.AddTransferSyntax(pcid, TransferSyntax.ExplicitVrLittleEndian);

            assoc.AddTransferSyntax(pcid, TransferSyntax.ImplicitVrLittleEndian);

            assoc.AddTransferSyntax(pcid, TransferSyntax.JpegLosslessNonHierarchicalFirstOrderPredictionProcess14SelectionValue1);

            assoc.AddTransferSyntax(pcid, TransferSyntax.JpegLosslessNonHierarchicalProcess14);

 

This is the error message that I get from the following command:

$ storescu.exe -v +v -xs -aet SWDVM1 -aec TIMCROUTER +sd  +sp *.dcm emiswd0vm1.partners.org 3333 0e5a9aceeb542efac4b55a4c197a5c31e533fda6/*

 

I: Association Accepted (Max Send PDV: 116782)

I: Sending file: 0e5a9aceeb542efac4b55a4c197a5c31e533fda6/01f35449e82608b692c7885de959a0c3cf4126d3.dcm

I: Transfer Syntax: JPEGLossless:Non-hierarchical:Process14 -> LittleEndianExplicit

I: Sending Store Request: MsgID 1, (CT)

XMIT: W: DIMSE Warning: (SWDVM1,TIMCROUTER): sendMessage: unable to convert data

set from 'JPEG Lossless, Non-hierarchical, Process 14' transfer syntax to 'Littl

e Endian Explicit'

E: Store Failed, file: 0e5a9aceeb542efac4b55a4c197a5c31e533fda6/01f35449e82608b692c7885de959a0c3cf4126d3.dcm:

E: 0006:020e DIMSE Failed to send message

E: Store SCU Failed: 0006:020e DIMSE Failed to send message

I: Aborting Association

 

If I commend out all but the 

assoc.AddTransferSyntax(pcid,TransferSyntax.JpegLosslessNonHierarchicalProcess14);

 

I get the following message:

I: Association Accepted (Max Send PDV: 116782)

I: Sending file: 0e5a9aceeb542efac4b55a4c197a5c31e533fda6/01f35449e82608b692c788

5de959a0c3cf4126d3.dcm

E: No presentation context for: (CT) 1.2.840.10008.5.1.4.1.1.2

E: Store SCU Failed: 0006:0208 DIMSE No valid Presentation Context ID

I: Aborting Association

 

How can I change my code (or server config) so that these images are accepted? 

Thanks!

Sean

 

seandoyle
Basic Member
Basic Member
Posts:18

--
2011-07-07 09:30 AM
No solution yet.

One thing I've tried (since I'm on a 64 bit Windows 7 machine) was to make sure that the ClearCanvas.Dicom.Codec.Jpeg.dll was loaded. I've set Visual Studio 2008 to have 'any computer' as a target and I'm using the DLLs from the SDK redistributables. The *.Jpeg.dll is included as a reference and the service deploys with it.

But the behavior is still the same - it won't accept the compressed JPEG:
$ storescu.exe -v -xs -aet SWDVM1 -aec TIMCROUTER +sd +sp *.dcm emiswd0vm1.pa
rtners.org 3333 0e5a9aceeb542efac4b55a4c197a5c31e533fda6/*
I: determining input files ...
I: checking input files ...
I: Requesting Association
I: Association Accepted (Max Send PDV: 116782)
I: Sending file: 0e5a9aceeb542efac4b55a4c197a5c31e533fda6/01f35449e82608b692c788
5de959a0c3cf4126d3.dcm
I: Transfer Syntax: JPEGLossless:Non-hierarchical:Process14 -> LittleEndianExplicit
I: Sending Store Request: MsgID 1, (CT)
XMIT: W: DIMSE Warning: (SWDVM1,TIMCROUTER): sendMessage: unable to convert data
set from 'JPEG Lossless, Non-hierarchical, Process 14' transfer syntax to 'Little Endian Explicit'
E: Store Failed, file: 0e5a9aceeb542efac4b55a4c197a5c31e533fda6/01f35449e82608b692c7885de959a0c3cf4126d3.dcm:
E: 0006:020e DIMSE Failed to send message
E: Store SCU Failed: 0006:020e DIMSE Failed to send message
I: Aborting Association

I'm open to suggestions for what to try next :-).

Thanks!
martin
Senior Member
Senior Member
Posts:262
Avatar

--
2011-07-11 03:57 AM

In general sending JPEG compessed DICOM images to the ImageServer 2.0 SP1 using the storescu.exe from DCMTK should work fine.

Can you try to enable the DEBUG logging within the Logging.config of your ImageServer installation, restart the service and check if all plugin DLLs got loaded.


    <root>
        <level value="DEBUG" />
        <appender-ref ref="RollingLogFileAppender" />
        <appender-ref ref="ConsoleAppender" />
        <appender-ref ref="AdoNetAppender" />
    </root>

You can also enable the debug mode for the storescu (option -d) to ensure that the JPEG TransferSyntax is in the list of proposed syntaxes.

steve
Senior Member
Senior Member
Posts:2096

--
2011-07-11 01:44 PM
Sean,

The order you add the transfer syntaxes to your presentation context determines the priority the toolkit uses when negotiating the association. So, if you list/add the .57 transfer syntax first, it should select it when negotiating if its proposed. I think this should help you out.

Steve
Live and real-time support available for Personal, Team, and Cleome Edition customers.
martin
Senior Member
Senior Member
Posts:262
Avatar

--
2012-07-20 08:50 AM

One year later fate brought me into the exact same situation. I want to send JPEG Lossless, Non-Hierarchical (Process 14) compressed DICOM images directly into the ImageServer 2.0 using the DCMTK's storescu. I always assumed that this should work since the Comformance Statement says that the TransferSyntax is support.

However the storescu and ImageServer log is telling something different:

D: $dcmtk: storescu v3.6.0 2011-01-06 $
D:
I: checking input files ...
D: Request Parameters:
D: ====================== BEGIN A-ASSOCIATE-RQ =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.0
D: Our Implementation Version Name:   OFFIS_DCMTK_360
D: Their Implementation Class UID:
D: Their Implementation Version Name:
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    STORESCU
D: Called Application Name:     PAN2
D: Responding Application Name: resp. AP Title
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  0
D: Presentation Contexts:
D:   Context ID:        1 (Proposed)
D:     Abstract Syntax: =CTImageStorage
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =JPEGLossless:Non-hierarchical:Process14
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-RQ ======================
I: Requesting Association
D: Constructing Associate RQ PDU
F: Association Rejected:
F: Result: Rejected Permanent, Source: Service Provider (ACSE Related)
F: Reason: No Reason

ImageServer log:

2012-07-20 14:34:08,427 [DicomServer: 127.0.0.1 [42]] ERROR - Rejecting association from STORESCU: No valid presentation contexts.

Combining the TransferSyntax with others will explicitly reject the 1.2.840.10008.1.2.4.57 TransferSyntax

	Presentation Context 3 [Reject - Transfer Syntaxes Not Supported] Abstract: CT Image Storage
		Transfer: JPEG Lossless, Non-Hierarchical (Process 14)

So it looks to me like the 1.2.840.10008.1.2.4.57 TransferSyntax is just not supported

steve
Senior Member
Senior Member
Posts:2096

--
2012-07-27 09:56 AM
Martin,

It looks like the ImageServer Conformance Statement is just wrong. I'm not sure how this one got through, but the JPEG Lossless transfer syntax the ImageServer supports is this one:

JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1]), 1.2.840.10008.1.2.4.70

We just don't support the 1.2.840.10008.1.2.4.57 transfer syntax. Although we could support the .57 transfer syntax, we chose to only support the .70 transfer syntax because we thought it was more common.

Steve
Live and real-time support available for Personal, Team, and Cleome Edition customers.
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2013 ClearCanvas Inc. All Rights Reserved