Commit 7d8e0b7
sewon.jeon
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.
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.
Signed-off-by: sewon.jeon <sewon.jeon@connecteve.com>1 parent b92b2ce commit 7d8e0b7
File tree
2 files changed
+69
-2
lines changed- monai/transforms/post
- tests/transforms/inverse
2 files changed
+69
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
| 690 | + | |
691 | 691 | | |
692 | | - | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
693 | 717 | | |
694 | 718 | | |
695 | 719 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 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 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
140 | 183 | | |
141 | 184 | | |
142 | 185 | | |
0 commit comments