Problem while resizing an image

Hi, I have two volumes with different size Fixed(240, 240, 180) and Moving(182, 218, 182), and registering them I apply a resizing with the function resample(). But when I visualize the images with an overlay of them, the axial view does not show the part of the moving volume.

Did someone have a similar problem?

I’m using this code to resample():

output = sitk::Resample(moving, Fixed_Image.GetSize(), bspline_trans, sitk::sitkNearestNeighbor, Fixed_Image.GetOrigin(), Fixed_Image.GetSpacing(), Fixed_Image.GetDirection(), 0, moving.GetPixelID());

Hello @Felippe_Trigueiro_An,

There are many reasons why you don’t see what you expect:

  1. The registration failed and the two volumes don’t overlap, or the transformation is in the other direction (in both cases the bspline_trans is mapping all points from the fixed image outside the moving image bounds).
  2. The visualization is off, combining two images from different modalities may require modifications of the intensities beforehand if you are alpha-blending the two.

Please provide additional details so that we can better identify the issue (possibly provide images?)

1 Like

When you are resampling to the fixed image grid, any part which does not fit within it gets cut off. If you want to see the rest of the moving volume, resample to enlarged fixed image. You could use pad filter to get that enlargement.

1 Like

Thanks for your answers. I did the modifications suggested by @dzenanz and the problem was solved. Thanks!!!