<br>Hi James,<br><br><br>Here are some alternatives:<br><br><br>Option (A): You usually don't need to know the values of the distance<br>map in every pixel of the image. You could get an approximation by<br>using a FastMarching filter and only computing the distance map up to<br>
a certain "distance" from the object. E.g. like computing the distance<br>in a band around the object of interest.<br><br><br>Option (B): The Danielsson filter not only computes the distance map,<br>it also allocates memory for:<br>
<br> 1) a Voronoi map (that you may not need)<br> 2) a Vector image with X,Y,Z distances (that you may not need)<br><br>You may be able to compute the distance image, disconnect it from<br>the pipeline, and destroy the filter, so that (1) and (2) are deallocated.<br>
<br>The distance map is probably not the only filter taking memory in your<br>pipeline. So, by re-arranging the operations you may be able to fit<br>this into your RAM.<br><br><br>Option (C) : You may want to try enabling the ReleaseDataFlag()<br>
in all the filter that precede the Distance map filter. That will release<br>some memory as well.<br><br><br>and, since your final goal is to perform registration:<br><br><br>Option (D): You may find useful the class<br><br>
itkBinaryMaskToNarrowBandPointSetFilter<br><br>it is well suited for performing a registration between a set of points<br>and a binary mask.<br><br>You will find details in:<br><br>InsightDocuments/Papers/MedIASpecialIssue/NarrowBandToImageRegistration<br>
<br><a href="http://www.itk.org/cgi-bin/viewcvs.cgi/Papers/MedIASpecialIssue/NarrowBandToImageRegistration/?root=InsightDocuments">http://www.itk.org/cgi-bin/viewcvs.cgi/Papers/MedIASpecialIssue/NarrowBandToImageRegistration/?root=InsightDocuments</a><br>
<br><br><br> Regards,<br><br><br> Luis<br><br><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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
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>