Tuesday, January 09, 2007

Derivative & Blurring



The above is a movie of the registration process with the changes added below.

I got the registration to accept the new derivative that I created. The derivative is calculated by using the normal direction of the face on the mesh that I am interested in multiplied by the magnitude of the metric. The metric is calculated by finding the chi-squared difference between the point in between the Gaussian and the logistic fit positions to the data in the intensities. The derivative has to be negated since in the itk::VersorRigid3DTransformOptimizer it assumes that the derivative is calculated from the gradient and that would point in the direction of the maximum, and in the case I am looking at I am trying to minimize the metric value and therefore the optimizer will try to compensate for that by changing the direction of the derivative. I had issues with the metric going off in a weird direction before, but I found that the problem stemmed from the scaling in the optimizer. I had drowned out the angle and z-parameters in the itk::PointSetToImageRegistrationMethod registration framework by scaling the values with 10000000000000.0, which would divide the derivative value inside the optimizer and therefore make it have no contribution to the registration at all. In some of the ITK examples I had found that they used a translation scaling of 1/1000 for the parameters of interest, specifically the translation parameters. So I thought that I could be having issues with that drowning out the effects of the derivative value that I had created. So I set that value to 1 and the registration finally performed as I expected it to with the derivative that I had been feeding it. In this particular situation I had been experimenting with just one intensity process, but now I need to add the rest of the intensity values back into the registration. The registration now works using translation with one intensity profile from any distance as long as the fitting program is able to work with the intensities that it is passed.

I also figured out where the skipping of the lines was located. It was a line in the intens_process class that would throw out a new line as it were iterating through the cells. And I completed changing the itk::IntensityProfileMetric class so that it only loads the image into the intensity_process class process once in the class constructor. Thus the speed is increased for each iteration, but starting up the program takes a long time because the image is being smoothed using itk::BinomialBlurImageFilter which helps to stabalize the results of the fitting program from iteration to iteration.

Another thing that might be good to complete would be to finish making the visualization that shows the normals and the magnitudes that they contribute to the metric and derivative.

0 Comments:

Post a Comment

<< Home