[Insight-users] RecursiveMultiResolutionPyramidImageFilter
Luis Ibanez
luis.ibanez at kitware.com
Mon, 16 Feb 2004 04:14:25 -0500
Hi Corinne,
The RecursiveMultiResolutionPyramideImageFilter
builds the pyramid by using the image at level "n"
in order to produce the image at level "n+1".
Every image is blurred and then subsampled in order
to produce the image at the next coarser level.
The smoothing is applied using a variance
Variance = ShrinkFactor / 2
Where
shrinkfactor = schedule[i] / scheduler[i+1]
Insight/Code/Algorithms/
itkRecursiveMultiResolutionPyramidFilter.txx:
around line 112
If you go from full resolution, directly to a factor
of 4 the original image gest blurred with variance = 4/2,
and then subsampled by a factor of 2.
If, on the other hand, you go from the full resolution
to a shrink factor of 2 and then to 4, the original
image gets blurred first with variance = 2/2 = 1, then
subsampled by a factor of 2 in order to produce the
second level of the pyramid. Then this level is blurred
with a variance 2/2 and subsampled by a factor of 2.
Blurring twice with a variance of 1 is not equivalent
to blurring once with a variance of 2.
The total effect is that the image gets more cumulated
blurring when you go throught a pyramid of several
intermediate levels.
This shouldn't be too much of a concern for the
registration process since the blurred images do not
have to have a precise callibration of their intensities.
The blurring produced with the DiscreteGaussian is an
approximation anyways...
Regards,
Luis
--------------------------
Corinne Mattmann wrote:
> Hi,
>
> I use the RecursiveMultiResolutionPyramidImageFilter and I noticed that I
> get slightly different image values when I have the same subsampling factor
> but at another level of the pyramid. In the attached code and output, the
> difference can be seen: I produce 2 pyramids, one with 1 level and
> StartingShrinkFactors 4, the other one has three levels and the same
> factors. I compare then the output images of the two pyramids at the first
> level (0). They both have the same size, but the values are slightly
> different, e.g. 46.6713 and 48.9142 (I have char-images with values between
> 0 and 127).
> Has this something to do with the fact that the smaller image size (12) is
> not exactly a factor of 4 smaller than the original one (50)?
>
> Thanks,
> Corinne
>
>
> ------------------------ code -------------------------
>
> typedef Image<char, 3> ImageType;
> typedef Image<float, 3> InternalImageType;
> typedef
> RecursiveMultiResolutionPyramidImageFilter<InputImageType,InternalImageType>
> FixedPyramidType;
> typename FixedPyramidType::Pointer TestPyramid1;
> TestPyramid1 = FixedPyramidType::New();
> TestPyramid1->SetInput(inputPtr1);
> TestPyramid1->SetNumberOfLevels(3);
> TestPyramid1->SetStartingShrinkFactors(4);
> TestPyramid1->GetOutput(0)->Update();
> typename FixedPyramidType::Pointer TestPyramid2;
> TestPyramid2 = FixedPyramidType::New();
> TestPyramid2->SetInput(inputPtr1);
> TestPyramid2->SetNumberOfLevels(1);
> TestPyramid2->SetStartingShrinkFactors(4);
> TestPyramid2->GetOutput(0)->Update();
> TOutputImage::IndexType index;
> index[0] = 5;
> index[1] = 5;
> index[2] = 5;
> std::cout << "Pixel value pyramid 1: " <<
> TestPyramid1->GetOutput(0)->GetPixel(index) << std::endl;
> std::cout << "Region pyramid 1: " <<
> TestPyramid1->GetOutput(0)->GetLargestPossibleRegion() << std::endl;
> std::cout << "Spacing pyramid 1: " <<
> TestPyramid1->GetOutput(0)->GetSpacing() << std::endl;
> std::cout << "Origin pyramid 1: " <<
> TestPyramid1->GetOutput(0)->GetOrigin() << std::endl;
> std::cout << "Pixel value pyramid 2: " <<
> TestPyramid2->GetOutput(0)->GetPixel(index) << std::endl;
> std::cout << "Region pyramid 2: " <<
> TestPyramid2->GetOutput(0)->GetLargestPossibleRegion() << std::endl;
> std::cout << "Spacing pyramid 2: " <<
> TestPyramid2->GetOutput(0)->GetSpacing() << std::endl;
> std::cout << "Origin pyramid 2: " <<
> TestPyramid2->GetOutput(0)->GetOrigin() << std::endl;
>
>
> ------------------------ output -------------------------
>
> Pixel value pyramid 1: 46.6713
> Region pyramid 1: ImageRegion (0223DEC8)
> Dimension: 3
> Index: [0, 0, 0]
> Size: [12, 12, 12]
> Spacing pyramid 1: 0.136 0.136 0.136
> Origin pyramid 1: 8.466 8.398 3.468
>
> Pixel value pyramid 2: 48.9142
> Region pyramid 2: ImageRegion (0223D8B8)
> Dimension: 3
> Index: [0, 0, 0]
> Size: [12, 12, 12]
> Spacing pyramid 2: 0.136 0.136 0.136
> Origin pyramid 2: 8.466 8.398 3.468
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>