Commit 619446c
committed
BUG: Remove shadow declarations in RGBGibbsPriorFilter
RGBGibbsPriorFilter declared its own m_NumberOfClasses and
m_MaximumNumberOfIterations that shadowed identically-named members
in the base MRFImageFilter. Set/Get accessors were hand-written
overrides whose only purpose was to direct `this->m_*` at the
subclass shadow.
Virtual dispatch made the shadow work correctly through the public
API, but every instance carried two orphaned 8-byte fields and any
future MRFImageFilter method that reads m_NumberOfClasses or
m_MaximumNumberOfIterations directly would silently see stale
defaults for RGBGibbsPriorFilter instances.
Remove the shadow declarations and the 4 redundant accessor
overrides. Preserve the subclass-specific default
MaximumNumberOfIterations=10 (vs base default 50) by calling the
inherited setter from the constructor. Drop two PrintSelf lines that
duplicated output from Superclass::PrintSelf.
GTest suite from the preceding commit confirms zero observable API
change: defaults, Set/Get round-trip via subclass and base pointer,
and MTime semantics all match the pre-fix behavior.1 parent 6a99058 commit 619446c
2 files changed
Lines changed: 2 additions & 48 deletions
File tree
- Modules/Segmentation/MarkovRandomFieldsClassifiers/include
Lines changed: 0 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 133 | | |
173 | 134 | | |
174 | 135 | | |
| |||
252 | 213 | | |
253 | 214 | | |
254 | 215 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | 216 | | |
262 | 217 | | |
263 | 218 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
686 | | - | |
687 | | - | |
688 | 687 | | |
689 | 688 | | |
690 | 689 | | |
| |||
0 commit comments