Commit c96f026
committed
BUG: Fix ElastixRegistrationMethod GetNumberOfTransforms GetNthTransform
ElastixRegistrationMethod member functions `GetNumberOfTransforms`, `GetNthTransform`, and `GetCombinationTransform` did always just return zero or null, erroneously, when the pixel type of the input images (specified by `TFixedImage` and `TMovingImage`) would be different from the internal pixel type (specified by "FixedInternalImagePixelType" and "MovingInternalImagePixelType", `float` by default). The code incorrectly assumed that the objects stored in the ElastixBase `TransformContainer` are always of type `elx::TransformBase<ElastixTemplate<TFixedImage, TMovingImage>>`.
This commit just assumes that the objects stored in `TransformContainer` are of type `AdvancedCombinationTransform<double, FixedImageDimension>`.
The commit aims to fix issue #965 "ElastixRegistrationMethod GetNumberOfTransforms, GetCombinationTransform, etc. does not work with non-float ImageType", reported by Matt McCormick.
Extended the GoogleTest `itkElastixRegistrationMethod.CheckMinimumMovingImageUsingAnyInternalPixelType` unit test to check this issue.1 parent 03bf078 commit c96f026
3 files changed
Lines changed: 32 additions & 36 deletions
File tree
- Core/Main
- GTesting
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2306 | 2306 | | |
2307 | 2307 | | |
2308 | 2308 | | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
2309 | 2312 | | |
2310 | 2313 | | |
2311 | 2314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
376 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
| 982 | + | |
| 983 | + | |
993 | 984 | | |
994 | 985 | | |
995 | 986 | | |
996 | 987 | | |
997 | 988 | | |
998 | 989 | | |
999 | 990 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
1006 | 994 | | |
1007 | | - | |
1008 | | - | |
1009 | 995 | | |
1010 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
1011 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
1012 | 1013 | | |
1013 | 1014 | | |
1014 | | - | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
| 1022 | + | |
1036 | 1023 | | |
1037 | 1024 | | |
1038 | 1025 | | |
| |||
0 commit comments