Wednesday, June 19, 2013
Google Custom Search

Our Community

Membership Membership:
Latest New User Latest: mehdi9935
New Today New Today: 17
New Yesterday New Yesterday: 7
User Count Overall: 28917

People Online People Online:
Visitors Visitors: 6
Members Members: 0
Total Total: 6

Online Now Online Now:

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.

JPEG2000 Lossless Support
Last Post 2012-05-08 08:31 PM by stewart. 10 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
wittdb
Basic Member
Basic Member
Posts:27

--
2012-04-26 06:29 PM

Does the DICOM toolkit support JPEG2000 Lossless?  I need to convert some JPEG2000 loseless images into another transfer syntax.  Thanks in advance!

 

chafey
Veteran Member
Veteran Member
Posts:120

--
2012-04-26 08:52 PM
Yes, but it has some bugs and wont decode all JPEG2000 bitstreams.
wittdb
Basic Member
Basic Member
Posts:27

--
2012-04-30 09:38 AM
I am looking for some example code on how to do the conversion. I can open the existing JPEG 2000 Lossless (.90) DICOM image file and eventually re-write it out as a new file. But how do I process the pixel data to convert it to Explicit Little Endian. It can't be as east as just changing the transfer syntax tag value before I write it out, can it? Thanks!!!!!
chafey
Veteran Member
Veteran Member
Posts:120

--
2012-04-30 10:36 AM
I haven't done it before, but I wouldn't be surprised if it is that simple. I know that the ImageViewerSamples project has code to convert from one transfer syntax to another - check it out
wittdb
Basic Member
Basic Member
Posts:27

--
2012-04-30 10:43 AM
I can't find a samples area under ImageViewer. Do you have a bit more specific info on where I might find it? Thanks!!!
stewart
Senior Member
Senior Member
Posts:2347

--
2012-04-30 10:50 AM
DicomFile has a ChangeTransferSyntax method - it really is that easy :)
Live and real-time support available for Personal and Team Edition customers
wittdb
Basic Member
Basic Member
Posts:27

--
2012-05-08 09:21 AM
Something else is going wring then, beacuase when I change the transfer syntax from JPG2000 (Lossless) (ends in .90) to Explicit Little Endian and then write out the Dicom image file (df.save), it becomes unreadable with error messages complaining about not being able to process the pixel data. Is there something I need to do in addition to changing the transfer syntax before I save the file? How does the pixel data get regenerated in the new transfer syntax?
wittdb
Basic Member
Basic Member
Posts:27

--
2012-05-08 10:16 AM
The error mesage displayed in the viewbox by Clear Canvas when I try and open the converted image is "Object reference not set to an instance of an object". Dicom Editor says "Pixel Data Compressed with 1 fragments". Any ideas?
chafey
Veteran Member
Veteran Member
Posts:120

--
2012-05-08 05:14 PM
Are you able to view the DICOM image in ClearCanvas? If not, either the DICOM file is corrupt or it has a JPEG2000 bitstream that the CC JPEG2000 codec cannot decode
wittdb
Basic Member
Basic Member
Posts:27

--
2012-05-08 06:59 PM
The original images do not open in CC since they are in JPEG2000 Lossless (.90). They do open fine in other viewers. If I use the CC SDK to change the transfer syntax to Explicit Little Endian, the converted images do not open is CC. My previous post described the error message displayed on the CC screen when CC tried to open the converted images. If I use another commercailly available tool (PowerTools from Laurel Bridge) to convert the original images to Explicit Little Endian, then they do open fine in CC. It seems to be an issue with the CC SDK. That is why I originally asked if there was some other step I needed to do to convert the actual pixel data from JPEG2000 (lossless) to Explicit Littile Endian. Simply changing the transfer syntax and then saving out the image file did not work.
stewart
Senior Member
Senior Member
Posts:2347

--
2012-05-08 08:31 PM
ChangeTransferSyntax is all you should need to do, but there is likely a bug in the J2K codec. I mentioned this in some other recent posts about the OpenJPEG codec, but I didn't mention it here - the OpenJPEG library had some bugs in it, so we dropped it from the official distribution of ClearCanvas Workstation. The codec itself, however, remains in the open source code, but it is not part of the official SDK.

As far as I knew, it worked fairly well, except for these occasional image corruption issues that caused us to drop it, but you may have discovered a new one. The bugs we saw were more along the lines of "lossless isn't actually lossless", as opposed to the outright corruption you are seeing.

Have you tried it with some sample J2K images, other than the ones you're having problems with, just to make sure it *can* work? I suppose that doesn't really help, though.
Live and real-time support available for Personal and Team Edition customers
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2013 ClearCanvas Inc. All Rights Reserved