Thursday, February 09, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: tchlee
New Today New Today: 16
New Yesterday New Yesterday: 26
User Count Overall: 20579

People Online People Online:
Visitors Visitors: 16
Members Members: 4
Total Total: 20

Online Now Online Now:
01: jbluks
02: jnewman
03: munir24hr
04: bjvail

ClearCanvas Community Forums

Unsupported Transfer Syntax Image
Last Post 2009-11-10 02:08 PM by stiank81. 13 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
karnold
New Member
New Member
Posts:4

--
2009-11-02 12:40 PM  

Using CC SDK 1.5

I am trying to extract an image from a dicom file. I have all plugins in my "bin" diretory and everything gets loaded successfully except this line:

No renderer plugins exist; defaulting to GDI renderer.

This is the error:

ClearCanvas.Dicom.Codec.DicomCodecException: Unsupported transfer syntax
   at ClearCanvas.ImageViewer.StudyManagement.DicomMessageSopDataSource.DicomMessageSopFrameData.CreateNormalizedPixelData()
   at ClearCanvas.ImageViewer.StudyManagement.StandardSopDataSource.StandardSopFrameData.GetNormalizedPixelData()
   at ClearCanvas.ImageViewer.StudyManagement.Frame.GetNormalizedPixelData()
   at ClearCanvas.ImageViewer.Imaging.PixelData.GetPixelData()
   at ClearCanvas.ImageViewer.Imaging.PixelData.get_Raw()
   at ClearCanvas.ImageViewer.Rendering.ImageRenderer.Render(ImageGraphic imageGraphic, IntPtr pDstPixelData, Int32 dstWidth, Int32 dstBytesPerPixel, Rectangle clientRectangle)
   at ClearCanvas.ImageViewer.Rendering.GdiRenderer.DrawImageGraphic(ImageGraphic imageGraphic)
   at ClearCanvas.ImageViewer.Rendering.RendererBase.DrawSceneGraph(CompositeGraphic sceneGraph)
   at ClearCanvas.ImageViewer.Rendering.RendererBase.DrawSceneGraph(CompositeGraphic sceneGraph)
   at ClearCanvas.ImageViewer.Rendering.RendererBase.Render()
   at ClearCanvas.ImageViewer.Rendering.GdiRenderer.Render()
   at ClearCanvas.ImageViewer.Rendering.RendererBase.Draw(DrawArgs drawArgs)
[11/2/2009 11:21:44] WARN  {ClearCanvas.Common.Platform} - Configuration store not found - defaulting to LocalFileSettingsProvider

This is the code used to extract the image:

ImageSop imgSOP = null;
IPresentationImage ipImage = null;
Bitmap bmpThumb = null;
MemoryStream msImg = null;
byte[] byImg = null;
 

msImg = new MemoryStream();
imgSOP = new ImageSop(new LocalSopDataSource(fiFiles.FullName));
ipImage = PresentationImageFactory.Create(imgSOP.Frames[1]);
bmpThumb = ipImage.DrawToBitmap(300,300);
bmpThumb.Save(msImg, ImageFormat.Jpeg);

byImg = msImg.ToArray();

 

The image is created but it is black with "unsupported transfer syntax" on the image. I believe these are jpg2000. Any ideas as what I am missing to process these files? Other types of images are processed fine.

 

Thanks...Kelly

Tags: Image, syntax, jpg2000, jpeg2000
steve
Senior Member
Senior Member
Posts:1885

--
2009-11-03 12:34 AM  
Unfortunately, the public release of the ImageViewer does not support a JPEG2000 codec. There's been a discussion on this in other posts on the forum, however, we did some preliminary work with the OpenJpeg open source JPEG2000 plugin, however, we found it unreliable, and decided to not use it in the ImageViewer and ImageServer. So, unfortunately, you cannot process the files.

Steve
Real-time support available to Clinical Edition and Team Edition customers
stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-03 04:32 AM  
Hi,
I got the same problem with one file. I got "Unsupported Transfer syntax" when opening it. It's Transfer Syntax UID is 1.2.840.10008.1.2.4.50 - "JPEG Baseline". Isn't this supported either? The odd thing about this is that I opened the file successfully with your ClearCanvas Workstation. So if it can be opened in the Workstation - why can't I open it using the SDK? Both are version 1.5.

