General Registration (BRAINS) consistently reports the error “All samples map outside the moving image buffer,” even when the same image is used for both the fixed and moving volumes for a specific image

I am using Windows version 5.10.0

Please find the image here. It is a normal CT image, and I don’t know why BRAINS is not working for this specific case. Thank you very much for any help.

In general, using the same image as fixed and moving is not a good test case, as having exactly 0 intensity difference and gradients can cause numerical errors. For testing, always add some random perturbation in image pose and/or image content.

That said, after I’ve added some small initial random transformation to the moving image, I still got the same error:

itk::ExceptionObject (0000007E693D76B0)
Location: “unknown”
File: C:\D\S\S-0-build\ITK\Modules\Registration\Metricsv4\include\itkMattesMutualInformationImageToImageMetricv4.hxx
Line: 311
Description: ITK ERROR: MattesMutualInformationImageToImageMetricv4(00000237B9A05CA0): All samples map outside moving image buffer. The images do not sufficiently overlap. They need to be initialized to have more overlap before this metric will work. For instance, you can align the image centers by translation.

I debugged it a bit and it seems that after the first iteration the new transform moves the moving image so much that it no longer overlaps with the fixed volume. Rescaling the image intensity values (e.g., Simple Filters module, RescaleIntensityImageFilter set output minimum and maximum to 0 and 255) or changing the optimization parameters could solve this.

Instead of trying to tune these registration parameters, I would recommend to use a registration tool that does not require parameter tuning, such as Elastix or ANTs Slicer extensions.

1 Like

RescaleIntensityImageFilter fixed this issue. Thank you so much Dr. Lasso!