OSCR

Understanding Trade-Offs in Continuous Neural Representations for Diffeomorphic Image Registration: A Comparative Study of Implicit Neural Representations and Neural Ordinary Differential Equations.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 107 lines · 3.8 KB · no license

  1. import torch
  2. import torch.nn.functional as F
  3. class NCC(torch.nn.Module):
  4. """
  5. NCC with cumulative sum implementation for acceleration. local (over window) normalized cross correlation.
  6. """
  7. def __init__(self, win=21, eps=1e-5):
  8. super(NCC, self).__init__()
  9. self.eps = eps
  10. self.win = win
  11. self.win_raw = win
  12. def window_sum_cs3D(self, I, win_size):
  13. half_win = int(win_size / 2)
  14. pad = [half_win + 1, half_win] * 3
  15. I_padded = F.pad(I, pad=pad, mode='constant', value=0) # [x+pad, y+pad, z+pad]
  16. # Run the cumulative sum across all 3 dimensions
  17. I_cs_x = torch.cumsum(I_padded, dim=2)
  18. I_cs_xy = torch.cumsum(I_cs_x, dim=3)
  19. I_cs_xyz = torch.cumsum(I_cs_xy, dim=4)
  20. x, y, z = I.shape[2:]
  21. # Use subtraction to calculate the window sum
  22. I_win = I_cs_xyz[:, :, win_size:, win_size:, win_size:] \
  23. - I_cs_xyz[:, :, win_size:, win_size:, :z] \
  24. - I_cs_xyz[:, :, win_size:, :y, win_size:] \
  25. - I_cs_xyz[:, :, :x, win_size:, win_size:] \
  26. + I_cs_xyz[:, :, win_size:, :y, :z] \
  27. + I_cs_xyz[:, :, :x, win_size:, :z] \
  28. + I_cs_xyz[:, :, :x, :y, win_size:] \
  29. - I_cs_xyz[:, :, :x, :y, :z]
  30. return I_win
  31. def forward(self, I, J):
  32. # compute CC squares
  33. I = I.double()
  34. J = J.double()
  35. I2 = I * I
  36. J2 = J * J
  37. IJ = I * J
  38. # compute local sums via cumsum trick
  39. I_sum_cs = self.window_sum_cs3D(I, self.win)
  40. J_sum_cs = self.window_sum_cs3D(J, self.win)
  41. I2_sum_cs = self.window_sum_cs3D(I2, self.win)
  42. J2_sum_cs = self.window_sum_cs3D(J2, self.win)
  43. IJ_sum_cs = self.window_sum_cs3D(IJ, self.win)
  44. win_size_cs = (self.win * 1.) ** 3
  45. u_I_cs = I_sum_cs / win_size_cs
  46. u_J_cs = J_sum_cs / win_size_cs
  47. cross_cs = IJ_sum_cs - u_J_cs * I_sum_cs - u_I_cs * J_sum_cs + u_I_cs * u_J_cs * win_size_cs
  48. I_var_cs = I2_sum_cs - 2 * u_I_cs * I_sum_cs + u_I_cs * u_I_cs * win_size_cs
  49. J_var_cs = J2_sum_cs - 2 * u_J_cs * J_sum_cs + u_J_cs * u_J_cs * win_size_cs
  50. cc_cs = cross_cs * cross_cs / (I_var_cs * J_var_cs + self.eps)
  51. cc2 = cc_cs # cross correlation squared
  52. # return negative cc.
  53. return 1. - torch.mean(cc2).float()
  54. def JacboianDet(J):
  55. if J.size(-1) != 3:
  56. J = J.permute(0, 2, 3, 4, 1)
  57. J = J + 1
  58. J = J / 2.
  59. scale_factor = torch.tensor([J.size(1), J.size(2), J.size(3)]).to(J).view(1, 1, 1, 1, 3) * 1.
  60. J = J * scale_factor
  61. dy = J[:, 1:, :-1, :-1, :] - J[:, :-1, :-1, :-1, :]
  62. dx = J[:, :-1, 1:, :-1, :] - J[:, :-1, :-1, :-1, :]
  63. dz = J[:, :-1, :-1, 1:, :] - J[:, :-1, :-1, :-1, :]
  64. Jdet0 = dx[:, :, :, :, 0] * (dy[:, :, :, :, 1] * dz[:, :, :, :, 2] - dy[:, :, :, :, 2] * dz[:, :, :, :, 1])
  65. Jdet1 = dx[:, :, :, :, 1] * (dy[:, :, :, :, 0] * dz[:, :, :, :, 2] - dy[:, :, :, :, 2] * dz[:, :, :, :, 0])
  66. Jdet2 = dx[:, :, :, :, 2] * (dy[:, :, :, :, 0] * dz[:, :, :, :, 1] - dy[:, :, :, :, 1] * dz[:, :, :, :, 0])
  67. Jdet = Jdet0 - Jdet1 + Jdet2
  68. return Jdet
  69. def neg_Jdet_loss(J):
  70. Jdet = JacboianDet(J)
  71. neg_Jdet = -1.0 * (Jdet - 0.5)
  72. selected_neg_Jdet = F.relu(neg_Jdet)
  73. return torch.mean(selected_neg_Jdet ** 2)
  74. def smoothloss_loss(df):
  75. return (((df[:, :, 1:, :, :] - df[:, :, :-1, :, :]) ** 2).mean() + \
  76. ((df[:, :, :, 1:, :] - df[:, :, :, :-1, :]) ** 2).mean() + \
  77. ((df[:, :, :, :, 1:] - df[:, :, :, :, :-1]) ** 2).mean())
  78. def magnitude_loss(all_v):
  79. all_v_x_2 = all_v[:, :, 0, :, :, :] * all_v[:, :, 0, :, :, :]
  80. all_v_y_2 = all_v[:, :, 1, :, :, :] * all_v[:, :, 1, :, :, :]
  81. all_v_z_2 = all_v[:, :, 2, :, :, :] * all_v[:, :, 2, :, :, :]
  82. all_v_magnitude = torch.mean(all_v_x_2 + all_v_y_2 + all_v_z_2)
  83. return all_v_magnitude