Cheers,
Stian
karnold
New Member
New Member
Posts:4

--
2009-11-03 09:52 AM  
This is just a C# project where I am trying to extract the DICOM image, create a thumbnail and store in a SQL DB. Isn't there a jpeg2000 codec I can use somewhere? At least this was what I gathered from another post: http://clearcanvas.ca/dnn/tabid/69/afv/topic/aff/2/aft/13741/Default.aspx. I have found ClearCanvas.Dicom.Codec.Jpeg2000, can I implement this dll in some way using SDK 1.5??

Thanks.
steve
Senior Member
Senior Member
Posts:1885

--
2009-11-03 09:59 AM  
Stian,

What's in your log file when you have this problem? And, are you having a 32bit vs 64bit issue? The SDK is only distributed in 32-bit form.

Although people use it for other reasons, the SDK is aimed at users who want to write plugins to extend the functionality of the Workstation. As such, if you write a plugin that's entirely managed code using the SDK, it should work in both the 32-bit and 64-bit of the Workstation. We have a need for separate 32-bit and 64-bit builds of the Workstation (and ImageServer for that matter) because we do include several unmanaged DLLs that must be compiled specifically for 32-bit or 64-bit Windows. IE, the codecs are unmanaged DLLs along with the BilinearInterpolation.dll mentioned in another forum post.

Steve
Real-time support available to Clinical Edition and Team Edition customers
karnold
New Member
New Member
Posts:4

--
2009-11-03 03:37 PM  
OK, so how do I get the jpeg2000 pixel data into a byte array so I can work with it? Will
dfFile = new DicomFile(fiFile.FullName);
dfFile.Load();
dfFile.DataSet[DicomTags.PixelData].Values
give me the correct information?
steve
Senior Member
Senior Member
Posts:1885

--
2009-11-03 04:01 PM  
WSchamps,

On your question related to getting a J2K codec plugin, you'd have to do a few things:

- Get access to SVN and download the tag'd 1.5 ImageViewer source.
- The J2K codec is in Trunk\Dicom\Codec\Jpeg2000 folder. You'd have to incorporate the project file in this directory, along with its support files in the directory into your solution and change it so that it references the precompiled 1.5 SDK ClearCanvas.Dicom and ClearCanvas.Common dlls.

You should then be able to just put the codec into your plugins folder, if you have one, or your local directory and the ClearCanvas.Dicom assembly should be able to dynamically load the DLL. This DLL could also be placed into the plugins folder of a 1.5 Workstation install, and be usable. Note that you'd have to compile 32-bit and 64-bit versions of the DLL, since its a managed c++ assembly.

Concerning getting access to compressed pixel data, the DicomCompressedPixelData class is used by the library internally to access compressed fragments/frames. You can look at the DicomMessageBase.ChangeTransferSyntax method and the Decode method of the RLE Codec to get an idea how this works, however, here's a short code fragment:

DicomFile file;
int frameNum = 0;
DicomCompressedPixelData fragments = new DicomCompressedPixelData(file.DataSet);
byte[] frame = fragments.GetFrameFragmentData(frameNum);

Steve
Real-time support available to Clinical Edition and Team Edition customers
stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-09 02:28 AM  
Steve,
I can't find any log file from the SDK. Where would I find this? Should there be one by default, or do I need to configure something to get it?

I don't know if this is a 32bit vs 64bit issue. I am running on 64bit Win7, but I am using the 64bit Bilinearinterpolation.dll. After switching to this 64bit dll things seems to have started working fine. But you're saying that there may still be issues even though it is mostly working? I'm not writing plugins for the Workstation. Writing a completely new Wpf viewer - only using the ClearCanvas library for handling the Dicom file. Still - it's all managed c# code that works directly with the managed ClearCanvas libraries, so I can't see why this should be a problem.

Btw; I'm sorry for the late reply..

Stian
steve
Senior Member
Senior Member
Posts:1885

--
2009-11-09 09:59 AM  
Stian,

You'd have to setup a log4net Logging.config file to get the logging working properly. If you have the ImageViewer installed, just look for the file in the install directory of the viewer. This should get logging working.

