[Insight-users] Bug reading DICOM Series with QApplication

Luis Ibanez luis.ibanez at kitware.com
Mon Oct 12 15:14:10 EDT 2009


Hi Jesús,


Thanks for the detailed description of your problem.


1)  ITK 2.8.1 is certainly an old version.
     It is great that you are updating.


2)  Why have you decided to update to 3.10.1
     instead of adopting the most recent release
     of ITK 3.16 ?


3)  Thanks for posting the minimal example for
      replicating the problem.

      I downloaded your .tar.gz file, and adapted
      the bug.pro file in order to provide all the
      necessary libraries.


4)  I build it against our current CVS version,
     and Qt 4.5.0 and didn't received any error
     message when running:

             ./bug-3.10.1          ./data


5)  To make the program more informative,
      I added:

    ImageType::ConstPointer image = reader->GetOutput();

    image->Print( std::cout );

    and got the following (excerpt):


           Direction:
                    1 0 0
                    0 0.956305 0.292372
                    0 -0.292372 0.956305


6) It would seem that you are being affected by
    a bug that may now been fixed in ITK 3.16.


7) The error message that your were reporting
     can be generated from the method

    ::ComputeIndexToPhysicalPointMatrices()

    that is defined in the itkImageBase, and
    overloaded in the itkImage class.

    This methods verifies that the Direction
     matrix doesn't have a null determinant.

     In your case, it seems that the process
     of reading these two DICOM slices was
     generating a NULL-determinant Direction.


8) There shouldn't be any relationship
     with using QApplication or not.

     You should receive the same error message
     when you don't use the QApplication class...

     unless....

     you are somehow linking to ITK shared
     libraries and may have different versions
     of them in your installation.


9)  Please run your program with :

               ldd      ./bug-3.10.1     ./data

      and double check that the shared libraries
      that the program is finding are indeed the
      ones that you intended to link with.


Please find attached the modified versions
of bug.pro and main.cpp.



    Regards,


           Luis


---------------------------------------------------------------
On Thu, Oct 8, 2009 at 5:51 AM, Jesús Spí­nola <jspinola at gmail.com> wrote:
> Hello,
>
> I'm a developer of a cross platform DICOM Viewer application. It uses Qt
> libraries ( version 4.5.0 ) for the GUI, itk to read the images (with GDCMIO
> precisely) and vtk to display them.
>
> Until now, we were using itk 2.8.1 and all was quite fine. Now, we are
> looking forward to update the itk libraries to a more recent version but we
> have encountered a problem. We tried itk 3.10.1, and for some series of
> images, it gives an exception error when loading the files, and the data is
> not loaded in memory at all, so it's not possible to view any image.
>
> We have written a litlle program to reproduce the problem. It is very
> simple, it declares the itk image format and the dicom reader, and tries to
> read the files contained in a folder the user has provided as an argument in
> the command line.
> First, we only wrote the piece of code that reads the files, but it gave no
> error or exception at all.
> Later, we added the QApplication object in the main.cpp like you do in a
> typical Qt application. Then, when we run the program, the exception
> appeared again, so it seems there's some problem when using QApplication
> with this version of itk (3.10.1).
>
> We also tried with an earlier version of itk and a later version. With the
> earlier (3.6.0) the problem doesn't appear, and with the later ( 3.14.0 ) it
> continues appearing.
>
> The exception message we get is the following:
>
> itk::ERROR: Image(0x9ae0b78): Bad direction, determinant is 0. Direction is
> 1 0 0
> 0 0 0
> 0 0 0
>
> We tested this under a kubuntu 9.04
>
> You can download the source code of the program and additional data
> from http://www.box.net/shared/ctjvebgnr5
> All those files are compressed using gzip (bug.tar.gz) It contains the
> main.cpp to reproduce the problem, with the respective project file for qt
> (bug.pro) and a folder with two dicom images that reproduces the problem.
> To compile the program you will need qt 4.x libraries to be installed ( 4.5
> preferably to better reproduce the problem ) and itk libraries too.
>
> Follow this steps to get and run the executable:
>
> 1. qmake bug.pro          # generate the makefiles
> 2. make debug              # compile the program with debug info
> 3. ./bug-3.10.1 data/     # run the program, passing the directory
> containing the image data to load
>
>
> It's a weird problem and we would like to know where is the problem exactly,
> because we don't know why is this error appearing when using the
> QApplication object.
> Kind regards,
>
> --
> Jesús Spínola
>
>
> --
> Jesús Spínola
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 1697 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091012/4f05ccc2/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.pro
Type: application/octet-stream
Size: 1578 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091012/4f05ccc2/attachment.obj>


More information about the Insight-users mailing list