GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [BUG] Cannot specify non-default interpolator for ANTsRegistrator · Issue #177 · BrainLesion/preprocessing

[BUG] Cannot specify non-default interpolator for ANTsRegistrator #177

New issue
Copy link
New issue
Copy link
Open
#178
Open
[BUG] Cannot specify non-default interpolator for ANTsRegistrator#177
#178
Copy link
Labels
bugSomething isn't working

Description

@raph-rc
raph-rc
opened on Mar 25, 2026
Issue body actions

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

Activity

  1. raph-rc
    added
    bugSomething isn't working
    on Mar 25, 2026
  2. raph-rc commented on Mar 25, 2026

    @raph-rc
    raph-rc
    on Mar 25, 2026
    Author
    More actions

    issue seems to arise from here. Passing the default interpolator only if transform_kwargs does not contain it would be best. Alternatively, something like

    if 'interpolator' not in transform_kwargs:
        transform_kwargs['interpolator'] = interpolator
    
    transformed_image = ants.apply_transforms(
        fixed=fixed_image,
        moving=moving_image,
        transformlist=matrix_path, #removing the interpolator=interpolator argument as it is contained in transform_kwarg 
        **transform_kwargs,
    )
    

    should also work. Happy to submit a PR if needed.

    Reacted by neuronflow
  3. neuronflow commented on Mar 25, 2026

    @neuronflow
    neuronflow
    on Mar 25, 2026
    Collaborator
    More actions

    @MarcelRosier could you have a look please?

  4. neuronflow commented on Mar 25, 2026

    @neuronflow
    neuronflow
    on Mar 25, 2026
    Collaborator
    More actions

    should also work. Happy to submit a PR if needed.

    contributions are always welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.