You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] ANTsRegistrator resamples MRI modalities with nearest-neighbor interpolation by default #192
As a result, every resampling step in AtlasCentricPreprocessor.run (coregistration to the center modality, atlas registration incl. the combined coregistration+atlas transform, atlas correction) resamples the MRI modalities with nearest neighbor.
There currently seems to be no supported way to change this from the user side: passing ANTsRegistrator(transformation_params={"interpolator":"linear"}) fails with "TypeError: apply_transforms() got multiple values for keyword argument 'interpolator'" because transform forwards interpolator=interpolator, **transform_kwargs to ants.apply_transforms (ANTs.py:217). The only workaround is subclassing ANTsRegistrator and overriding the default of transform.
Suggested fix: default interpolator to "linear" in ANTsRegistrator.transform (and inverse_transform), and let Modality.register / Modality.transform pass an interpolator.
Reproducibility
import tempfile
from pathlib import Path
import ants
import numpy as np
from brainles_preprocessing.registration import ANTsRegistrator
Suggested fix: default interpolator to "linear" in ANTsRegistrator.transform (and inverse_transform), and let Modality.register / Modality.transform pass an interpolator.
sounds good to me, can you please submit a PR @LMZimmer
Activity
neuronflow commentedon Sep 17, 2026
ohhh sweet! this might be the reason why ANTs produces such weird results for our low resolution input scans @ErikGro ! nice catch @LMZimmer
neuronflow commentedon Sep 17, 2026
@MarcelRosier can you have a look please?
neuronflow commentedon Sep 17, 2026
sounds good to me, can you please submit a PR @LMZimmer
LMZimmer commentedon Sep 17, 2026
Ill submit one tomorrow 👍