postb99
 Senior Member Posts:162
 |
| 2010-10-18 10:09 AM |
|
Hello,
I use a recompiled version of CC 2.0 SP1 to use it in an asp.net application. It works (I posted a thread on this on the forum).
I deployed the web application on our test server and called the code which extracts a bitmap from Dicom file and saved it to png, and get the following error : unsupported transfer syntax at ClearCanvas.ImageViewer.StudyManagement.DicomMessageSopDatasource
.DicomMessageFrameData.CreateNormalizedPixelData.
It works perfectly with visual studio development server or local IIS (basic configuration of this one, unlike our test server).
I attach the exception beginning of stack trace (resulting image with a black background. Image file is created so permissions are OK, I've checked this earlier).
Some more points then :
1 - I have double checked web application bin directory files, I have the right files and versions :
BilinearInterpolation.dll
ClearCanvas.Common.dll
ClearCanvas.Desktop.dll
ClearCanvas.Dicom.dll
ClearCanvas.ImageViewer.dll
ClearCanvas.Dicom.Codec.Jpeg.dll
ClearCanvas.Dicom.Codec.Rle.dll
log4net.dll
Logging.config
2 - On another hand, it seems I cannot have log4net properly working. I tried the following in Logging.config but have no log file. I learned than log4net doesn't support absolute paths but am a bit disappointed. (we use a custom logger). Getting the whole stack trace would be great...
3 - On my dev machine, I have CC Workstation installed. Does this have some impact on my asp.net application ? I doubt.
Thanks for helping me.
Barbara
|
|
|
|
|
postb99
 Senior Member Posts:162
 |
|
steve
 Senior Member Posts:1932
 |
| 2010-10-18 11:03 AM |
|
Barbara, could this be a 32-bit vs. 64-bit issue? The transfer syntax issue usually arises when the codecs can't be loaded. The codecs themselves are not universal binaries, you have to have the specific 32-bit or 64-bit version of them (the same with BilinearInterpolation.dll). Do you have this correct? Steve |
|
| Real-time support available to Clinical Edition and Team Edition customers |
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-19 02:44 AM |
|
Hi Steve,
This was my last guess too. I wait for confirmation about version of test server (it is in a virtual machine so I don't fully see system settings).
I will give a try with 64 bits of BilinearInterpolation and codecs dls.
Thanks,
Barbara
Edit : verification done, it is a Windows 2003 server 32 bits version. I may recompile codecs then ? |
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-19 03:59 AM |
|
Posted By postb99 on 2010-10-19 02:44 AM
Hi Steve,
This was my last guess too. I wait for confirmation about version of test server (it is in a virtual machine so I don't fully see system settings).
I will give a try with 64 bits of BilinearInterpolation and codecs dls.
Thanks,
Barbara
Edit : verification done, it is a Windows 2003 server 32 bits version. I may recompile codecs then ?
Edit 2 : I am now checking runtime versions. On test/production server, we should have as less as possible runtimes installed. So I may have questions when I'm done with listing.
|
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-19 04:43 AM |
|
On another machine (integration server), I have the following not installed, that I have on my dev machine : - Microsoft Visual C++ 2005 Redistributable - Microsoft Visual C++ 2005 ATL Update kb973923 x86 8.0.50.727.4053 I have the following installed on both : - Microsoft Visual C++ 2008 Redistributable x86 9.0.30729.4974 - Microsoft Visual C++ 2010 x86 Runtime 10.0.30319 On ImageViewer solution compilation, I have the following warnining on integration server : (0,0): warning : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: ClearCanvas.Dicom.Codec.Jpeg, Version=1.0.3715.32860, Culture=neutral, PublicKeyToken=null. The dependencies are: Microsoft.VisualC, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly. However, the pixel extraction from Dicom files works nicely. On test server, I don't have any " Microsoft Visual C++ ..." component installed. Now I have to add components to my development MS Visual Studio 2010 to be able to open .vcproj files and things will be clearer when I have recompiled the codecs plugins. What about BilinearInterpolation.dll ? Will I be able to recompile it too ? Barbara |
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-19 06:20 AM |
|
Now I have to find out why the .vcproj conversion fails :
Cannot load the project due to a corrupt project file.
The following error has occurred during XML parsing: File: D:\ExternalSVNs\ClearCanvas2.0SP1\Dicom\Codec\Jpeg\Jpeg.vcproj Line: 106 Column: 5 Error Message: System error: -2147154677. The file 'D:\ExternalSVNs\ClearCanvas2.0SP1\Dicom\Codec\Jpeg\Jpeg.vcproj' has failed to load.
I installed only base Visual C++ components, not X64 or Itanium related compiler tools (ahem, I need to save disk space).
I attach the .vcproj and .vcxproj files.
Barbara |
|
|
|
|
postb99
 Senior Member Posts:162
 |
|
postb99
 Senior Member Posts:162
 |
| 2010-10-19 07:13 AM |
|
Of course, I had to install X64 C++ compiler support :) |
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-19 09:47 AM |
|
I am almost sure I SHOULD install Visual C++ Redistributable on my test server. I think I must install version 9.0, from what I understood from managed C++ compilation and targeting. Since I use VS 2010 (framework 4 by default) but have C# code targeted to framework 3.5, I think C++ need VS 2008 associated redistributable (3.5/9.0). Thank you for confirmation. Barbara |
|
|
|
|
steve
 Senior Member Posts:1932
 |
| 2010-10-19 10:14 AM |
|
Barbara, You must install the redistributable for the version of Visual Studio that the codecs were compiled on. If you're using the versions we compiled, you'd use the VS 2008 redistributable. If you're using a version you compiled on VS2010, then you'd use the C++ redistributable from VS2010. This is independent of the .NET version you're using, the redistributable has unmanaged DLLs used by C++ compiled code. I don't really know much about the format of project files, so I can't help you on that, although I would suggest just retrying to convert the project files to solve that issue. Steve |
|
| Real-time support available to Clinical Edition and Team Edition customers |
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-20 03:25 AM |
|
Thanks Steve, this answered to my question. I solved projects conversion (just with adding X64 compiler support component) and will use codecs versions you compiled, anyway.
However, for now it still doesn't work on test server (still black image etc, after reboot), I will work on this.
I have 9.0.30729.4974 version of the redistributable on my dev machine (Windows 7) while Windows Update updated on test server (Windows 2003 server) to version 9.0.30729.4148 (ATL update). The difference may be unsignificant.
So I consider this topic's questions mainly answered.
Thanks,
Barbara |
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-20 04:00 AM |
|
Do you think the following may be critical ? Where do you think I get the error logged when the dll fails to load ? (using VS internal server or IIS 6). I have no log4net log from CC. It occurs when recompiling my solution which contains CC.Common dll I recompiled (target framework set to 3.5) and codecs you compiled (target framework set to 2.0). If I want to get rid of the error, I must recompile codecs but wasn't able to (see other thread). (0,0): warning : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: ClearCanvas.Dicom.Codec.Jpeg, Version=1.0.3715.32860, Culture=neutral, PublicKeyToken=null. The dependencies are: Microsoft.VisualC, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly.
|
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-20 08:54 AM |
|
Hello, Still not solved my runtime problem on the test server. - test 1 : visual c++ 2008 sp1 redistributable installed, rebooted : black image with error message - test 2 : visual c++ 2010 redistributable installed instead, rebooted : same error. Not surprising though. - test 3 : removed everything related to VS 2008 on dev machine, kept only visual c++ 2010 redistributable installed. Image generation works well. Surprising. In every case I use codecs compiled by ClearCanvas so I would expect test 3 to fail but it passed... Well, this is becoming an annoyance for me. Barbara |
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-25 08:12 AM |
|
Hello again on this problem. Please answer some more precise questions : - Do I need some runtime installed, other than Visual C++ 2008 (this version in my case). I'm guessing there is some runtime to achieve rendering (there is a class called GdiRenderer, so what does it do next ?) - Do I really need jpeg and rle codecs when calling DrawImageToBitmap ? On my dev machine, I removed them from my solution and the bitmap from dicom file extraction still works. Thanks, Barbara |
|
|
|
|
steve
 Senior Member Posts:1932
 |
| 2010-10-25 09:41 AM |
|
Barbara,
The runtime is linked to the version of Visual Studio the unmanaged code is compiled with. The JPEG codec has unmanaged (ie, native c++) code in it. If you compiled the Codec with Visual C++ 2008, then you should use the Visual C++ 2008 runtime. If you compile it with Visual Studio C++ 2010, then you should need the visual Studio C++ 2010 runtime. From the sounds of it, you are also utilizing the BilinearInterpolation.dll assembly for rendering, this also has some unmanaged code in it, which would require the appropriate runtime depending on how it was compiled. Since you haven't mentioned recompiling this assembly, it may be the reason why you needed the 2008 runtime on your test system.
You only require the JPEG and RLE codecs when calling DrawImageToBitmap if your source DICOM images you're rendering are compressed in the JPEG or RLE transfer syntax. The codecs are used to decompress these images before they can be rendered. If the source images are uncompressed, you wouldn't need the codecs.
Steve |
|
| Real-time support available to Clinical Edition and Team Edition customers |
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-25 09:53 AM |
|
Thanks Steve, I am currently coding debug to find out which transfer syntax the files I am using use... I think I will be fixed then. I will have a deeper look at DicomCodecRegistry content. I don't know anythng about recompiling BilinearInterpolation.dll so I use the precompiled version. I didn't succeed in recompiling codecs with VS 2010 and 3.5 framework target so also use precompiled ones. Thank you very much for your explaination. I'll keep you posted. Barbara |
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-25 11:09 AM |
|
Well, I feel like the error message could be more explicit and indicate the UID (and if it knows it, the name) of unsupported transfer syntax when it draws the error message on the image... I had images with jpeg 2000 pixel data format. Here is my log file below. Is there anything I can do to have jpeg 2000 support back ? Did you guys do something since 2009 ? Do you think Open Jpeg team did code reliable enough now ? Thanks, Barbara Dicom transfer syntax : Transfer syntax : UID : '1.2.840.10008.1.2.4.91' Name : 'JPEG 2000 Image Compression' Lossless compressed : 'False' Lossy compressed : 'True' Little endian : 'True' Encapsulated : 'True' Explicit VR : 'True' Deflate : 'False' 16:49:33,019 ERROR [ 7] Platform [(null)]- Exception thrown ClearCanvas.Dicom.Codec.DicomCodecException: Unsupported transfer syntax at ClearCanvas.ImageViewer.StudyManagement.DicomMessageSopDataSource.DicomMessageSopFrameData.CreateNormalizedPixelData() in D:\ExternalSVNs\ClearCanvas2.0SP1\ImageViewer\StudyManagement\DicomMessageSopDataSource.cs:line 308
|
|
|
|
|
postb99
 Senior Member Posts:162
 |
| 2010-10-26 05:35 AM |
|
Hello, Did you seriously think of using FreeImage as a jpeg 2000 codec ? (http://freeimage.sourceforge.net). I'm going to try to implement a jpeg 2000 codec using it. I will post code/questions back. Barbara |
|
|
|
|
steve
 Senior Member Posts:1932
 |
| 2010-10-26 09:26 AM |
|
Barbara,
As you can see on this page, FreeImage actually uses OpenJpeg for its Jpeg 2000 implementation.
Steve |
|
| Real-time support available to Clinical Edition and Team Edition customers |
|
|