Hi Luis,<br><br>thanks for your detailed explanations. I'll ask to your questions and ask you some more questions to the points you stated<br><br><div class="gmail_quote">On Mon, Oct 12, 2009 at 9:14 PM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Jesús,<br>
<br>
<br>
Thanks for the detailed description of your problem.<br>
<br>
<br>
1) ITK 2.8.1 is certainly an old version.<br>
It is great that you are updating.<br>
<br>
<br>
2) Why have you decided to update to 3.10.1<br>
instead of adopting the most recent release<br>
of ITK 3.16 ?<br>
<br></blockquote><div> </div><div>Under linux, we are using ubuntu 9.04, and that's the official itk version that comes with this distribution, so we first try to use the version of the libraries that comes in the common repositories. If we see the provided packages are wrong or causes any problem, we then consider to make our own packages to solve that problems. So, before building new packages for a more recent library version, we want to be sure in which side the problem is. We want to discard if that's a problem of us or that's because some bug in the library.<br>
<br>We also tried itk 3.14 (we used the packages found on <a href="http://apt.paulnovo.org/ubuntu/pool/main/i/insighttoolkit/">http://apt.paulnovo.org/ubuntu/pool/main/i/insighttoolkit/</a> which are built for this linux distribution too), and we had unfortunately the same errors.<br>
<br>So the question is, are we doing something wrong? or we can just put the blame on this itk versions?<br>Before building a more recent version, we want to be sure what's the real problem.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
3) Thanks for posting the minimal example for<br>
replicating the problem.<br>
<br>
I downloaded your .tar.gz file, and adapted<br>
the <a href="http://bug.pro" target="_blank">bug.pro</a> file in order to provide all the<br>
necessary libraries.<br>
<br></blockquote><div><br>I used your <a href="http://bug.pro">bug.pro</a> file, but I had to change the location of the libraries for ours (/usr/lib/.. /usr/include/Insight...), and remove the linking to
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">-litkpng \<br><style type="text/css">
p, li { white-space: pre-wrap; </style></p><p style="margin: 0px; text-indent: 0px;">-litktiff \</p><p style="margin: 0px; text-indent: 0px;">-litkzlib \</p><p></p><p></p><br>but I guess this has to do with the way the libraries are built and has no influence in the final result<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
4) I build it against our current CVS version,<br>
and Qt 4.5.0 and didn't received any error<br>
message when running:<br>
<div class="im"><br>
./bug-3.10.1 ./data<br>
<br>
<br>
</div>5) To make the program more informative,<br>
I added:<br>
<br>
ImageType::ConstPointer image = reader->GetOutput();<br>
<br>
image->Print( std::cout );<br>
<br>
and got the following (excerpt):<br>
<br>
<br>
Direction:<br>
1 0 0<br>
0 0.956305 0.292372<br>
0 -0.292372 0.956305<br>
<br></blockquote><div><br>This is the right direction because that's the one we get with 2.8.1, and that's the matrix you can compute from "Image Orientation Patient" dicom tag. In our case, we get the exception error I mentioned and the whole result of image->Print(std::cout) is<br>
<br><br><span style="font-family: courier new,monospace;">Image (0x872edb0)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> RTTI typeinfo: itk::Image<short, 3u></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Reference Count: 2 </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Modified Time: 7 </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Debug: Off </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Observers: </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> none </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Source: (0x876cfb8) </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Source output index: 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Release Data: Off</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Data Released: False</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Global Release Data: Off</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> PipelineMTime: 24</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> UpdateMTime: 0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> LargestPossibleRegion:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Dimension: 3</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Index: [0, 0, 0]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Size: [0, 0, 0]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> BufferedRegion:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Dimension: 3</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Index: [0, 0, 0]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Size: [0, 0, 0]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> RequestedRegion:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Dimension: 3</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Index: [0, 0, 0]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Size: [0, 0, 0]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Spacing: [1, 1, 1]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Origin: [0, 0, 0]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Direction:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">1 0 0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">0 1 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">0 0 1</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> IndexToPointMatrix:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 1 0 0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">0 1 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">0 0 1</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">PointToIndexMatrix:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 1 0 0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">0 1 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">0 0 1</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> PixelContainer:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ImportImageContainer (0x9fe0328)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> RTTI typeinfo: itk::ImportImageContainer<unsigned long, short></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Reference Count: 1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Modified Time: 4</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Debug: Off</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Observers:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> none</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Pointer: 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Container manages memory: true</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Size: 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Capacity: 0</span><br><br></div><div><br>As you can see, we get a "blank" Image completely void.<br>
<br>If I run the program without the QApplication it works ok and we get the right direction matrix and the resulting image is filled (Pointer, Size and Capacity are not null)<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
6) It would seem that you are being affected by<br>
a bug that may now been fixed in ITK 3.16.<br>
<br></blockquote><div><br>Do you know which bug is exactly? And do you know in wich version should this bug has been fixed?<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
7) The error message that your were reporting<br>
can be generated from the method<br>
<br>
::ComputeIndexToPhysicalPointMatrices()<br>
<br>
that is defined in the itkImageBase, and<br>
overloaded in the itkImage class.<br>
<br>
This methods verifies that the Direction<br>
matrix doesn't have a null determinant.<br>
<br>
In your case, it seems that the process<br>
of reading these two DICOM slices was<br>
generating a NULL-determinant Direction.<br>
<br>
<br>
8) There shouldn't be any relationship<br>
with using QApplication or not.<br>
<br>
You should receive the same error message<br>
when you don't use the QApplication class...<br>
<br></blockquote><div><br>That's the way it should be, but in fact it only appears if we put the QApplication. It's really strange, truly.<br><br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
unless....<br>
<br>
you are somehow linking to ITK shared<br>
libraries and may have different versions<br>
of them in your installation.<br>
<br></blockquote><div><br>We are linking to ITK shared libraries, but we have only one version installed at once (3.10.1).<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
9) Please run your program with :<br>
<br>
ldd ./bug-3.10.1 ./data<br>
<br>
and double check that the shared libraries<br>
that the program is finding are indeed the<br>
ones that you intended to link with.<br>
<br></blockquote><div><br>We checked it, and they are linking to the right libraries.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Please find attached the modified versions<br>
of <a href="http://bug.pro" target="_blank">bug.pro</a> and main.cpp.<br>
<br>
<br>
<br>
Regards,<br>
<br>
<br>
Luis<br>
<br>
<br>
---------------------------------------------------------------<br>
<div><div></div><div class="h5">On Thu, Oct 8, 2009 at 5:51 AM, Jesús Spínola <<a href="mailto:jspinola@gmail.com">jspinola@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I'm a developer of a cross platform DICOM Viewer application. It uses Qt<br>
> libraries ( version 4.5.0 ) for the GUI, itk to read the images (with GDCMIO<br>
> precisely) and vtk to display them.<br>
><br>
> Until now, we were using itk 2.8.1 and all was quite fine. Now, we are<br>
> looking forward to update the itk libraries to a more recent version but we<br>
> have encountered a problem. We tried itk 3.10.1, and for some series of<br>
> images, it gives an exception error when loading the files, and the data is<br>
> not loaded in memory at all, so it's not possible to view any image.<br>
><br>
> We have written a litlle program to reproduce the problem. It is very<br>
> simple, it declares the itk image format and the dicom reader, and tries to<br>
> read the files contained in a folder the user has provided as an argument in<br>
> the command line.<br>
> First, we only wrote the piece of code that reads the files, but it gave no<br>
> error or exception at all.<br>
> Later, we added the QApplication object in the main.cpp like you do in a<br>
> typical Qt application. Then, when we run the program, the exception<br>
> appeared again, so it seems there's some problem when using QApplication<br>
> with this version of itk (3.10.1).<br>
><br>
> We also tried with an earlier version of itk and a later version. With the<br>
> earlier (3.6.0) the problem doesn't appear, and with the later ( 3.14.0 ) it<br>
> continues appearing.<br>
><br>
> The exception message we get is the following:<br>
><br>
> itk::ERROR: Image(0x9ae0b78): Bad direction, determinant is 0. Direction is<br>
> 1 0 0<br>
> 0 0 0<br>
> 0 0 0<br>
><br>
> We tested this under a kubuntu 9.04<br>
><br>
> You can download the source code of the program and additional data<br>
> from <a href="http://www.box.net/shared/ctjvebgnr5" target="_blank">http://www.box.net/shared/ctjvebgnr5</a><br>
> All those files are compressed using gzip (bug.tar.gz) It contains the<br>
> main.cpp to reproduce the problem, with the respective project file for qt<br>
> (<a href="http://bug.pro" target="_blank">bug.pro</a>) and a folder with two dicom images that reproduces the problem.<br>
> To compile the program you will need qt 4.x libraries to be installed ( 4.5<br>
> preferably to better reproduce the problem ) and itk libraries too.<br>
><br>
> Follow this steps to get and run the executable:<br>
><br>
> 1. qmake <a href="http://bug.pro" target="_blank">bug.pro</a> # generate the makefiles<br>
> 2. make debug # compile the program with debug info<br>
> 3. ./bug-3.10.1 data/ # run the program, passing the directory<br>
> containing the image data to load<br>
><br>
><br>
> It's a weird problem and we would like to know where is the problem exactly,<br>
> because we don't know why is this error appearing when using the<br>
> QApplication object.<br>
> Kind regards,<br>
><br>
> --<br>
> Jesús Spínola<br>
><br>
><br>
> --<br>
> Jesús Spínola<br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br>Jesús Spínola<br>