Scaling Images - Interpolation?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
tlechner
Posts: 2
Joined: Mon, 2005-10-03, 22:42

Scaling Images - Interpolation?

#1 Post by tlechner »

Hey,

I have a question about the interpolation algorithms that have been implemented for scaling a DicomImage. The documentation refers to the pmbplus algorithm and the c't algorithm, but this is not very helpful. I even tried looking this up online, and I couldn't find any information regarding what these algorithms do.

Are they linear, bilinear, or bicubic? I'm involved in a study where our results will be highly influenced by the interpolation metric, and we would need to know this information if we were to use this library. Thanks for the clarification.

regards,

tom

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

As far as I remember, both algorithms are (bi)linear.

More information should be available as part of the original sources:
  • Manfred Rieg: Superelastisch - Verlustarmes Skalieren von Bitmap-Grafiken, c't magazine 11/94, page 302 (in German)
  • Jef Poskanzer: pbmplus toolkit version "10dec91" (use your favorite search engine to find it)
If you have advanced requirements regarding image interpolation you are free to add your own algorithms in "dcmimgle/include/discalet.h".

tlechner
Posts: 2
Joined: Mon, 2005-10-03, 22:42

#3 Post by tlechner »

Thanks very much!

tom

eduard_stanescu
Posts: 8
Joined: Thu, 2005-10-27, 18:06
Location: Toronto, Ontario, Canada

speaking about interpolation....

#4 Post by eduard_stanescu »

Does the interpolation work when enlarging the image??? It seems that it doesn't work although the code in discalet.h looks like it should do the job.....Any more ideas on this topic? :roll:

Thanks a lot!

eduard_stanescu
Posts: 8
Joined: Thu, 2005-10-27, 18:06
Location: Toronto, Ontario, Canada

more info on interpolation

#5 Post by eduard_stanescu »

When I call createScaledImage() with xfactor and yfactor parameters higher than 1.0 and I set interpolate = 1 parameter, the interpolatePixel() method of the DiScaleTemplate class defined in the discalet.h file gets called. When I set interpolate = 2, the expandPixel() method of the same class gets called. The code in those methods get executed as I have run the code with the debugger on,

The weird thing is that the end result, the scaled image, looks the same no matter what value I choose for the interpolate parameter. The enlarged image appears 'tiled', as no interpolation is performed, the pixels being just replicated. Is this behaviour by design?!

Thanks a lot,

Eduard

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

This seems to be a "feature" of these algorithms. Of course, you are free to enhance their capabilities in this aspect ;-)

eduard_stanescu
Posts: 8
Joined: Thu, 2005-10-27, 18:06
Location: Toronto, Ontario, Canada

bilinear/bicubic improvement

#7 Post by eduard_stanescu »

An update on this rather old topic, I have added methods to perform bilinear and bicubic interpolations on images in the discalet.h file. I am prettty happy with the results, the quality of the images is much better now.

Regarding the algorithms performance, the bilinear one is basically as fast as rendering the images uninterpolated. Naturally, the bicubic one is slower than uninterpolated or bilinear but still faster than current interpolations from discalet.h.

If someone needs the modified file, I can send it to him/her. I apologize for being so late with the update, I have done these improvements more than an year ago....

Eduard

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier »

Thank you for your feedback :-)

If you don't mind, you could send the changes to us by email: dicom/at/offis/dot/de. We will then check whether this contribution can be added to the DCMTK.

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#9 Post by Per »

I am also interested in this work. Could you please send a copy to per/at/fix/dot/no? Thank you very much.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest