BUG: Preserve OutputRegionMode in IterativeDeconvolutionImageFilter#6599
Conversation
|
| Filename | Overview |
|---|---|
| Modules/Filtering/Deconvolution/include/itkIterativeDeconvolutionImageFilter.hxx | Updates GenerateData() to preserve output-region metadata computed before execution. |
| Modules/Filtering/Deconvolution/test/CMakeLists.txt | Adds the new iterative deconvolution GTest source to the module GTest driver. |
| Modules/Filtering/Deconvolution/test/itkIterativeDeconvolutionImageFilterGTest.cxx | Adds tests for SAME and VALID output-region behavior on Landweber deconvolution. |
Reviews (1): Last reviewed commit: "BUG: Preserve OutputRegionMode in Iterat..." | Re-trigger Greptile
6b68809 to
d20ea33
Compare
|
A high-effort automated review of this branch raises design questions about the VALID-mode path that deserve author input before merge (force-push so far = plain rebase on main only). Findings (ranked)
|
GenerateData() overwrote the output region metadata with the input image's regions, after GenerateOutputInformation had already applied OutputRegionModeEnum::VALID via GetValidRegion(). PadInput/CropOutput read the output's requested region after this overwrite, so VALID mode was silently discarded for every iterative deconvolution filter. The requested region now derives from the output's own largest possible region, which already reflects the selected mode. The manual buffered-region assignment and Allocate() were redundant, since CropOutput's AllocateOutputs() call performs both. Addresses item B17 of InsightSoftwareConsortium#6575.
d20ea33 to
3343ebb
Compare
|
Force-push = plain rebase onto current main, folding the new GTest source into the |
Stop
IterativeDeconvolutionImageFilter::GenerateData()from overwriting the output region metadata thatGenerateOutputInformation()had already computed, which madeOutputRegionModea no-op. Addresses B17 of #6575.Root cause
itkIterativeDeconvolutionImageFilter.hxx:113-116:ConvolutionImageFilterBase::GenerateOutputInformation()(itkConvolutionImageFilterBase.hxx:39-45) has already shrunk the output's largest-possible region forOutputRegionModeEnum::VALIDby the timeGenerateData()runs — and these three lines overwrite it with the input's (mode-blind) regions.PadInputandCropOutput(itkFFTConvolutionImageFilter.hxx:157,:468) read the output's requested region after the overwrite, soSetOutputRegionModeToValid()was accepted and silently ignored by Landweber, ProjectedLandweber, and RichardsonLucy alike.The requested region is now derived from the output's own largest-possible region, which already reflects the selected mode. The manual buffered-region assignment and
Allocate()were redundant:CropOutput()callsAllocateOutputs(), which sets the buffered region and allocates.Local validation
New GoogleTest
itkIterativeDeconvolutionImageFilterGTest.cxx.Fail-before (
OutputRegionModeValidShrinksOutputRegion): the filter returned the full 10x10 region instead of the expected 8x8 VALID-mode region.Pass-after:
ctest -R Deconvolution(33 tests): identical results with the fix applied and reverted — the 14 legacy baseline tests fail identically in both, onExternalDataimages this offline build tree never fetched (ExternalData_URL_TEMPLATESempty in the cache), i.e. beforeGenerateData()is reached. No baseline result changed because of this fix; CI will exercise them for real.AI assistance