I need to extract a DICOM image from a file and convert it to a standard bitmap. This is the code I have, using fo-dicom:
Bitmap bmp;
try
{
var image = new DicomImage(Context.Server.MapPath("~/IM-0001-0000.dcm"));
bmp = new Bitmap(image.RenderImage());
}
catch (Exception exception)
{
//for breakpoint purposes
throw;
}
However, it fails with the following message:
No codec registered for tranfer syntax: JPEG 2000 Image Compression
I'm not an expert on medical imaging, and Google doesn't turn up anything useful. I installed fo-dicom via NuGet, so I suppose all required references are already in the project. What am I missing?
no codecerror message. I think the clue is that your ASP.NET app is having problems loading the native DLLs, let me try to find some advice on that problem. ASP has some weirdness with paths for native DLLs, could be that it cannot find them which might lead to the codec error. - Chris O