SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.08373 · 2025

nnInteractive: Redefining 3D Promptable Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2503.08373.json · badge: /api/ran/2503.08373.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
mic-dkfz/nninteractive canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
mic-dkfz/napari-nninteractive canonical (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
coendevente/nninteractive-slicer community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
bbox Ran
ran on a synthesized input
coendevente/nninteractive-slicer/slicer_plugin/SlicerNNInteractive/Testing/Python/SlicerNNInteractiveSegmentationTest.py
code served (permissive licence) · get_code("86ce0a7887fb9dc4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Define ARGS dict with all parameters for the bbox function
ARGS = {
    'coords_one': [10, 20],
    'coords_two': [30, 40],
    'positive': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ensure_synched Ran
ran on a synthesized input
coendevente/nninteractive-slicer/slicer_plugin/SlicerNNInteractive/SlicerNNInteractive.py
code served (permissive licence) · get_code("67adb1cb306d8b9d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Build a minimal mock class that satisfies the decorator's usage patterns
class MockInteractiveSession:
    SESSION_LOST_ERRORS = (RuntimeError, ValueError)
    
    def __init__(self):
        self._prediction_in_flight = False
        self._last_image = None
        self._last_segment = None
        self._session_active = True
        self._session_layers = {'layer_1': Mock(), 'layer_2': Mock()}
    
    def ensure_session(self):
        """Ensure a working session exists"""
        return self._session_active
    
    def _check_session_layers_present(self):
        """Check if all expected layers are present; return list of missing"""
        return []
    
    def _handle_deleted_session_layers(self, missing_layers):
        """Handle missing layers"""
        pass
    
    def _handle_active_source_volume_change(self):
        """Check if source volume changed; return True if changed"""
        return False
    
    def image_changed(self):
        """Check if image has changed or not previously set"""
        current_image = torch.randn(2, 4)
        changed = self._last_image is None or not torch.equal(self._last_image, current_image)
        self._last_image = current_image
        return changed
    
    def sync_image_to_session(self):
        """Sync image to session; return True on success"""
        return True
    
    def selected_segment_changed(self):
        """Check if selected segment changed or not previously set"""
        current_segment = torch.randint(0, 2, (2, 4))
        changed = self._last_segment is None or not torch.equal(self._last_segment, current_segment)
        self._last_segment = current_segment
        return changed
    
    def remove_all_but_last_prompt(self):
        """Remove all but the last prompt"""
        pass
    
    def sync_segment_to_session(self):
        """Sync segment to session"""
        pass
    
    def handle_session_expired(self, exc):
        """Handle session expiration"""
        pass


def ensure_synched(func):
    """
    Decorator that ensures a working nnInteractive session exists and that the
    image and segment are synced to it before calling the actual prompt function.
    """

    def inner(self, *args, **kwargs):
        if getattr(self, '_prediction_in_flight', False):
            return
        if not self.ensure_session():
            return
        missing_layers = self._check_session_layers_present()
        if missing_layers:
            self._handle_deleted_session_layers(missing_layers)
            return
        try:
            t0 = 0
            if self._handle_active_source_volume_change():
                pass
            t1 = 0
            if self.image_changed():
                if not self.sync_image_to_session():
                    return
            t2 = 0
            if self.selected_segment_changed():
                self.remove_all_but_last_prompt()
                self.sync_segment_to_session()
            else:
                pass
            t3 = 0
            result = func(self, *args, **kwargs)
            t4 = 0
            return result
        except self.SESSION_LOST_ERRORS as exc:
            self.handle_session_expired(exc)
            return
    return inner


# Create an instance and a decorated method
session = MockInteractiveSession()

@ensure_synched
def dummy_prompt_function(self, prompt_text):
    """A simple prompt function to be decorated"""
    return f"Result: {prompt_text}"

# Bind the method to the instance
session.dummy_prompt_function = dummy_prompt_function.__get__(session, MockInteractiveSession)

ARGS = {
    'func': dummy_prompt_function,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
infer_num_interaction_channels_from_mapping Ran
ran, honoured the contract we drafted
mic-dkfz/nninteractive/nnInteractive/utils/inference_helpers.py
code served (permissive licence) · get_code("1753045630de2952")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function: infer_num_interaction_channels_from_mapping
# It takes a channel_mapping dict and iterates through it
# For each key-value pair:
#   - if key is 'prev_seg', it treats v as a single int
#   - otherwise, it calls parse_channel_pair(k, v) which expects v to be a pair [pos, neg]
# It tracks max positive index and max negative magnitude
# Returns the max of (max_positive_index + 1, max_negative_magnitude, 1)

# Create a valid channel_mapping dict
channel_mapping = {
    'prev_seg': 2,  # Single index for prev_seg
    'interaction_1': [3, -1],  # Positive channel 3, negative channel -1
    'interaction_2': [5, -4],  # Positive channel 5, negative channel -4
}

ARGS = {
    'channel_mapping': channel_mapping
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
left_button_only Ran
ran on a synthesized input
mic-dkfz/napari-nninteractive/src/napari_nninteractive/mouse_bindings.py
code served (permissive licence) · get_code("af5dbe64a8f484b8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# Create a simple callback function that the wrapper will receive
def simple_callback(layer, event):
    """A basic callback that does something with layer and event."""
    return "callback executed"

# Create a mock event object with button attribute
class MockEvent:
    def __init__(self, button='left'):
        self.button = button

# Create a mock layer object
class MockLayer:
    def __init__(self):
        self.data = torch.randn(2, 4)

# Set up arguments for left_button_only function
ARGS = {
    'callback': simple_callback
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
negative Ran
ran on a synthesized input
coendevente/nninteractive-slicer/slicer_plugin/SlicerNNInteractive/Testing/Python/SlicerNNInteractiveSegmentationTest.py
code served (permissive licence) · get_code("0e039536283a75f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'coords': [1, 2, 3, 4]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_channel_pair Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mic-dkfz/nninteractive/nnInteractive/utils/inference_helpers.py
code served (permissive licence) · get_code("35893934de5bfe1f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import Tuple

torch.manual_seed(0)

# The function parse_channel_pair takes:
# 1. channel_name: str - a string identifier for the channel
# 2. raw_channels: a tuple or list with exactly 2 elements that can be converted to int

ARGS = {
    "channel_name": "audio_channel_1",
    "raw_channels": [0, 1]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
positive Ran
ran on a synthesized input
coendevente/nninteractive-slicer/slicer_plugin/SlicerNNInteractive/Testing/Python/SlicerNNInteractiveSegmentationTest.py
code served (permissive licence) · get_code("d844a7a70ed449b0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'coords': [1, 2, 3]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
version_to_tuple Ran
ran, honoured the contract we drafted
mic-dkfz/nninteractive/nnInteractive/utils/inference_helpers.py
code served (permissive licence) · get_code("7c31678ef62901a0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
from typing import Tuple

def version_to_tuple(version: str) -> Tuple[int, ...]:
    return tuple((int(i) for i in re.findall('\\d+', version)))

ARGS = {
    "version": "1.2.3"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
torch_compile_unsupported_reason Not yet run
unverified (harvested, no recorded run)
coendevente/nninteractive-slicer/slicer_plugin/SlicerNNInteractive/SlicerNNInteractive.py
code served (permissive licence) · get_code("7f5eaa04a2e1d50d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Accurate and efficient 3D segmentation is essential for both clinical and research applications. While foundation models like SAM have revolutionized interactive segmentation, their 2D design and domain shift limitations make them ill-suited for 3D medical images. Current adaptations address some of these challenges but remain limited, either lacking volumetric awareness, offering restricted interactivity, or supporting only a small set of structures and modalities. Usability also remains a challenge, as current tools are rarely integrated into established imaging platforms and often rely on cumbersome web-based interfaces with restricted functionality. We introduce nnInteractive, the first comprehensive 3D interactive open-set segmentation method. It supports diverse prompts-including points, scribbles, boxes, and a novel lasso prompt-while leveraging intuitive 2D interactions to generate full 3D segmentations. Trained on 120+ diverse volumetric 3D datasets (CT, MRI, PET, 3D Microscopy, etc.), nnInteractive sets a new state-of-the-art in accuracy, adaptability, and usability. Crucially, it is the first method integrated into widely used image viewers (e.g., Napari, MITK), ensuring broad accessibility for real-world clinical and research applications. Extensive benchmarking demonstrates that nnInteractive far surpasses existing methods, setting a new standard for AI-driven interactive 3D segmentation. nnInteractive is publicly available: https://github.com/MIC-DKFZ/napari-nninteractive (Napari plugin), https://www.mitk.org/MITK-nnInteractive (MITK integration), https://github.com/MIC-DKFZ/nnInteractive (Python backend).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2503.08373")
get_code_for_paper("2503.08373")
have("2503.08373")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2503.08373.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2503.08373.svg)](https://syntology.ai/paper/2503.08373)

Connect an agent — have() is free.