Hello everyone,

I was wondering if itk developers provided a registration example between two 3d images using particle swarm optimizer ? Thank you

I don’t think there is such an example, but you can be inspired by particle swarm’s unit test and a registration example of your choice (perhaps this one).

I tried your solution @dzenanz and when I execute my program it stops just before finishing the registration process with this error message: `Description: itk::ERROR: ParticleSwarmOptimizer(0x5578e8497ac0): cost function and parameter bounds dimensions mismatch `

My question is: how can I declare a cost function?

okay, I managed to understand where the error came from. Just another question: what is `OptimizerType::ParameterBoundsType bounds;`

?

If I use 3d euler coordinates system, do I have to initialize `bounds`

like this: ?

Where the first three pushbacks bounds euler angles and the three last pushbacks bounds the translation among x, y, and z?

Use your IDE to explore the exact definition of this type.

You initialization with 6 pairs of values is good in principle, but I don’t know whether it compiles.

Maybe explain what was the exact problem and solution, in case somebody comes across this thread in the future?