Do you have a question?

First Name:
Surname:
Email:
Phone:
Message:
Get Audio Code

JPEG2000 Lossless Support
Last Post 08 May 2012 08:31 PM by stewart. 10 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
David WUser is Offline
New Member
New Member
Posts:28

--
26 Apr 2012 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!

 

Chris HafeyUser is Offline
Basic Member
Basic Member
Posts:120

--
26 Apr 2012 08:52 PM  
Yes, but it has some bugs and wont decode all JPEG2000 bitstreams.
David WUser is Offline
New Member
New Member
Posts:28

--
30 Apr 2012 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!!!!!
Chris HafeyUser is Offline
Basic Member
Basic Member
Posts:120

--
30 Apr 2012 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
David WUser is Offline
New Member
New Member
Posts:28

--
30 Apr 2012 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!!!
stewartUser is Offline
Veteran Member
Veteran Member
Posts:2359

--
30 Apr 2012 10:50 AM  
DicomFile has a ChangeTransferSyntax method - it really is that easy :)
David WUser is Offline
New Member
New Member
Posts:28

--
08 May 2012 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?
David WUser is Offline
New Member
New Member
Posts:28

--
08 May 2012 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?
Chris HafeyUser is Offline
Basic Member
Basic Member
Posts:120

--
08 May 2012 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
David WUser is Offline
New Member
New Member
Posts:28

--
08 May 2012 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.
stewartUser is Offline
Veteran Member
Veteran Member
Posts:2359

--
08 May 2012 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.
You are not authorized to post a reply.

Active Forums 4.1