<br>Hi Osc,<br><br>Thanks for posting the details from your debugging session.<br><br>It looks like the "<span style="color: rgb(31, 73, 125);" lang="EN-US">outSpacing" variable is not </span>initialized correctly.<br>
<br>In a 3D image, this arrays is expected to have three elements.<br><br><br>We may have to go to your original code in order to trace the<br>problem. Could you post the code ?<br><br><br>Any chance that you can compile this with GCC ?<br>
and run Valgrind on it ?<br><br><br>That will be an effective way of locating uninitialized variables...<br><br><br> Regards<br><br><br> Luis<br><br><br>--------------------------------------------------------------------------<br>
<div class="gmail_quote">On Fri, Apr 9, 2010 at 9:58 PM, Osc@r Math <span dir="ltr"><<a href="mailto:olguna@cimat.mx">olguna@cimat.mx</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;">
<div link="blue" vlink="purple" lang="ES-MX">
<div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Again Myself…</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">I´ve been debugging
and find that error starts on </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Command</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US">output->SetSpacing(outSpacing);</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Function</span></p>
<p class="MsoNormal" style="margin-left: 35.4pt; text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US">template <typename TOutputImage></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US">void VTKImageImport<TOutputImage>::GenerateOutputInformation()</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">File</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> itkVTKImageImport.txx</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Debugging information</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> outSpacing
is generated like:</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> typename
TOutputImage::SpacingType outSpacing;</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US">This is the result by traspase inSpacing data</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> outSpacing:
{ ????, ????, ????, { 1, 1, 2 } }; </span></p>
<p class="MsoNormal" style="margin-left: 70.8pt; text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> {WSH?,WSH?,WSH?, { xSpacing,ySpacing,zSpacing
} }.</span></p>
<p class="MsoNormal" style="margin-left: 70.8pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> WSH?:=What Suppose to be here?</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Those data passes to</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US">if( this->m_Spacing != spacing ) HERE m_Spacing=</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> {</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> this->m_Spacing = spacing;</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> this->ComputeIndexToPhysicalPointMatrices();</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> this->Modified();</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Command: this->ComputeIndexToPhysicalPointMatrices();</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Function: Void
ImageBase<VImageDimension>::SetSpacing(const SpacingType & spacing )</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">FILE: itkImageBase.txx</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Var Keeps: spacing:
{ ????, ????, ????, { 1, 1, 2 } };</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Command: this->Superclass::ComputeIndexToPhysicalPointMatrices();</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Function: void
Image<TPixel, VImageDimension>::ComputeIndexToPhysicalPointMatrices()</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">FILE: itkImage.txx</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Var keeps: m_Spacing:
{ ????, ????, ????, { 1, 1, 2 } }</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Command: this->m_PhysicalPointToIndex
= m_IndexToPhysicalPoint.GetInverse();</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Function: void
ImageBase<VImageDimension>::ComputeIndexToPhysicalPointMatrices()</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">FILE: itkImageBase.txx</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Var keeps: m_Spacing:
{ ????, ????, ????, { 1, 1, 2 } }</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Command: vnl_matrix<T>
temp = vnl_matrix_inverse<T>( m_Matrix );</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Function: inline
vnl_matrix_fixed<T,NColumns,NRows> GetInverse( void ) const</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">FILE: itkMatrix.h</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Data keeps: m_Matrix:
{ { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 2 } } }</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Command & Function:</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">operator const
vnl_matrix_ref<T>() const { return vnl_matrix_ref<T>( num_rows,
num_cols, const_cast<T*>(data_block()) ); }</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">*data_block: E2335
Overloaded 'vnl_matrix_fixed<double, 3, 3>::data_block' ambiguous in this
context</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">Command & Function:</span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span style="color: rgb(31, 73, 125);" lang="EN-US">T const* data_block () const { return data_[0]; }</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">DATA: *data_: { 1, 0, 0 }, {
0, 1, 0 }, { 0, 0, 2 }</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US">And so on, but I
couldn´t find the error…</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">De:</span></b><span style="font-size: 10pt;"> <a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a>
[mailto:<a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a>] <b>En nombre de </b>Osc@r Math<br>
<b>Envia</b></span><b><span style="font-size: 10pt;" lang="ES">do
el:</span></b><span style="font-size: 10pt;" lang="ES">
Viernes, 09 de Abril de 2010 07:09 p.m.<br>
<b>Para:</b> <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
<b>Asunto:</b> [Insight-users] ~vnl_svd() {} misterious runtime error</span></p>
</div>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span lang="ES-TRAD">Hi All…!!!</span></p>
<p class="MsoNormal"><span lang="ES-TRAD"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Recently I took back an ITK-VTK-BCB5
project, but as I know ITK & VTK improves, I decided to update those
toolkits (by the way, congrats!!! For this big effort).</span></p>
<p class="MsoNormal"><span lang="EN-US">Actually, compiled ITK 3.16 & VTK 5.4.2
Releases</span></p>
<p class="MsoNormal"><span lang="EN-US">BCB 5 with Borland C++ compiler 5.5.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Today I get a runtime error that
it’s pretty mysterious (at least for me)…</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The application reads a 3D image by VTK
reader, show it by VTK renderization, send it to ITK pipeline, calculates
partial derivatives & magnitude gradient, then save Dx, Dy, Dz & |V|.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The image has a spacing, an origin, among
others…</span></p>
<p class="MsoNormal"><span lang="EN-US">When spacing is 1.0, 1.0, 1.0 there’s
no problem, everything works fine,</span></p>
<p class="MsoNormal"><span lang="EN-US">but if spacing changes anyone of those
dimensions, application crashes.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The application is capable to read image,
show it, but when tries to connect VTKReader to ITKCaster (is first action with
ITK) send an “Abnormal Program Termination”</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">In Debug mode I realize that crashes trying
to execute </span></p>
<p class="MsoNormal"><span lang="EN-US">~vnl_svd() {}</span></p>
<p class="MsoNormal"><span lang="EN-US">In vnl_svd.h file and mark an error like:</span></p>
<p class="MsoNormal"><span lang="EN-US">… Access violation at address XXXX
…</span></p>
<p class="MsoNormal"><span lang="EN-US">If continue debugging, crashes too in:</span></p>
<p class="MsoNormal"><span lang="EN-US">~vnl_diag_matrix() {}</span></p>
<p class="MsoNormal"><span lang="EN-US">In vnl_diag_matrix.h file with similar
error</span></p>
<p class="MsoNormal"><span lang="EN-US">And finally throws an “Abnormal
Program Termination”…</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I didn´t know why tries to invert a matrix
that contains</span></p>
<p class="MsoNormal"><span lang="EN-US">xSpacing
0
0</span></p>
<p class="MsoNormal"><span lang="EN-US">
0
ySpacing
0</span></p>
<p class="MsoNormal"><span lang="EN-US">
0
0
zSpacing</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">¡¡¡ Someone could help me !!!</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">TNX in advance</span></p>
<p class="MsoNormal"><span style="font-size: 12pt; font-family: "Times New Roman","serif";"><br>
<br>
__________ Información de ESET Smart Security, versión de la base de firmas de
virus 5014 (20100409) __________<br>
<br>
ESET Smart Security ha comprobado este mensaje.<br>
<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
<br>
<br>
__________ Información de ESET Smart Security, versión de la base de firmas de
virus 5014 (20100409) __________<br>
<br>
ESET Smart Security ha comprobado este mensaje.<br>
<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a></span></p>
</div></div></div><div><div></div><div class="h5">
<br><br>__________ Información de ESET Smart Security, versión de la base de firmas de virus 5014 (20100409) __________<br><br>ESET Smart Security ha comprobado este mensaje.<br><br><a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
</div></div></div>
<br>_____________________________________<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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.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></blockquote></div><br>