Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] Cannot specify non-default interpolator for ANTsRegistrator

Open
#177 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Start at the ANTsRegistrator entry point and trace how transformation_params reaches the registration call, using the provided reproduction with interpolator set to linear. Confirm the duplicate interpolator argument is removed and that registration completes while honoring the requested interpolator; add or run a regression test if the project has one.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
Specifying transformation_params={'interpolator': 'linear'} when instantiating ANTsRegistrator results in a Type Error when performing registration.

TypeError: ants.registration.apply_transforms.apply_transforms() got multiple values for keyword argument 'interpolator'

To Reproduce

from brainles_preprocessing.brain_extraction import HDBetExtractor
from brainles_preprocessing.constants import Atlas
from brainles_preprocessing.modality import Modality, CenterModality
from brainles_preprocessing.preprocessor import (
    AtlasCentricPreprocessor,
)
from brainles_preprocessing.registration import ANTsRegistrator
from brainles_preprocessing.n4_bias_correction import SitkN4BiasCorrector

center_params = {} #your center modality params here
center_modality = CenterModality(**center_params)

mod1_params = {} #your modality 1 params here
modality_1 = Modality(**mod1_params)

mod2_params = {} #your modality 2 params here
modality_2 = Modality(**mod2_params)

mod3_params = {} #your modality 3 params here
modality_3 = Modality(**mod3_params)

modalities = [modality_1, modality_2, modality_3]

preprocessor = AtlasCentricPreprocessor(
    center_modality=center_modality,
    moving_modalities=modalities,
    registrator=ANTsRegistrator(transformation_params={'interpolator': 'linear'}),
    brain_extractor=HDBetExtractor(),
    n4_bias_corrector=SitkN4BiasCorrector(),
    atlas_image_path=Atlas.BRATS_MNI152,
)
preprocessor.run()

Expected behavior
No error is raised as the ability to specify the interpolator is an expected feature.

Environment

operating system and version?

python 3.12 on debian bookworm container.

NVIDIA drivers and GPUs
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.126.18             Driver Version: 580.126.18     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3060        Off |   00000000:08:00.0  On |                  N/A |
|  0%   45C    P8             20W /  170W |    2478MiB /  12288MiB |     49%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

Python environment and version?

python 3.12 on debian bookworm container

version of brainles_preprocessing ?

0.6.10

Dominant language
C
Stars
39
Forks
11
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BrainLesion/preprocessing

All issues in BrainLesion/preprocessing

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.