Framework for creating images in a multi-resolution pyramid.
MultiResolutionPyramidImageFilter provides a generic framework to to create a image pryamid according to a user defined multi-resolution schedule.
The multi-resolution schedule is specified in terms for shrink factors at each multi-resolution level for each dimension.
A user can either use the default schedules or specify each factor in the schedules directly.
The schedule is stored as an unsigned int matrix. An element of the table can be access via the double bracket notation: table[resLevel][dimension]
For example: 8 4 4 4 4 2
is a schedule for two computation level. In the first (coarest) level the image is reduce by a factor of 8 in the column dimension, factor of 4 in the row dimension and factor of 4 in the slice dimension. In the second level, the image is reduce by a factor of 4 in the column dimension, 4 is the row dimension and 2 in the slice dimension.
The method SetNumberOfLevels() set the number of computation levels in the pyramid. This method will allocate memory for the multi-resolution schedule table. This method generates defaults tables with the starting shrink factor for all dimension set to 2^(NumberOfLevel - 1). All factors are halved for all subsequent levels. For example if the number of levels was set to 4, the default table is:
8 8 8 4 4 4 2 2 2 1 1 1
The user can get a copy of the schedule via GetSchedule() They may make alteration and reset it using SetSchedule().
A user can create a default table by specifying the starting shrink factors via methods SetStartingShrinkFactors() The factors for subsequent level is generated by halving the factor or setting to one, depending on which is larger.
For example, for 4 levels and starting factors of 8,8,4 the default table would be:
8 8 4 4 4 2 2 2 1 1 1 1
When this filter is updated, NumberOfLevels outputs are produced. The N'th output correspond to the N'th level of the pyramid.
To generate each output image, Gaussian smoothing is first performed using a DiscreteGaussianImageFilter with variance (shrink factor / 2)^2. The smoothed image is then downsampled using aResampleImageFilter.
Note that even if the shrink factors are all equal to one, a smoothing will still be applied. The output at the finest level of the pyramid will thus typically be a smoothed version of the input.
This class is templated over the input image type and the output image type.
This filter uses multithreaded filters to perform the smoothing and downsampling.
This filter supports streaming.
Creates a multi-resolution pyramid using a recursive implementation.
RecursiveMultiResolutionPyramidImageFilter creates an image pryamid according to a user defined multi-resolution schedule.
If a schedule is downward divisible, a fast recursive implementation is used to generate the output images. If the schedule is not downward divisible the superclass (MultiResolutionPyramidImageFilter) implementation is used instead. A schedule is downward divisible if at every level, the shrink factors are divisible by the shrink factors at the next level for the same dimension.
See documentation of MultiResolutionPyramidImageFilter for information on how to specify a multi-resolution schedule.
Note that unlike the MultiResolutionPyramidImageFilter, RecursiveMultiResolutionPyramidImageFilter will not smooth the output at the finest level if the shrink factors are all one and the schedule is downward divisible.
This class is templated over the input image type and the output image type.
This filter uses multithreaded filters to perform the smoothing and downsampling.
This filter supports streaming.