Steve
Real-time support available to Clinical Edition and Team Edition customers
stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-09 04:13 PM  
Thanks. Now I got the log.. Well - it basically says "missing renderer plugin" I guess? (see log at the bottom)..

This is for a Dicom-file which works fine in Workstation x64. It's transfer syntax GUID is 1.2.840.10008.1.2.4.50 (JPEG Baseline). Any ideas why it doesn't work using the SDK? Am I missing a plugin?

2009-11-09 22:07:16,812 [10] INFO - No renderer plugins exist; defaulting to GDI renderer.
2009-11-09 22:07:16,903 [10] ERROR - Exception thrown
ClearCanvas.Dicom.Codec.DicomCodecException: Unsupported transfer syntax
at ClearCanvas.ImageViewer.StudyManagement.DicomMessageSopDataSource.DicomMessageSopFrameData.CreateNormalizedPixelData()
at ClearCanvas.ImageViewer.StudyManagement.StandardSopDataSource.StandardSopFrameData.GetNormalizedPixelData()
at ClearCanvas.ImageViewer.StudyManagement.Frame.GetNormalizedPixelData()
at ClearCanvas.ImageViewer.Imaging.PixelData.GetPixelData()
at ClearCanvas.ImageViewer.Imaging.PixelData.get_Raw()
at ClearCanvas.ImageViewer.Rendering.ImageRenderer.Render(ImageGraphic imageGraphic, IntPtr pDstPixelData, Int32 dstWidth, Int32 dstBytesPerPixel, Rectangle clientRectangle)
at ClearCanvas.ImageViewer.Rendering.GdiRenderer.DrawImageGraphic(ImageGraphic imageGraphic)
at ClearCanvas.ImageViewer.Rendering.RendererBase.DrawSceneGraph(CompositeGraphic sceneGraph)
at ClearCanvas.ImageViewer.Rendering.RendererBase.DrawSceneGraph(CompositeGraphic sceneGraph)
at ClearCanvas.ImageViewer.Rendering.RendererBase.Render()
at ClearCanvas.ImageViewer.Rendering.GdiRenderer.Render()
at ClearCanvas.ImageViewer.Rendering.RendererBase.Draw(DrawArgs drawArgs)
stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-09 04:24 PM  
I figured it out.. It turned out that I did indeed miss some plugins. The ClearCanvas.Dicom.Codec.Jpeg.dll and ClearCanvas.Dicom.Codec.Rle.dll wasn't in my application folder. Apparently these weren't automagically copied to the Debug folder as a dependency from the other ClearCanvas modules. So - now it's working. Great!

You wouldn't happen to have a list of the dll's I should have in my application folder when using the ImageViewer library (not using WinForms components)?

Thanks,
Stian
stewart
Senior Member
Senior Member
Posts:2032

--
2009-11-10 09:48 AM  
Hi, the missing renderer plugin log is just informational, it's not an error. The relevant error is just below that - "Unsupported Transfer Syntax", which means one of 2 things: you are missing the CC.Dicom.Codec.Jpeg plugin, or it can't be loaded for some reason. First step, make sure that plugin is in your plugins folder. If it is, there should be something in the logs (on startup) stating that it couldn't be loaded and why.

Hope this helps,
Stewart
Real-time support available to Clinical Edition and Team Edition customers
stewart
Senior Member
Senior Member
Posts:2032

--
2009-11-10 11:05 AM  
Oops, sorry. Looks like I responded to your previous post without reading the most recent. Off the top of my head, this is what you need:

CC.Common
CC.DICOM
CC.DICOM.Codec.JPeg
CC.DICOM.Codec.Rle
CC.ImageViewer
BilinearInterpolation.dll
log4net.dll
logging.config

If you don't want to have a plugins folder, you can just dump them all in the same folder as the rest of your app, too.

Hope this helps,
Stewart
Real-time support available to Clinical Edition and Team Edition customers
stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-10 02:08 PM  

Thanks again. All these files are present in my application folder, so hopefully there should be no more issues now.

Cheers! 

You are not authorized to post a reply.

Active Forums 4.1
Copyright 2011 ClearCanvas Inc.