Hi James<div><br></div><div>Have you tried Maurer's distance transform?</div><div><br></div><div><a href="http://www.itk.org/Doxygen/html/classitk_1_1SignedMaurerDistanceMapImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1SignedMaurerDistanceMapImageFilter.html</a></div>
<div><br></div><div>Nick<br><br><div class="gmail_quote">On Tue, Feb 23, 2010 at 7:44 AM, Malsoaz James <span dir="ltr"><<a href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Hi,<br><br>I'm using the DanielssonDistanceMapImageFilter on 3D volume. Unfortunately, I'm experiencing troubles when the 3D volume is too big and I get this error: "Unable to allocate memory for image".<br>
<br>Here is the code that I'm using:<br><div style="margin-left:40px">typedef itk::Image<unsigned char, 3> ImageType3D<br></div><div style="margin-left:40px">typedef itk::DanielssonDistanceMapImageFilter<ImageType3D, ImageType3D> FilterType;<br>
FilterType::Pointer filter = FilterType::New();<br><br> typedef itk::RescaleIntensityImageFilter<ImageType3D, ImageType3D> RescalerType;<br> RescalerType::Pointer scaler = RescalerType::New();<br> filter->SetInput(itkImporter->GetOutput());<br>
scaler->SetInput( filter->GetOutput()
);<br> scaler->SetOutputMaximum(255);<br> scaler->SetOutputMinimum(0);<br> try<br>
{<br> scaler->Update();<br> }<br> catch( itk::ExceptionObject & err )<br> {<br> std::cerr << "ExceptionObject caught !" << std::endl;<br> std::cerr << err << std::endl;<br>
}<br></div><br><br>It works great when the dimension volume are 512*512*100. But when I have volume with big dimensions (ie 512*512*350), I get the error.<br><br>Is there a solution for this problem ? Certainly I can't compute the distance map using this filter on big volumes because of memory issues.<br>
<br>Can I use something else to compute the distanceMap ?<br><br>By the way, my final goal with the DistanceMap is to use it in a registration process. <br>Indeed, I have CT images and a list of points obtained by a navigation system during a surgery. I would
like to do the registration to find the transformation between the "real" points on the patient and the surface on my volume (this volume has been compute with the CT images).<br>Certainly, ITK offers good solution for such registration needs. Have you any idea?<br>
<br>Thank you for you help.<br>Best<br>James<br><br></td></tr></tbody></table><br>
<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></div>