[Insight-users] Danielsson DistanceMap - Unable to allocate memory for image

Malsoaz James jmalsoaz at yahoo.fr
Tue Feb 23 07:44:31 EST 2010


Hi,

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".

Here is the code that I'm using:
typedef itk::Image<unsigned char, 3> ImageType3D
typedef itk::DanielssonDistanceMapImageFilter<ImageType3D, ImageType3D> FilterType;
    FilterType::Pointer filter = FilterType::New();

    typedef itk::RescaleIntensityImageFilter<ImageType3D, ImageType3D> RescalerType;
    RescalerType::Pointer scaler = RescalerType::New();
    filter->SetInput(itkImporter->GetOutput());
    scaler->SetInput( filter->GetOutput() );
    scaler->SetOutputMaximum(255);
    scaler->SetOutputMinimum(0);
   try

    {
    scaler->Update();
    }
     catch( itk::ExceptionObject & err )
    {
        std::cerr << "ExceptionObject caught !" << std::endl;
        std::cerr << err << std::endl;
    }


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.

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.

Can I use something else to compute the distanceMap ?

By the way, my final goal with the DistanceMap is to use it in a registration process. 
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).
Certainly, ITK offers good solution for such registration needs. Have you any idea?

Thank you for you help.
Best
James




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100223/82716259/attachment.htm>


More information about the Insight-users mailing list