Hi all,<br><br>I am using the CannyEdgeDetectionImageFilter and for small 3D images it works fine. For a bigger image (300x300x512) the following error appears:<br><span style="color: rgb(255, 0, 0);">  itk::ExceptionObject (0153C7B4)</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">  Location: &quot;double *__thiscall itk::ImportImageContainer&lt;unsigned long,double&gt;::A</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">  llocateElements(unsigned long) const&quot;</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">  File: h:\itk\insighttoolkit-3.16.0\code\common\itkImportImageContainer.txx</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">  Line: 188</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">  Description: Failed to allocate memory for image.</span><br><br>The source code for the filter is:<br><br><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">typedef double RealPixelType;</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">typedef itk::Image&lt;RealPixelType, Dimension&gt; RealImageType;</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">typedef itk::CastImageFilter&lt;ImageType, RealImageType&gt; CastToRealFilterType;</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">typedef itk::RescaleIntensityImageFilter&lt;RealImageType, ImageType&gt; RescaleFilterType;</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">        </span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">typedef itk::CannyEdgeDetectionImageFilter&lt;RealImageType, RealImageType&gt; CannyFilterType; </span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">CastToRealFilterType::Pointer toReal = CastToRealFilterType::New();</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">RescaleFilterType::Pointer rescale = RescaleFilterType::New();</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">CannyFilterType::Pointer cannyFilter = CannyFilterType::New(); </span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">rescale-&gt;SetOutputMinimum(0.0);</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">rescale-&gt;SetOutputMaximum(255.0);</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">toReal-&gt;SetInput(image);</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">cannyFilter-&gt;SetInput(toReal-&gt;GetOutput());</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">cannyFilter-&gt;SetVariance(var);</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">cannyFilter-&gt;SetUpperThreshold(up*1.0);</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">cannyFilter-&gt;SetLowerThreshold(low*1.0);</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">rescale-&gt;SetInput(cannyFilter-&gt;GetOutput());</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">try</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">{</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">    rescale-&gt;Update(); //Filterung</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">    image = rescale-&gt;GetOutput();</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">}</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">catch(itk::ExceptionObject &amp; err)</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">{</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">     std::cout&lt;&lt; &quot;ExceptionObject caught!&quot;&lt;&lt;std::endl;</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);">
<span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">     std::cout&lt;&lt; err &lt;&lt; std::endl;</span><br style="font-family: courier new,monospace; color: rgb(0, 0, 102);"><span style="font-family: courier new,monospace; color: rgb(0, 0, 102);">}</span><br style="color: rgb(51, 51, 51);">
<br><br>Does someone know how to avoid this error?<br><br>Thanks a lot and have a nice weekend!<br>Melanie<br>