You are not logged in.

1

Friday, September 30th 2005, 6:23pm

How to view tiff images in QImage and QLabel in QT 4.0

How do you make QT 4.0 open Tiff files? So far i can open Jpg and Png, but i need to be able to open Tiff.

I am using both QImage and Qlabel to display images which only allows Jpgs and Pngs. I need to be able to view Tiff images and Dicom.

If anyone has question or comments, please respond.

This post has been edited 1 times, last edit by "javastar" (Sep 30th 2005, 6:24pm)


2

Saturday, October 1st 2005, 2:44pm

Hi,

1)
You'll need to use an image plug-in to handle tiff format, just check the plugin classes (there are some examples)

or

2)
You can interface with a library that handles this kind of format.
For example, I use the ImageMagick library (with Magick++ interface),
and I can display all the ImageMagick formats in my Qt apps :)

Guilugi.

3

Monday, October 3rd 2005, 2:43pm

Interfacing Libraries

Magick++ interface?

Sorry, I have not used ImageMagick, so i do not know how to interface their libraries with QT's libraries.

Can you please explain the how to interface. I know that for libararies within AT it is #include, but I do not know about libraries outside Qt.

I am sorry if what I wrote is vague, I am just nervous that I might have to go back and rewrite all my code in Qt-3.3.2.

Please respond as soon as possible.

Thank you.

4

Monday, October 3rd 2005, 6:06pm

Ok,

First of all, you have (of course) to install ImageMagick and Magick++

I'm currently using them with a Debian, and I don't know yet if it will work with Windows, but
ImageMagick is available for Windows too.
I'll try this tomorrow, because my app needs to be fully cross-platform, but for now, I have only the Linux way.

I added these lines to my project files, so you can use the libs well
INCLUDEPATH += . /usr/include/Magick++
LIBS += -L/usr/lib -lMagick++

Then, check this page, it contains examples that load an image with Magick++.
All you have to do is grab the image buffer with a BLOB objet, and apply it in Qt, in a QPixmap or a QImage....
http://www.imagemagick.org/Magick++/Image.html

I've attached the imageviewer example (modified), that loads a file through ImageMagick, and displays it in a QWidget.

Hope this helps !

Guilugi.
gferry has attached the following file:
  • imageviewer.tgz (3.28 kB - 339 times downloaded - latest: May 20th 2013, 12:25pm)

5

Monday, October 3rd 2005, 6:07pm

And, by the way, I'll check the Windows version and post it asap !

Guilugi.

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

6

Monday, October 3rd 2005, 7:55pm

Otherwise you may want to give TIFF plugins for Qt a try, see for example:

As you can see TiffIO has been ported to Qt 4 but is GPL'ed, while qTiffIO is for Qt 3 and needs to be ported to Qt 4, but is LGPL'ed.

7

Tuesday, October 4th 2005, 3:27pm

ImageMagick

Thank you, gferry. The example works. :D

8

Tuesday, October 4th 2005, 4:24pm

But you know, if need only to handle TIFF files, I suggest you choose the other solution, given by Dimitri.
It may be much lighter to use TiffIO in that case ;)

Guilugi.

9

Tuesday, October 4th 2005, 6:16pm

Image Formats

In the near future, I will need to handle other image formats (DICOM).

10

Wednesday, October 12th 2005, 10:54pm

Tiff Sequence

In my program, I have two viewers, which are preview and main view. The imageviewer in a previous posting (The post by qferry in this thread) helped me open TIFFs in the preview using Magick++, but it does not completely help me with the main viewer.

The idea of the preview viewer is to make sure that the right image is picked and the idea of the main viewer is to open an sequence of images.

I went through the Magick++ documentation and mostly found image sequences for animation or changing the color of the transparent.

How do you open an TIFF sequence?

Is there a way to convert the code that was only able to open an single image into code that can open an sequence?

I tend to learn by looking at examples. So if you know of an example that is same basic concept, please post it. I keep all examples in my notebook.

Thank you.

This post has been edited 1 times, last edit by "javastar" (Oct 12th 2005, 11:06pm)


11

Tuesday, October 18th 2005, 9:53pm

Read Image Sequence = List

It took a little time to figure out that I needed to create a list and have all the images in the folder inserted into the List, but it took longer to admit it.

12

Wednesday, October 19th 2005, 5:55pm

I have used both QTiffIO and TiffIO for my project. QTiffIO is small light and easy to use but has the following limitations:

1. Read only does not support writting tiff files.

2. Not portable - only works on POSIX systems and will not compile on some 64 bit systems.

So if you need write support or portability TiffIO is the way to go.

13

Thursday, October 20th 2005, 3:38pm

TiffIO

I tried TiffIO versions 1.0.7 and 1.1.0.
Version 1.0.7 was only for QT 3.x and Version 1.1.0 couldn't find QT 4.0.1's core.

I tried looking for updates but, there are no longer downloads links on the page. The link that i was using is below.

http://artis.imag.fr/Software/TiffIO/

14

Thursday, October 20th 2005, 6:09pm

There is a download link on the bottom of the page for the latest version. The current version of TiffIO is 1.10c. When I first downloaded this about two weeks ago the current version was 1.10b. So the author is doing updates.

In the INSTALL or README file in the tarball I remember seeing something about a workaround for some 4.x problem. But since I am using QT3 for my project I didn't pay too much attention. The author is working mostly with QT3 as well.

I emailed him when I ran into a minor issue with 1.10b and he responded quickly and seemed to be very open to my feedback. In 1.10c the problem was fixed. If you have an issue with it not working with QT4 you should let the author know as I suspect that he would have either a fix or a workaround available in short order.

15

Thursday, October 20th 2005, 9:09pm

Link?

That is odd. When I open the web page, the link to downloads does not appear.

16

Thursday, October 20th 2005, 11:04pm

Look in the source download section about a 1/3 of the way down the page. The correct link says "Tar archives". The "Win zip" link does not work. I downloaded and built 1.10c just two days ago. If you really can't see the download links then there must be something wrong with your browser.

17

Wednesday, September 5th 2007, 4:46pm

Does anyone have any idea of how to read and display mutipage TIFF image ?

I use the TIFF plugin to read images.