Commit 8e34cc0
Fix Invertd confusion with postprocessing transforms
- Modified Invertd to only invert preprocessing transforms
- When orig_key == key, limits transform_info to preprocessing transforms only
- Counts invertible transforms in preprocessing and uses only that many from applied_operations
- Fixes issue #8396 where Lambdad before Invertd caused errors
- Added test case to verify the fix
The issue occurred because Invertd would try to invert all transforms
in applied_operations, including those from postprocessing. When Lambdad
was applied in postprocessing before Invertd, it would be at the top of
the stack, causing ID mismatch errors when preprocessing transforms tried
to pop themselves.
DCO Remediation Commit for sewon.jeon <sewon.jeon@connecteve.com>
I, sewon.jeon <sewon.jeon@connecteve.com>, hereby add my Signed-off-by to this commit: 342ff38
Signed-off-by: sewon.jeon <sewon.jeon@connecteve.com>1 parent 342ff38 commit 8e34cc0
File tree
2 files changed
+9
-9
lines changed- monai/transforms/post
- tests/transforms/inverse
2 files changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
692 | | - | |
| 692 | + | |
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
| 707 | + | |
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
0 commit comments