[Insight-users] bug in gradientRecursiveGaussianImageFilter?
Martin Urschler
martin at urschler.info
Tue Sep 27 10:37:03 EDT 2005
hello,
i was digging into the GradientRecursiveGaussian filter and found
something that might cause seg faults (actually i wonder why it doesn´t)
I use 3D images, i.e. ImageDimension equals 3
The class creates 2 smoothing Image filters and one derivative filter
in my case. In the generateData method of this filter there is a while
loop setting up the directions of these 3 filters.
for (unsigned int dim=0; dim < ImageDimension; ++dim)
{
unsigned int i=0;
unsigned int j=0;
while( i < ImageDimension )
{
if (i == dim)
{
j++;
}
std::cout << "setting smoothing filter[" i << "] to
direction [" << j << "]" << std::endl;
m_SmoothingFilters[i]->SetDirection( j );
++i;
++j;
}
m_DerivativeFilter->SetDirection( dim );
.... do the other stuff ....
}
If I introduce the cout message as shown above I get the following
console output:
dim = 0:
setting smoothing filter [0] to direction [1]
setting smoothing filter [1] to direction [2]
setting smoothing filter [2] to direction [3]
dim = 1:
setting smoothing filter [0] to direction [0]
setting smoothing filter [1] to direction [2]
setting smoothing filter [2] to direction [3]
dim = 2:
setting smoothing filter [0] to direction [0]
setting smoothing filter [1] to direction [1]
setting smoothing filter [2] to direction [3]
However smoothing filter [2] has nowhere been created. I guess this
should segfault, at least sometimes, but obviously it doesn't which is
strange since every registration application using a metric derived
from itkImageToImageMetric uses this class to calculate moving image
derivatives. so there should be lots of test cases all around the
world...
regards, Martin
More information about the Insight-users
mailing list