2

I'm trying to use a composite transform (TranslationTransform + ScaleTransform) for registration. The concept is to first register with Translation, then do [Translation, Scale] with the initial transform of the translation given by the solution of the initial registration. If you try and do this with a composite transform, only the last transform added will get modified though, and all the higher order transform types include rotation - priors let me know that the rotation is well determined and shouldnt be modified as a degree of freedom. I can think of two ways of solving this:

  1. Come up with a way of allowing registration on a composite transform which allows for parameters from both transform to be modified - maybe using the base Transform class?
  2. Come up with a way of holding certain parameters constant in a higher order transform during registration. EDIT I think that the SetOptimizerWeights function can be used to do this way of solving the problem. EDIT You aren't allowed to SetOptimizerWeights for the L-BFGS type optimizers, meaning there is no easy way to mask dimensions. As these proved to be much much more robust across datasets, in the end I may just allow for registration to occur across the higher order space.

I dont know how to do either of these things and cant find any (good) documentation on either... any help very appreciated!!

1 Answers1

3

Your proposed solution 2 is the straightforward approach to doing what you want:

  1. Use an AffineTransform(3).
  2. The parameters of the affine transform GetParameters() are in row major order.
  3. For first registration, only translation, SetOptimizerWeights([0,0,0,1,0,0,0,1,0,0,0,1]) only translation portion is active.
  4. For the second registration, only scaling, SetOptimizerWeights([1,0,0,0,0,1,0,0,0,0,1,0]) only scale portion is active.

An aside, yes, this specific feature is not well documented, but the toolkit has extensive documentation, both on read-the-docs and on the toolkit's juypter notebook repository.

Finally, the main location for Q&A is on the itk discourse forum.

zivy
  • 521
  • 2
  • 2