[Insight-users] Gradient time issues
Miller, James V (Research)
millerjv at crd.ge.com
Thu Oct 28 16:04:51 EDT 2004
Neilson,
If you just want to try this out, comment out the code in
itkImageToImageMetric that actually calculates the gradient.
Then in the metric that you using, look for the code that uses the gradient
value. For instance, in the MeanSquaresImageToImageMetric, there is a line
of code that says:
m_GradientImage->GetPixel( mappedIndex );
Replace this line with a line of code that uses a
CentralDifferenceImageFunction. The DemonsRegistrationFunction uses this
function to compute gradients on a point by point basis. You can look at
the DemonsRegistrationFunction to see how to use the
CentralDifferenceImageFunction.
Let us know the speed test results. If it looks promising, we might want to
add a "lazy" gradient calculation to the metrics.
Jim
-----Original Message-----
From: N.E. Mackenzie Mackay [mailto:9nem at qlink.queensu.ca]
Sent: Thursday, October 28, 2004 12:30 PM
To: 'insight-users at itk.org'
Subject: [Insight-users] Gradient time issues
Hi,
I am having some time issues with my current registration method.
Not
in the registration it self but with the pre processing.
The Gradient Recursive Gaussian Image filter seems to be taking
quite
a long time to pre-calculate a gradient field. As of now my
registration method only needs a few pixels from my image at a time.
(About 5% of the total number of pixels) I want to see if calculating
the gradient on the fly would produce faster results. The only problem
is I am not sure of how to do this.
Ideally I would like a method that would accept a index or pixel
location in the image and return a gradient value.
e.g. gradientValue = gradientCalculator->GetGradient(
pixelLocation
);
This is very similar to how I use the out out of the
GradientRecursiveGaussianImageFilter. The only difference is I don't
want the preprocessing because it take much to long.
Thank you,
Neilson
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list