读取dicom图像时出错

时间:2014-05-03 03:06:57

标签: c# .net dicom clearcanvas

我正在尝试在.net中读取Dicom图像,但在drawToBitmap方法中获取异常......

它是一个渲染异常,给出消息"渲染管道中抛出异常。"它的目标网站是" Void Draw(ClearCanvas.ImageViewer.Rendering.DrawArgs)"虽然它的内部期望是DicomCodecException,但它的消息是"不支持的传输语法"它的目标网站是" Void Draw(ClearCanvas.ImageViewer.Rendering.DrawArgs)"

以下是StackTrace:

at ClearCanvas.ImageViewer.Rendering.RendererBase.Draw(DrawArgs drawArgs)
at ClearCanvas.ImageViewer.Rendering.RendererFactoryBase.RendererProxy.Draw(DrawArgs drawArgs)
at ClearCanvas.ImageViewer.PresentationImage.DrawNoEvents(DrawArgs drawArgs)
at ClearCanvas.ImageViewer.PresentationImage.DrawToBitmap(Bitmap bmp)
at ClearCanvas.ImageViewer.PresentationImage.DrawToBitmap(Int32 width, Int32 height)

我引用的汇编文件是

ClearCanvas.Common.dll
ClearCanvas.Desktop.dll
ClearCanvas.Dicom.dll
ClearCanvas.ImageViewer.Common.dll
ClearCanvas.ImageViewer.dll
ClearCanvas.Utilities.Manifest.dll
log4net.dll
NMock2.dll
nunit.framework.dll
ClearCanvas.Dicom.Codec.Jpeg.dll
ClearCanvas.Dicom.Codec.Rle.dll

并将以下文件复制到bin / debug文件夹

BilinearInterpolation.dll

我正在使用以下代码:

LocalSopDataSource DatosImagen = new LocalSopDataSource("C:\IM-0001-0005.dcm");

ImageSop imageSop = new ImageSop(DatosImagen);

IPresentationImage imagen_a_mostrar = PresentationImageFactory.Create(imageSop.Frames[1]);

int width = imageSop.Frames[1].Columns;

int height = imageSop.Frames[1].Rows;

Bitmap bmp = imagen_a_mostrar.DrawToBitmap(300, 300);

return bmp;

我还想提一下,我也使用了Norman的样本,这个样本是在forum中给出的,但是他的代码也没有用,并且显示了Black Image ......

0 个答案:

没有答案