Commit 9e5f5df
committed
COMP: Don't let ImageToFeaturesMap output inherit the input LargestPossibleRegion
ImageToFeaturesMap is an itk::ProcessObject whose outputs are feature maps whose
size and spacing are data-dependent (decided by the model) and set in
GenerateData() by grafting the TensorToImageFilter result. The default
ProcessObject::GenerateOutputInformation() copies the primary input's geometry --
including its LargestPossibleRegion -- onto every output. When a downstream filter
re-propagates UpdateOutputInformation() up this filter (e.g. the per-channel
VectorIndexSelectionCast in InterpolateVectorImageFunction::SetInputImage), that
default resets each output's LargestPossibleRegion back to the larger input image
size while the buffer still holds the smaller feature map, so the consumer then
iterates an input-sized region over the smaller buffer and throws
'Region ... is outside of buffered region'.
Override GenerateOutputInformation() with an empty body so the grafted regions are
never clobbered. Surfaced by the Elastix IMPACT metric on static-ITK builds; the
Advanced (Elastix) and v4 (Python) metrics both consume this filter.1 parent a681247 commit 9e5f5df
2 files changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
170 | 187 | | |
171 | 188 | | |
172 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
83 | 96 | | |
84 | 97 | | |
85 | 98 | | |
| |||
0 commit comments