<div dir="ltr">Andras and Luis,<div>  Thanks for your suggestions. I have tried running the code in 64-bit Release mode. Using print/cout statements I found out that the code crashes at the same point as the Debug mode. I have 8GB RAM on my laptop and &#39;am using a cropped image to test this filter (dimensions: 66x66x7). Is 7 slices too large? Or is this a bug in the filter?</div>
<div><br></div><div>Thanks</div><div>Prashanth</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 5, 2014 at 3:40 PM, Andras Lasso <span dir="ltr">&lt;<a href="mailto:lasso@queensu.ca" target="_blank">lasso@queensu.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>
<div>
<div style="font-size:11pt;font-family:Calibri,sans-serif">No matter how much RAM do you have, if you build a 32-bit application then you have memory space of 2GB, which typically means that you start running out of memory when you use more than 1-1.5 GB.
 The situation is even worse in debug mode (and also the code may run up to 10x slower).<br>
<br>
So, make sure you build 64-bit apps, preferably in release mode.<br>
<br>
Andras</div>
</div>
<div dir="ltr">
<hr>
<span style="font-size:11pt;font-family:Calibri,sans-serif;font-weight:bold">From:
</span><span style="font-size:11pt;font-family:Calibri,sans-serif"><a href="mailto:luis.ibanez@kitware.com" target="_blank">Luis Ibanez</a></span><br>
<span style="font-size:11pt;font-family:Calibri,sans-serif;font-weight:bold">Sent:
</span><span style="font-size:11pt;font-family:Calibri,sans-serif">2014-01-05 17:36</span><br>
<span style="font-size:11pt;font-family:Calibri,sans-serif;font-weight:bold">To:
</span><span style="font-size:11pt;font-family:Calibri,sans-serif"><a href="mailto:prashanth.dumpuri@gmail.com" target="_blank">Prashanth</a></span><br>
<span style="font-size:11pt;font-family:Calibri,sans-serif;font-weight:bold">Cc:
</span><span style="font-size:11pt;font-family:Calibri,sans-serif"><a href="mailto:insight-users@itk.org" target="_blank">itk</a></span><br>
<span style="font-size:11pt;font-family:Calibri,sans-serif;font-weight:bold">Subject:
</span><span style="font-size:11pt;font-family:Calibri,sans-serif">Re: [ITK Community] [Insight-users] itk AnisotropicDiffusion VesselEnhancement ImageFilter crashes</span><br>
<br>
</div><div><div class="h5">
<div>
<div dir="ltr">Prashanth,
<div><br>
</div>
<div>One thought that comes to mind:</div>
<div><br>
</div>
<div>This filter is known for being demanding in memory allocation.</div>
<div><br>
</div>
<div>So, the following questions may help</div>
<div><br>
</div>
<div><br>
</div>
<div>1) What is the size of your image ?</div>
<div><br>
</div>
<div>2) How much RAM do you have ?<br>
</div>
<div><br>
</div>
<div>3) Could you please open the Task Manager, and monitor the memory consumption as the executable is running ?<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>This may help to get a sense of whether the problem is related to running out of memory.</div>
<div><br>
</div>
<div><br>
</div>
<div>   Thanks</div>
<div><br>
</div>
<div>       Luis</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Dec 30, 2013 at 1:02 PM, Prashanth <span dir="ltr">
&lt;<a href="mailto:prashanth.dumpuri@gmail.com" target="_blank">prashanth.dumpuri@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>Luis,</div>
<div>  Thanks for the response. I ran the code in Debug mode.  </div>
<div><br>
</div>
<div>Here&#39;s the error message: Unhandled exception in itkAnisotropicDiffusionVesselEnhancementImageFilterTest.exe. Access violation reading location. </div>
<div><br>
</div>
<div>And, here&#39;s the output from the call stack. </div>
<div><br>
</div>
<div><font color="#666666">itkAnisotropicDiffusionVesselEnhancementImageFilterTest.exe!itk::<b>NeighborhoodAccessorFunctor</b>&lt;itk::Image&lt;itk::DiffusionTensor3D&lt;double&gt;,3&gt; &gt;::<b>Get</b>(const itk::DiffusionTensor3D&lt;double&gt; * pixelPointer) Line 68<span style="white-space:pre-wrap">
</span></font></div>
<div><font color="#666666"> <span style="white-space:pre-wrap"> </span>itkAnisotropicDiffusionVesselEnhancementImageFilterTest.exe!itk::ConstNeighborhoodIterator&lt;itk::Image&lt;itk::DiffusionTensor3D&lt;double&gt;,3&gt;,itk::ZeroFluxNeumannBoundaryCondition&lt;itk::Image&lt;itk::DiffusionTensor3D&lt;double&gt;,3&gt;,itk::Image&lt;itk::DiffusionTensor3D&lt;double&gt;,3&gt;
 &gt; &gt;::GetPixel(unsigned long i) Line 171<span style="white-space:pre-wrap"> </span>
</font></div>
<div><span style="white-space:pre-wrap"><font color="#666666"><br>
</font></span></div>
<div><font color="#666666">itkAnisotropicDiffusionVesselEnhancementImageFilterTest.exe!itk::AnisotropicDiffusionVesselEnhancementFunction&lt;itk::Image&lt;double,3&gt; &gt;::ComputeUpdate(const itk::ConstNeighborhoodIterator&lt;itk::Image&lt;double,3&gt;,itk::ZeroFluxNeumannBoundaryCondition&lt;itk::Image&lt;double,3&gt;,itk::Image&lt;double,3&gt;
 &gt; &gt; &amp; it, const itk::ConstNeighborhoodIterator&lt;itk::Image&lt;itk::DiffusionTensor3D&lt;double&gt;,3&gt;,itk::ZeroFluxNeumannBoundaryCondition&lt;itk::Image&lt;itk::DiffusionTensor3D&lt;double&gt;,3&gt;,itk::Image&lt;itk::DiffusionTensor3D&lt;double&gt;,3&gt; &gt; &gt; &amp; gt, void * globalData, const itk::Vector&lt;float,3&gt;
 &amp; offset) Line 142</font></div>
