Summary:The problem of choosing mathematical parameters to represent a model of an image is closely related to the problem of choosing parameters to transform one image into another, and the ITK registration framework provides a flexible toolbox for the latter. The authors have developed new classes within the ITK framework to enable the application of the image registration tools already available in ITK to the former problem. The class needs to calculate the image's value given the location and provide the required methods enabling the optimizer classes to act upon the parameters in the same way as they do for the standard registration problem. To this end the authors have provided a special metric class to compare a standard image to a calculated (parametric) image, and a parametric image source class to present the calculated data in the required manner. A facility for enabling or disabling specified parameters is implemented.
Evidence:The authors provide an example which aligns a 2-dimensional Gaussian distribution of greyscale with a second Gaussian calculated function, and apply two different optimizers from the ITK toolkit to solve the problem.The test program generates the input image in memory from the same Gaussian function generator and perturbs the parameters to provide to the parametric image source. No images are input or output, just the initial and final parameters.
Open Science:Yes. All the code and data required is included in the package. The example does not input any images as the test image is generated in memory.
Reproducibility:Yes. Compiling and running the provided example worked immediately on my Red Hat 5 / 64bit system with relatively recent ITK build installed.
I have also implemented my own routine that makes use of the code for a real-world problem and initial results are encouraging.
In order to implement my own function it was necessary to derive a class and implement the function generation sections. If a class which only needs to be provided with the function could be developed, this would be even better. However, it would need to be able to accept a function with an arbirtrary number of parameters, and to know how many parameters it has, I am not sure myself how this could be done, whether it could be templated over a 'functor' or obtain the information from a ->SetFunctor() method? I may be out of my c++ depth !
Use of Open Source Software:The package does not use any software other than ITK
Open source Contributions:Yes, the code is usable and at for my purpose it was working immediately with my ITK installation. But, creating a new parametric image with my own fuction required some more c++ knowledge than I usually have ;-) , as above; it would be attractive to be able to just call a SetFunctor() method and only provide the formulae for the parametric image.
Code Quality :The code appears to me to be coded in ITK compatible style, to the limit of my knowledge of the style guidelines.
Quality of the data :The example does not use significant amount of data. To try the example with different parameters requires altering and compiling the code, to try with different functions for the parametric image requires creating a derived class and compiling that.
Interest:It is broadly applicable. I intend to use this method to check the alignment of a calibration sample (sphere of known diameter and density moved to known positions in space ) in an X-ray beam imaging system, applying the formula for attenuation of the X-ray through the thickness of the sphere. In our lab it could be used to help track the change in size and shape of features in images where the nature of the shape is known i.e. growth of spherical particles or bubbles, as altertnative to segmentation of the boundaries -- often the boundary is not so clear but the overall variation in image intensity is clear and contains more information than just 'inside/outside' so it's an attractive approach .
Free comment :I observed some issue with the interaction of the set of enabled/disabled parameters with the optimizer classes, this also appears to vary depending upon the optimizer class chosen.
When I optimize my 5-parameter image with Amoeba optimizer, but suppress some parameters, the optimizer still reports and adjusts 5 parameters, but when I use the Powell optimizer, the reduced number of parameters is reported.
The inital parameter set gets passed to the optimizer in such a way that the first parameter appears to be given to the first enabled parameter, thus the initial guess could be very poor compared to what was intended!
Certain parameter choices cause the optimizer to return an error message that all points map outside the target image, but it's unclear to me what this means in the context of the parametric image
The Amoeba optimizer fixes the number of parameters to optimize when the method AmoebaOptimizer::SetCostFunction() is set. Specifically, it sets the number of parameters to the number reported by ImageToParametricImageSourceMetric::GetNumberOfParameters(). Now, because the ImageToParametricImageSourceMetric::GetNumberOfParameters() method reports the number of enabled parameters, this number may change. Therefore, if you disable a parameter in the metric after calling AmoebaOptimizer::SetCostFunction(), you'll get the strange behavior your describe. I'll look into submitting a patch for the AmoebaOptimizer to ITK.
The PowerOptimizer obtains the number of parameters just prior to optimization, so you are free to enable/disable parameters after calling PowerOptimizer::SetCostFunction().
I've updated the source code (revision 2) to show the necessary order of initialization and method calls when using the AmoebaOptimizer, and changed it to optimize only 4 of the 5 parameters for the ParametricGaussianImageSource to better show the capabilities of the ImageToParametricImageSourceMetric.