ENH: N4 reorganization. - #62
Merged
Merged
Conversation
Rename N4 functions: ANTsImage interface becomes n4_bias_field_correction
Add an ANTsImage interface to ANTsTorch's differentiable N4 so it can be
called like ants.n4_bias_field_correction():
antstorch.n4_bias_field_correction(image, mask, shrink_factor=4, ...)
The interface converts ANTs images to tensors on the requested device,
runs the tensor engine, and returns an ANTsImage in the input geometry.
Rename the tensor engine to avoid a name clash at the antstorch level
(bspline_flows is imported after utilities and would otherwise shadow
the new interface):
bspline_flows.n4_bias_field_correction
-> bspline_flows.n4_bias_field_correction_tensor
N4BiasFieldCorrection (nn.Module) and module filenames are unchanged.
- utilities/n4_bias_field_correction.py: new ANTsImage interface
- utilities/__init__.py: export n4_bias_field_correction
- bspline_flows/{__init__,n4_bias_field_correction}.py: rename engine
- benchmark/data.py, docs tutorial, bspline_scattered_data docstring:
use n4_bias_field_correction_tensor
- tools/benchmarks/compare_n4_bias_field_correction.py: call the
ANTsImage interface; drop the local ants<->torch conversion helpers
- tests: update the bspline_flows N4 tests; add tests/utilities for the
interface (geometry preservation, bias return, mask mismatch)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rename N4 functions: ANTsImage interface becomes n4_bias_field_correction
Add an ANTsImage interface to ANTsTorch's differentiable N4 so it can be called like ants.n4_bias_field_correction():
The interface converts ANTs images to tensors on the requested device, runs the tensor engine, and returns an ANTsImage in the input geometry.
Rename the tensor engine to avoid a name clash at the antstorch level (bspline_flows is imported after utilities and would otherwise shadow the new interface):
N4BiasFieldCorrection (nn.Module) and module filenames are unchanged.