Skip to content

Commit 2f717e0

Browse files
committed
initial joss draft
1 parent ed7e8ad commit 2f717e0

File tree

2 files changed

+169
-0
lines changed

2 files changed

+169
-0
lines changed

joss/nt.bib

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@article{cox_software_1997,
2+
author = {Cox, Robert W. and Hyde, James S.},
3+
copyright = {Copyright © 1997 John Wiley \& Sons, Ltd.},
4+
doi = {10.1002/(SICI)1099-1492(199706/08)10:4/5{ extless}171::AID-NBM453{ extgreater}3.0.CO;2-L},
5+
issn = {1099-1492},
6+
journal = {NMR Biomed},
7+
language = {en},
8+
number = {4-5},
9+
pages = {171-178},
10+
title = {Software tools for analysis and visualization of fMRI data},
11+
url = {http://onlinelibrary.wiley.com/doi/10.1002/(SICI)1099-1492(199706/08)10:4/5{ extless}171::AID-NBM453{ extgreater}3.0.CO;2-L/abstract},
12+
volume = 10,
13+
year = 1997
14+
}
15+
16+
@article{brett_nibabel_2006,
17+
author = {Brett, Matthew and Markiewicz, Christopher J. and Hanke, Michael and Cote, Marc-Alexandre and Cipollini, Ben and McCarthy, Paul and Cheng, Chris and Halchenko, Yaroslav O. and Ghosh, Satrajit S. and Larson, Eric and Wassermann, Demian and Gerhard, Stephan},
18+
doi = {10.5281/zenodo.591597},
19+
journal = {Zenodo},
20+
pages = 3458246,
21+
title = {{Open Source Software: NiBabel}},
22+
url = {https://zenodo.org/record/3458246\#.XaS82-ZKi5M},
23+
year = 2006
24+
}
25+
26+
@article{fischl_freesurfer_2012,
27+
author = {Fischl, B.},
28+
doi = {10.1016/j.neuroimage.2012.01.021},
29+
issn = {1053-8119},
30+
journal = {NeuroImage},
31+
number = 2,
32+
pages = {774-781},
33+
title = {{FreeSurfer}},
34+
url = {http://www.sciencedirect.com/science/article/pii/S1053811912000389},
35+
volume = 62,
36+
year = 2012
37+
}
38+
39+
@article{jenkinson_fsl_2012,
40+
author = {Jenkinson, Mark and Beckmann, Christian F. and Behrens, Timothy E.J. and Woolrich, Mark W. and Smith, Stephen M.},
41+
doi = {10.1016/j.neuroimage.2011.09.015},
42+
issn = {1053-8119},
43+
journal = {NeuroImage},
44+
number = 2,
45+
pages = {782-790},
46+
shorttitle = {FSL},
47+
title = {{FSL}},
48+
url = {http://www.sciencedirect.com/science/article/pii/S1053811911010603},
49+
volume = 62,
50+
year = 2012
51+
}

joss/paper.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
title: 'Nitransforms: A Python tool to read, represent, manipulate, and apply $n$-dimensional spatial transforms'
3+
tags:
4+
- Python
5+
- neuroimaging
6+
- image processing
7+
- spatial transform
8+
- nibabel
9+
authors:
10+
- name: Mathias Goncalves
11+
orcid: 0000-0002-7252-7771
12+
affiliation: 1
13+
- name: Christopher J. Markiewicz
14+
orcid: 0000-0002-6533-164X
15+
affiliation: "1, 2"
16+
- name: Satrajit S. Ghosh
17+
orcid: 0000-0002-5312-6729
18+
affiliation: "2, 3"
19+
- name: Russell A. Poldrack
20+
orcid: 0000-0001-6755-0259
21+
affiliation: 1
22+
- name: Oscar Esteban
23+
orcid: 0000-0001-8435-6191
24+
affiliation: 1
25+
affiliations:
26+
- name: Department of Psychology, Stanford University, Stanford, CA, USA
27+
index: 1
28+
- name: McGovern Institute for Brain Research, Massachusetts Institute of Technology (MIT), Cambridge, MA, USA
29+
index: 2
30+
- name: Department of Otolaryngology, Harvard Medical School, Boston, MA, USA
31+
index: 3
32+
date: 04 November 2019
33+
bibliography: nt.bib
34+
---
35+
36+
# Summary
37+
38+
Spatial transforms formalize mappings between coordinates of objects in
39+
biomedical images. Transforms typically are the outcome of image registration
40+
methodologies, which estimate the alignment between two images. Image
41+
registration is a prominent task present in image processing. In neuroimaging,
42+
the proliferation of image registration software implementations has resulted
43+
in a disparate collection of structures and file formats used to preserve and
44+
communicate the transformation. This assortment of formats presents the
45+
challenge of compatibility between tools and endangers the reproducibility of
46+
results.
47+
48+
`nitransforms` is a Python tool capable of reading and writing tranforms
49+
produced by the most popular neuroimaging software (AFNI [-@cox_software_1997],
50+
FSL [-@jenkinson_fsl_2012], FreeSurfer [-@fischl_freesurfer_2012], ITK, and SPM).
51+
Additionally, the tool provides seamless conversion between these formats, as
52+
well as the ability of applying the transforms to other images. `nitransforms`
53+
is inspired by `NiBabel` [@brett_nibabel_2006], a Python package with a
54+
collection of tools to read, write and handle neuroimaging data, and will be
55+
included as a new module.
56+
57+
58+
# Software Architecture
59+
60+
There are four main components within the tool: an `io` submodule to handle
61+
the structure of the various file formats, a `base` submodule where abstract
62+
classes are defined, a `linear` submodule implementing $n$-dimensional linear
63+
transforms, and a `nonlinear` submodule for both parametric and non-parametric
64+
nonlinear transforms. Furthermore, `nitranforms` provides a straightforward
65+
API (Application Programming Interface) that allows researchers to map point
66+
sets via transforms, as well as apply transforms (i.e., mapping the coordinates
67+
and interpolating the data) to data structures with ease.
68+
69+
To ensure the consistency and uniformity of internal operations, all transforms
70+
are defined using a left-handed coordinate system of physical coordinates. In
71+
words from the neuroimaging domain, the coordinate system of transforms is
72+
_RAS+_ (or positive directions point to the Righthand for the first axis,
73+
Anterior for the second, and Superior for the third axis). The internal
74+
representation of transform coordinates is the most relevant design decision,
75+
and implies that a conversion of coordinate system is necessary to correctly
76+
interpret transforms generated by other software. When a transform that is
77+
defined in another coordinate system is loaded, it is automatically converted
78+
into _RAS+_ space.
79+
80+
`nitransforms` was developed using a test-driven development paradigm, with the
81+
battery of tests being written prior to the software implementations. Two
82+
categories of tests were used: unit tests and cross-tool comparison tests. Unit
83+
tests evaluate the formal correctness of the implementation, while cross-tool
84+
comparison tests assess the correct implementation of third-party software.
85+
The testing suite is incorporated into a continuous integration framework, which
86+
assesses the continuity of the implementation along the development life and
87+
ensures that code changes and additions do not break existing functionalities.
88+
89+
# Spatial transforms
90+
91+
Let $\vec{x}$ represent the coordinates of a point in the reference coordinate
92+
system $R$, and $\vec{x}'$ its projection on to another coordinate system $M$:
93+
94+
$T\colon R \subset \mathbb{R}^n \to M \subset \mathbb{R}^n$
95+
96+
$\vec{x} \mapsto \vec{x}' = f(\vec{x}).$
97+
98+
In an image registration problem, $M$ is a moving image from which we want to
99+
sample data in order to bring the image into spatial alignment with the
100+
reference image $R$. Hence, $f$ here is the spatial transformation function
101+
that maps from coordinates in $R$ to coordinates in $M$. There are a
102+
multiplicity of image registration algorithms and corresponding image
103+
transformation models to estimate linear and nonlinear transforms.
104+
105+
The problem has been traditionally confused by the need of _transforming_ or
106+
mapping one image (generally referred to as _moving_) into another that serves
107+
as reference, with the goal of _fusing_ the information from both. An example of
108+
image fusion application would be the alignment of functional data from one
109+
individual's brain to the same individual's corresponding anatomical MRI scan
110+
for visualization. Therefore, "applying a transform" entails two operations:
111+
first, transforming the coordinates of the samples in the reference image $R$ to
112+
find their mapping $\vec{x}'$ on $M$ via $T\{\cdot\}$, and second, an
113+
interpolation step as $\vec{x}'$ will likely fall off-the-grid of the moving
114+
image $M$. These two operations are confusing because, while the spatial
115+
transformation projects from $R$ to $M$, the data flows in reversed way after the
116+
interpolation of the values of $M$ at the mapped coordinates $\vec{x}'$.
117+
118+
# References

0 commit comments

Comments
 (0)