<div><span style="color:rgb(102,102,102)"><br>
</span></div>
<div><span style="color:rgb(102,102,102)">itkAnisotropicDiffusionVesselEnhancementImageFilterTest.exe!itk::AnisotropicDiffusionVesselEnhancementImageFilter&lt;itk::Image&lt;double,3&gt;,itk::Image&lt;double,3&gt;&gt;::ThreadedCalculateChange(const itk::ImageRegion&lt;3&gt; &amp; regionToProcess,
 const itk::ImageRegion&lt;3&gt; &amp; diffusionRegionToProcess, int __formal) Line 755</span><span style="color:rgb(102,102,102);white-space:pre-wrap">
</span><br>
</div>
<div><span style="white-space:pre-wrap"><font color="#666666"><br>
</font></span></div>
<div><font color="#666666">itkAnisotropicDiffusionVesselEnhancementImageFilterTest.exe!itk::AnisotropicDiffusionVesselEnhancementImageFilter&lt;itk::Image&lt;double,3&gt;,itk::Image&lt;double,3&gt; &gt;::CalculateChangeThreaderCallback(void * arg) Line 631<span style="white-space:pre-wrap">
</span></font></div>
<div><font color="#666666"><br>
</font></div>
<div><font color="#666666">ITKCommon-4.4.dll!itk::MultiThreader::SingleMethodProxy(void * arg) Line 376<span style="white-space:pre-wrap">
</span><br>
</font></div>
<div><font color="#666666">msvcr110d.dll!_callthreadstartex() Line 354<span style="white-space:pre-wrap">
</span></font></div>
<div><font color="#666666">msvcr110d.dll!_threadstartex(void * ptd) Line 337<span style="white-space:pre-wrap">
</span></font></div>
<div><font color="#666666">kernel32.dll!00007ffd0c3715cd()<span style="white-space:pre-wrap">
</span>Unknown</font></div>
<div><font color="#666666">ntdll.dll!00007ffd0c9f43d1()<span style="white-space:pre-wrap">
</span>Unknown</font></div>
</div>
<div><br>
</div>
<div><font color="#000000">It looks like a memory access violation error. I&#39;m running ITK 4.4 and &#39;am using the example dataset that the authors provide. Any pointers on how to proceed further?</font></div>
<div><font color="#000000"><br>
</font></div>
<div><font color="#000000">Thanks again</font></div>
<span><font color="#888888">
<div><font color="#000000">Prashanth</font></div>
</font></span>
<div>
<div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Sun, Dec 29, 2013 at 7:54 AM, Luis Ibanez <span dir="ltr">
&lt;<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">Hi Prashanth,
<div><br>
</div>
<div>Two things that can help:</div>
<div><br>
</div>
<div>A) Add a try / catch block around the Update() call of the filter,</div>
<div>    and print out the potential error message of the exception.</div>
<div><br>
</div>
<div>B) Run the filter in Debug mode, and once it crashes, capture</div>
<div>     the call trace (e.g. use backtrace in GDB for example).</div>
<div><br>
</div>
<div><br>
</div>
<div>In order to find the source of the problem, it will help to know if this</div>
<div>was and exception being thrown, or a segmentation fault.</div>
<div><br>
</div>
<div><br>
</div>
<div>    Thanks</div>
<div><br>
</div>
<div>        Luis</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>
<div>On Fri, Dec 20, 2013 at 4:55 PM, Prashanth <span dir="ltr">&lt;<a href="mailto:prashanth.dumpuri@gmail.com" target="_blank">prashanth.dumpuri@gmail.com</a>&gt;</span> wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
<div>
<div dir="ltr">All,
<div>    I&#39;m trying to run itkAnisotropicDiffusionVesselEnhancementImageFilter that was submitted to Insight Journal at
<a href="http://www.insight-journal.org/browse/publication/163" target="_blank">http://www.insight-journal.org/browse/publication/163</a></div>
<div><br>
</div>
<div>    Since I&#39;m using ITK 4.4, I used Dr. Ramon Casero&#39;s modifications. The application crashes with an &#39;access violation reading location&#39; error message. Here&#39;s the exact location of the crash:<br>

</div>
<div><br>
</div>
<div>Filename where it crashes: itkAnisotropicDiffusionVesselEnhancementImageFilter.txx</div>
<div>Function in that file: CalculateChange()</div>
<div>Line in that function:  this-&gt;GetMultiThreader()-&gt;SingleMethodExecute();</div>
<div><br>
</div>
<div>I checked Casero&#39;s modified version against the original code and the only changes he made were to make the code compatible with ITK 4.x. So, the crash should have nothing to do with the modification Casero made.<br>

</div>
<div> </div>
<div>What &#39;am I missing here? Any help will be appreciated.<br>
</div>
<div><br>
</div>
<div>Thanks</div>
<span><font color="#888888">
<div>Prashanth</div>
</font></span></div>
<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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</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>
Community mailing list<br>
<a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</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.php" target="_blank">http://www.kitware.com/products/protraining.php</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>
</div>
</div>
</div></div></div>

</blockquote></div><br></div>