almarklein / pyelastix

Thin wrapper around elastix - a toolbox for rigid and nonrigid registration of images
MIT License
103 stars 31 forks source link

2D-3D registration #24

Open vv4alekseev opened 4 years ago

vv4alekseev commented 4 years ago

Hello,

I want to implement a 2D-3D registration case with parameters from this page: http://elastix.bigr.nl/wiki/index.php/Par0013#Application.

For this task, I have to use: params.Metric = 'GradientDifference'

I have faced the following error: "Description: itk::ERROR: GradientDifferenceMetric(0x56530c3cd800): Metric can only be used for 2D-3D registration. FixedImageSize[2] must be 1"

But my im2 (FixedImage) is a 3D NumPy array with 2200, 2200, 1 shape. What should I do?

I tried to put only a 2D NumPy array with 2200, 2200 shape. But in this case, I get the following message: ERROR: problem defining fixed image dimension.; The parameter file says: 3; The fixed image header says: 2

almarklein commented 4 years ago

I am not sure what to do TBH, this seems arther specific to Elastix itself. You could try and check the content of the .mhd file that is written, and make sure that it is what you'd expect.