Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, December 15, 2013 10:43:21 PM(UTC)
dkrijnen

Groups: Registered
Posts: 22


When using the Leadtools.Codecs Namespace > RasterCodecs Class : ReadThumbnail Method sometimes thumbnails of the images are created with very bad quality (Noisy). What is the cause of this?

Method used for creating:
http://www.leadtools.com/help/leadtools/v18/dh/co/leadtools.codecs~leadtools.codecs.rastercodecs~readthumbnail.html
dkrijnen attached the following image(s):
1.2.392.200036.9116.3.1.13592421.30000013121108564393700000025.jpg
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, December 17, 2013 5:07:41 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Hello,
It appears that you only sent the thumbnail image, can you send me the original image so I can test here? I have tested using cannon.jpg that ships with our toolkit and I didn't see the issue. Here is the code I tested with:
======================
string fileN = @"C:\Users\Public\Documents\LEADTOOLS Images\cannon.jpg";
RasterCodecs codecs = new RasterCodecs();
RasterImage img = null;
CodecsThumbnailOptions opt =CodecsThumbnailOptions.Default;
opt.LoadStamp=false;
img = codecs.ReadThumbnail(fileN, opt, 1);//codecs.Load(fileN);
MessageBox.Show("File loaded, bits per pixel " + img.BitsPerPixel.ToString());
codecs.Save(img, @"E:\Testing\DELME\thumb.png", RasterImageFormat.Png, 0);
======================

If you try the same code at your end with the same image, do you see the problem? If the problem only appears in your code or with your image, please send it to me inside ZIP or RAR file.
Also, which version of LEADTOOLS are you using?

 
#3 Posted : Tuesday, December 17, 2013 5:24:36 AM(UTC)
dkrijnen

Groups: Registered
Posts: 22


Unknown Error
We apologize, but an unknown error has occured in the forums.
This error has been logged.

 
#4 Posted : Wednesday, December 18, 2013 4:09:19 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Is the file size (the rar file) bigger than 4MB? If it is, our forums will not allow that, you can either upload it to an FTP server and give me the link. Or send an email to support@leadtools.com and include a link to this forum post and we will provide you with upload instructions to upload the file to our FTP server.
 
#5 Posted : Wednesday, December 18, 2013 6:11:26 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


I checked the image you sent and it looks similar to the thumbnail. The original image quality is noisy.
However, you can try to produce a clear thumbnail as follows:
1. Load the full size copy of the image instead of just a thumnail.
2. Perform image processing to enhance this copy.
3. Use our resizing function with interpolation to produce a better smaller copy.

If you need help with the details, please send me more information about the expected result

 
#6 Posted : Thursday, December 19, 2013 2:10:46 AM(UTC)
dkrijnen

Groups: Registered
Posts: 22


Hello,

1. We always make a thumbnail from middle frame of the multiframe image (reference)

2. The image in the viewer looks much better then the noisy thumbail.

3. How we know if such image is received and we should apply other processing to get a good thumbnail. I think we want one way to create a good thumbnail for all received dicom objects.
 
#7 Posted : Monday, December 23, 2013 6:48:21 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Hello,
If you disable applying VoiLut you will get a much better image. I'm attaching the image I got by removing "DicomGetImageFlags.AutoApplyVoiLut" from DicomDataset.load().

Daoud attached the following image(s):
converted_Dicom.png
 
#8 Posted : Tuesday, December 24, 2013 1:22:47 AM(UTC)
dkrijnen

Groups: Registered
Posts: 22


We have no problem with loading the images

We have a problem with getting thumbnails.
How can the not-noisy thumbnail be taken from the multyframe file.

We use RasterCodecs.ReadThumbnail for it. This method allows to set number of the frame for the thumbnail.
 
#9 Posted : Tuesday, December 24, 2013 5:03:36 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Since the DICOM dataset pixel data will be loaded as a noisy images, the thumbnail that results from it will be noisy too.
To correct this, you can load without the VOI LUT and resize to obtain the smooth thumbnail as follows:
========================
DicomEngine.Startup();
DicomDataSet ds = new DicomDataSet();
ds.Load(@"E:\00000001.dcm", DicomDataSetLoadFlags.None);
RasterImage image = ds.GetImage(null, 36, 0, RasterByteOrder.Gray,   DicomGetImageFlags.AutoApplyModalityLut | DicomGetImageFlags.None);
SizeCommand SizeCmd = new SizeCommand();
SizeCmd.Height = 80;
SizeCmd.Width = 80;
SizeCmd.Run(image);
DicomEngine.Shutdown();
========================

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.201 seconds.