[Insight-developers] Number of parameters in itk::IdentityTransform is not 0

Cory Quammen cquammen at cs.unc.edu
Thu Apr 29 10:28:13 EDT 2010


Looking at the source of itk::IdentityTransform, I see that it is
initialized so that the m_Parameters member variable has size 1. Thus,
the result from GetNumberOfParameters() is 1. Similarly, the
m_Jacobian member variable is initialized to have size (image
dimensions, 1).

It seems to me that the IdentityTransform should have 0 parameters.
The SetParameters() method does nothing, after all.

I've tested changing the constructor in IdentityTransform to declare 0
parameters and the Jacobian to have dimensions (image dimensions, 0)
and run 'make tests'. Every test passes except for
itkIdentityTransformTest, which segfaults when trying to access
elements in the now-empty Jacobian matrix retrieved from an
IdentityTransform. Unfortunately, there is no way to get the
dimensions of an itk::Array2D, so I've had to remove the Jacobian test
to make it pass instead of modifying it to check for the proper
Jacobian dimensions.

Am I right in thinking that the IdentityTransform should have 0
parameters, or is there some subtlety in the registration framework
that requires this? I understand that it probably hasn't been tested
because who would try to optimize an IdentityTransform? For the
record, I'm adapting the registration framework to fit image intensity
models as well as spatial transforms, so getting an accurate number of
parameters from the chosen transform is essential.

If there is no good reason to report the number of parameters as 1,
I'll report a bug in Mantis and follow the procedure for committing
the fix.

Thanks,
Cory

-- 
Cory Quammen
Center for Computer Integrated Systems for Microscopy and Manipulation (CISMM)
Department of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~cquammen


More information about the Insight-developers mailing list