Loss.py at commit fb01066, no license · at the source

Overview

Authors: Salvador Rodriguez-Sanz1,2, Carlos Paesa-Lia1,2, Monica Hernandez1,2
  1. Aragon Institute of Engineering Research (I3A), University of Zaragoza (UZ), 50018 Zaragoza, Spain; (S.R.-S.); (C.P.-L.)
  2. Computer Science and Systems Engineering Department, University of Zaragoza (UZ), 50018 Zaragoza, Spain
Journal: Journal of imaging, volume 12, issue 8, article 384
Dates: received 1 July 2026; accepted 4 August 2026; published online 14 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3390/jimaging12080384 · PMID 42645983 · PMCID PMC13514420 · OpenAlex W7203478090
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: systems (subfield)
Methods: Connectivity, Statistics
Keywords: Large Deformation Diffeomorphic Metric Mapping (LDDMM), diffeomorphic image registration, implicit neural representations (INRs), neural ordinary differential equations (NODEs), neural representations, continuous transformation modeling
Topic: Medical Image Segmentation Techniques (Computer Vision and Pattern Recognition, Computer Science), according to OpenAlex
Funding: Gobierno de Aragón (T64_23R, ECU/1871/2023, PROY_B50_24); European Union (CLASiK - PCI2025-167187-2); Instituto de Salud Carlos III (RD24/0007/0022); European Union Satellite Centre (HORIZON-MSCA-2024-SE-01 G.A. 10123661); Ministerio de Ciencia Innovación y Universidades (PID2023-148219OB-C22, PID2022-138703OB-I00)
Citations: not cited yet (Europe PMC); 42 references in the paper

Abstract

Non-rigid image registration is a fundamental problem in medical imaging and a representative example of continuous transformation modeling in image processing. Diffeomorphic registration methods, such as Large Deformation Diffeomorphic Metric Mapping (LDDMM) and its PDE-constrained variants (PDE-LDDMM), provide mathematically grounded formulations with strong geometric guarantees for transformation quality. However, existing approaches face persistent trade-offs between numerical stability, accuracy, and computational efficiency. Recent work has explored implicit neural representations (INRs) and neural ordinary differential equations (NODEs) as flexible neural representations for modeling continuous transformations. Despite their increasing adoption, their practical behavior and limitations in diffeomorphic registration remain insufficiently understood. In this paper, we present a unified formulation of INR- and NODE-based registration methods within LDDMM and PDE-LDDMM, enabling a systematic and controlled comparison across architectures, sampling strategies, and numerical solvers. Our analysis reveals fundamental trade-offs between these approaches. In particular, we show that MLP-based INR formulations introduce significant computational overhead and rely on sampling strategies that can degrade smoothness and lead to the increased occurrence of non-diffeomorphic transformations at higher resolutions. Moreover, these approximations do not fully alleviate the computational cost, with some variants exceeding the costs of expensive classical optimization-based methods. In contrast, NODE-based formulations and downsampling strategies consistently provide transformations with more controlled Jacobian extrema while maintaining competitive computational performance. Among the evaluated methods, the original NODE-LDDMM and NODE-PDE-LDDMM formulations achieve the most favorable trade-offs between registration accuracy, geometric consistency, and computational efficiency. These findings provide clear insights into the design of neural representations for continuous transformation modeling, with practical implications for diffeomorphic registration and computational anatomy applications.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above.

