-
Notifications
You must be signed in to change notification settings - Fork 128
ENH: Replace elastix ImageSpatialObject2 by ITK ImageSpatialObject #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Everything compiled well on all platforms. Only some CTest Elastix test failures on Windows ITKv5. https://dev.azure.com/kaspermarstal/Elastix/_build/results?buildId=414 Could this be just a hick up of the machine? I'll try to trigger a rebuild. |
|
looks great! Where you able to check that the registrations (with masks) return identical results? |
5b64fa7 to
39378b8
Compare
|
Just updated ITKv5 SHA at the CI system, to ensure that this commit is included: InsightSoftwareConsortium/ITK@7b4717d "BUG: Half a pixel margin ImageMaskSpatialObject::ComputeMyBoundingBox()". I certainly won't merge when any test still fails at https://dev.azure.com/kaspermarstal/Elastix ! |
|
Also, I am not sure we test registrations with a mask, so please check that we actually check for this functionality. |
|
CTest Elastix test failures on Windows ITKv5: |
6814204 to
7ceff07
Compare
|
Still not OK, after the last force-push: 1> Start 19: elastix_run_example_OUTPUT |
|
Closed and reopened, just to trigger rebuild |
|
So https://dev.azure.com/kaspermarstal/Elastix/_build/results?buildId=422 now says, for Windows ITKv5:
Details: test 92 92: Test command: C:\hostedtoolcache\windows\Python\3.6.8\x64\python.exe "D:/a/1/s/Testing/elx_compare_overlap.py" "-b" "D:/a/1/Elastix-build/Testing/TransformParameters_3DCT_lung.MI.bspline.SGD.004.txt" "-d" "D:/a/1/Elastix-build/Testing/elastix_run_3DCT_lung.MI.bspline.SGD.004" "-m" "D:/a/1/s/Testing/Data/3DCT_lung_followup_mask.mha" "-p" "D:/a/1/Elastix-build/bin/Release/elxComputeOverlap.exe" test 94 94: Test command: D:\a\1\Elastix-build\bin\Release\elxTransformParametersCompare.exe "-base" "D:/a/1/Elastix-build/Testing/TransformParameters_3DCT_lung.MI.bspline.SGD.004.txt" "-test" "D:/a/1/Elastix-build/Testing/elastix_run_3DCT_lung.MI.bspline.SGD.004/TransformParameters.0.txt" "-a" "1e-3" |
|
It appears that the differences between test results of this pull request versus the develop branch (as seen in Testing\elastix_run_3DCT_lung.MI.bspline.SGD.004\elastix.log) are gone when the following elastix/Common/itkImageMaskSpatialObject2.hxx Lines 72 to 75 in 0a87c9d
The
On the other hand, elastix elastix/Common/itkImageMaskSpatialObject2.hxx Line 326 in aa26aa5
Some very small rounding differences between the result of ITK's ITK's |
|
ok great, when with that gone, the results are identical, I have faith we have a correct implementation of the masks and bounding boxes now. Then we can go ahead with updating baselines and merging the new code. |
The check if not `GetBounds()->IsInside(point)` appears to make `ImageFullSampler` sensitive to rounding errors. These rounding errors are caused by a subtle difference between ITK's `ImageBase::TransformIndexToPhysicalPoint` (called by elastix ImageFullSampler) and ITK's `MatrixOffsetTransformBase::TransformPoint` (called by elastix ImageMaskSpatialObject2). This commit should fix issue #153 "ImageFullSampler with ImageMaskSpatialObject2 misses some pixels" Related to pull request #147 "ENH: Replace elastix ImageSpatialObject2 by ITK ImageSpatialObject"
7ceff07 to
52b1391
Compare
|
@mstaring Do you agree that this pull request (which removes the old elastix |
| #if ITK_VERSION_MAJOR < 5 | ||
|
|
||
| // First include the header file to be tested: | ||
| #include "itkImageMaskSpatialObject2.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not work anymore if this file is deleted right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @mstaring ! I think the entire ImageMaskSpatialObject2 test should be removed, unconditionally. It wasn't such an interesting test anyway. Just my first attempt to get GoogleTest working with elastix.
|
i have one comments, otherwise good to go |
|
@mstaring I would like to keep ITK4 on the dashboard until the upgrade to ITK5 is finalized. But now (with this pull request) ITK4 has two test failures: These can probably be fixed by either using the previous baseline (TransformParameters_3DCT_lung.MI.bspline.SGD.004.txt.in) for ITK4, or by just excluding these particular tests, for ITK4. Do you have a suggestion? |
|
Just exclude the test, ITK4 is not worth the trouble anymore ;-) |
52b1391 to
7c2523a
Compare
Replaced elastix specific `ImageSpatialObject2` and `ImageMaskSpatialObject2` by ITK's `ImageSpatialObject` and `ImageMaskSpatialObject`, respectively. Let azure CI build with the ITK5 version of May 9, 2019 (from ITK git master branch). Added Mask->Update() calls to `MultiResolutionRegistration::UpdateMasks`, to ensure that the bounding boxes are computed. Removed elementary GoogleTest for `ImageMaskSpatialObject2`. Removed failing 3DCT_lung.MI.bspline.SGD.004 test for ITK4 (it passes on ITK5) Part of the elastix upgrade to ITKv5.
Replaced elastix specific
ImageSpatialObject2andImageMaskSpatialObject2by ITK'sImageSpatialObjectandImageMaskSpatialObject, respectively.Let azure CI build with the ITK5 version of May 9, 2019 (from ITK git master branch).
Added Mask->Update() calls to
MultiResolutionRegistration::UpdateMasks, to ensure that the bounding boxes are computed.Part of the elastix upgrade to ITKv5.