Hello,
I am developing a web viewer based on Julien Jay code, who posted in this thread a while ago. I upgraded the 1.5 CC libs he used to the 2.0 SP1 precompiled ones.
I have a funny problem.
In a nunit test project, I have no problem extracting a png file from a Dicom one (code below). In an asp.net web application, the same code doesn't work : I get "Failed to load provider type : ClearCanvas.Common.Configuration.StandardSettingsProvider (followed by assembly full name, version 2.0 something, so it looks for right version)".
I have included CC libraries in a class library project, used by my asp.net 3.5 application.
In the "bin" directory, I have the same dlls/files, here is the list :
- BilinearInterpolation
- CC Common
- CC Desktop
- CC Dicom
- CC Dicom codec *2
- CC ImageViewer
- log4net
- Logging.config
So I wonder whether I should do as Julien did, comment out some lines of code. Or better would be to correct what's wrong in my configuration.
In Logging.config, I indicated a full path for log file (c:/my/path/logfile.log), but there is no log file created.
Thank you for your help. if I have too much troubles, I will have to struggle with CC projects to fully compile etc to change code (since I use MS Visual Studio 2010 and framework 3.5).
Barbara
///
/// Extracts all the image files of DICOM file and stores them in compressed format besides Dicom file.
/// ///
Dicom file path
///
Compressed file format
public static void ExtractAllBitmap(string strDicomFilePath_, ImageFormat ifFormat_)
{
Bitmap bBitmap;
LocalSopDataSource dataSource = new LocalSopDataSource(strDicomFilePath_);
ImageSop imageSop = new ImageSop(dataSource);
int iWidth = PluginDICOM.GetUShort(imageSop[DicomTags.Columns]);
int iHeight = PluginDICOM.GetUShort(imageSop[DicomTags.Rows]);
int i = 1;
foreach (IPresentationImage ipImage in PresentationImageFactory.Create(imageSop))
{
string strCompressedFilePath = PluginDICOM.GetCompressedFilePath(strDicomFilePath_, ifFormat_, i++);
FileStream fsStream = new FileStream(strCompressedFilePath, FileMode.Create);
bBitmap = ipImage.DrawToBitmap(iWidth, iHeight);
bBitmap.Save(fsStream, ifFormat_);
fsStream.Dispose();
}
imageSop.Dispose();
}