yifannnwu/NODEO-DIR

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: fb010664d02ca6c6bca01c0f50f2de17f61d23ed, 4 February 2024
Languages: Python (5)
Size: 10 files, 5 scripts
Software Heritage: not archived
Found in: the text, “5.3. Implementation Details and Parameters”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (4 files), NumPy (3 files), NiBabel (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
6 files

MIAGroupUT/IDIR

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 9ab3ccfbbf09dc8fc65fa848332e7d9a0b3b81b3, 23 March 2022
Languages: Python (12)
Size: 21 files, 12 scripts
Software Heritage: not archived
Found in: the text, “5.3. Implementation Details and Parameters”
Holds: README, license file, environment (environment.yml), continuous integration
Not found: CITATION.cff, tests, documentation
Tools: PyTorch (5 files), NumPy (2 files), SimpleITK (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
14 files

BrainImageAnalysis/INRsRegExp

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 74036e2b761b252375dfda40dca3fd6bfa19deaa, 5 December 2023
Languages: Python (5), Jupyter (2)
Size: 16 files, 7 scripts
Software Heritage: not archived
Found in: the text, “5.3. Implementation Details and Parameters”
Holds: README, license file, 2 notebooks
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (6 files), PyTorch (6 files), Matplotlib (3 files), NiBabel (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
9 files

mhglddmm/INRvsNODE_LDDMM

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: cc9b0536f74f33bc05dab0d46abe76c994ed6e11, 28 July 2026
Size: 1 file, 0 scripts
Software Heritage: not archived
Found in: “Data Availability Statement”
Holds: license file
Not found: README, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
1 file

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 4 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 24 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data Availability Statement

The NIREP dataset is publicly available through the repository maintained by Andreas Mang https://github.com/andreasmang/nirep (accessed on 3 August 2026). Additional information regarding the Non-rigid Image Registration Evaluation Project (NIREP) can be found at https://www.nitrc.org/projects/nirep/ (accessed on 3 August 2026). The OASIS Learn2Reg dataset is publicly available through the Learn2Reg challenge website https://learn2reg.grand-challenge.org/Learn2Reg2021 (accessed on 3 August 2026). The main experimental results generated in this work will be made publicly available through a public data repository upon acceptance of the manuscript. The source code used in this study, together with the documentation required to reproduce the main experiments, will be made publicly available upon acceptance of the manuscript at https://github.com/mhglddmm/INRvsNODE_LDDMM (accessed on 3 August 2026).

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 6 keywords, 5 funders, 38 references.

Cite

This paper

Rodriguez-Sanz, S., Paesa-Lia, C., & Hernandez, M. (2026). Understanding Trade-Offs in Continuous Neural Representations for Diffeomorphic Image Registration: A Comparative Study of Implicit Neural Representations and Neural Ordinary Differential Equations. Journal of imaging, 12(8), 384. https://doi.org/10.3390/jimaging12080384

BibTeX

@article{rodriguezsanz2026understanding,
author = {Rodriguez-Sanz, Salvador and Paesa-Lia, Carlos and Hernandez, Monica},
title = {{Understanding Trade-Offs in Continuous Neural Representations for Diffeomorphic Image Registration: A Comparative Study of Implicit Neural Representations and Neural Ordinary Differential Equations}},
journal = {Journal of imaging},
year = {2026},
month = aug,
volume = {12},
number = {8},
pages = {384},
publisher = {Multidisciplinary Digital Publishing Institute (MDPI)},
issn = {2313-433X},
doi = {10.3390/jimaging12080384},
url = {https://doi.org/10.3390/jimaging12080384},
pmid = {42645983},
pmcid = {PMC13514420}
}

RIS

TY - JOUR
AU - Rodriguez-Sanz, Salvador
AU - Paesa-Lia, Carlos
AU - Hernandez, Monica
TI - Understanding Trade-Offs in Continuous Neural Representations for Diffeomorphic Image Registration: A Comparative Study of Implicit Neural Representations and Neural Ordinary Differential Equations
T2 - Journal of imaging
J2 - J Imaging
PY - 2026
DA - 2026/08/14
VL - 12
IS - 8
SP - 384
SN - 2313-433X
PB - Multidisciplinary Digital Publishing Institute (MDPI)
DO - 10.3390/jimaging12080384
UR - https://doi.org/10.3390/jimaging12080384
LA - en
ER -

CSL-JSON

{
"id": "10.3390/jimaging12080384",
"type": "article-journal",
"title": "Understanding Trade-Offs in Continuous Neural Representations for Diffeomorphic Image Registration: A Comparative Study of Implicit Neural Representations and Neural Ordinary Differential Equations",
"container-title": "Journal of imaging",
"author": [
{
"family": "Rodriguez-Sanz",
"given": "Salvador"
},
{
"family": "Paesa-Lia",
"given": "Carlos"
},
{
"family": "Hernandez",
"given": "Monica"
}
],
"container-title-short": "J Imaging",
"volume": "12",
"issue": "8",
"page": "384",
"DOI": "10.3390/jimaging12080384",
"PMID": "42645983",
"PMCID": "PMC13514420",
"ISSN": "2313-433X",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"URL": "https://doi.org/10.3390/jimaging12080384",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
14
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1371/journal.pdig.0001339 [code]
An effective deep learning algorithm for medical image registration.
Journal: PLOS digital health
In common: NiBabel, PyTorch, SciPy, 1 other tool, 9 references
[2] doi:10.3390/jimaging12070276 [code]
Hyperelastic Regularization for Near-Diffeomorphic Transformer-Based Brain MRI Registration.
Journal: Journal of imaging
In common: SimpleITK, NiBabel, PyTorch, 3 other tools, 7 references
[3] doi:10.1016/j.isci.2026.117446 [code]
Volume-inflation registration (INFREG) for morphometric analysis of human focal cortical dysplasia type II.
Journal: iScience
In common: SimpleITK, NiBabel, PyTorch, 3 other tools, 3 references
[4] doi:10.2463/mrms.mp.2024-0149 [code]
Image Distortion Correction for Diffusion MR Imaging Using a Transformer-based U-Net.
Journal: Magnetic resonance in medical sciences : MRMS : an official journal of Japan Society of Magnetic Resonance in Medicine
In common: NiBabel, PyTorch, SciPy, 2 other tools, 2 references
[5] doi:10.1002/advs.76596 [code]
DDSurfer: A Weakly-Supervised Dual-Stream Deep Learning Framework for Cortical Surface Reconstruction From Diffusion MRI.
Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)
In common: SimpleITK, NiBabel, PyTorch, 2 other tools, 1 reference
[6] doi:10.1162/imag.a.1366 [code]
MICAFlow: Fast and robust MRI preprocessing bridging research neuroimaging and clinical practice.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: NiBabel, PyTorch, SciPy, 2 other tools, 2 references
[7] doi:10.1038/s41467-026-76011-7 [code]
Human cortex organizes dynamic co-fluctuations along the sensorimotor-association axis.
Journal: Nature communications
In common: SimpleITK, NiBabel, PyTorch, 3 other tools, systems
[8] doi:10.1007/s12021-026-09817-x [code]
Circle of Willis-Guided Localization for Simultaneous Detection and Classification of Large Vessel Occlusions in Brain CTA.
Journal: Neuroinformatics
In common: SimpleITK, NiBabel, PyTorch, 3 other tools
[9] doi:10.1002/hipo.70124 [code]
Association Between Anterior Hippocampal Gyrification and Episodic Memory Performance in Neurotypical Young Adults.
Journal: Hippocampus
In common: SimpleITK, NiBabel, PyTorch, 3 other tools
[10] doi:10.3390/jcm15176501 [code]
Saliency-Curated Deep Learning for Predicting Receptor Status in Breast Cancer Brain Metastases.
Journal: Journal of clinical medicine
In common: SimpleITK, NiBabel, PyTorch, 3 other tools

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.