Skip to content

Commit a1b1d64

Browse files
committed
address comments from @oesteban review
1 parent 2f717e0 commit a1b1d64

File tree

2 files changed

+58
-68
lines changed

2 files changed

+58
-68
lines changed

joss/nt.bib

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,27 @@ @article{jenkinson_fsl_2012
4949
volume = 62,
5050
year = 2012
5151
}
52+
53+
@article{avants_symmetric_2008,
54+
author = {Avants, B.B. and Epstein, C.L. and Grossman, M. and Gee, J.C.},
55+
doi = {10.1016/j.media.2007.06.004},
56+
issn = {1361-8415},
57+
journal = {Medical Image Analysis},
58+
number = 1,
59+
pages = {26-41},
60+
shorttitle = {Symmetric diffeomorphic image registration with cross-correlation},
61+
title = {Symmetric diffeomorphic image registration with cross-correlation: Evaluating automated labeling of elderly and neurodegenerative brain},
62+
url = {http://www.sciencedirect.com/science/article/pii/S1361841507000606},
63+
volume = 12,
64+
year = 2008
65+
}
66+
67+
@book{friston_statistical_2006,
68+
address = {London},
69+
author = {Friston, Karl J. and Ashburner, John and Kiebel, Stefan J. and Nichols, Thomas E. and Penny, William D.},
70+
isbn = {978-0-12-372560-8},
71+
publisher = {Academic Press},
72+
shorttitle = {Statistical parametric mapping},
73+
title = {Statistical parametric mapping : the analysis of functional brain images},
74+
year = 2006
75+
}

joss/paper.md

Lines changed: 34 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Nitransforms: A Python tool to read, represent, manipulate, and apply $n$-dimensional spatial transforms'
2+
title: 'NiTransforms: A Python tool to read, represent, manipulate, and apply $n$-dimensional spatial transforms'
33
tags:
44
- Python
55
- neuroimaging
@@ -35,84 +35,50 @@ bibliography: nt.bib
3535

3636
# Summary
3737

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.
38+
Spatial transforms formalize mappings between coordinates of objects in biomedical images.
39+
Transforms typically are the outcome of image registration methodologies, which estimate the alignment between two images.
40+
Image registration is a prominent task present in image processing.
41+
In neuroimaging, the proliferation of image registration software implementations has resulted in a disparate collection of structures and file formats used to preserve and communicate the transformation.
42+
This assortment of formats presents the challenge of compatibility between tools and endangers the reproducibility of results.
4743

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.
44+
_NiTransforms_ is a Python tool capable of reading and writing tranforms produced by the most popular neuroimaging software (AFNI [@cox_software_1997], FSL [@jenkinson_fsl_2012], FreeSurfer [@fischl_freesurfer_2012], ITK via ANTs [@avants_symmetric_2008], and SPM [@friston_statistical_2006]).
45+
Additionally, the tool provides seamless conversion between these formats, as well as the ability of applying the transforms to other images.
46+
_NiTransforms_ is inspired by `NiBabel` [@brett_nibabel_2006], a Python package with a collection of tools to read, write and handle neuroimaging data, and will be included as a new module.
5647

48+
# Spatial transforms
5749

58-
# Software Architecture
50+
Let $\vec{x}$ represent the coordinates of a point in the reference coordinate system $R$, and $\vec{x}'$ its projection on to another coordinate system $M$:
5951

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.
52+
$T\colon R \subset \mathbb{R}^n \to M \subset \mathbb{R}^n$
6853

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.
54+
$\vec{x} \mapsto \vec{x}' = f(\vec{x}).$
7955

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.
56+
In an image registration problem, $M$ is a moving image from which we want to sample data in order to bring the image into spatial alignment with the reference image $R$.
57+
Hence, $f$ here is the spatial transformation function that maps from coordinates in $R$ to coordinates in $M$.
58+
There are a multiplicity of image registration algorithms and corresponding image transformation models to estimate linear and nonlinear transforms.
8859

89-
# Spatial transforms
60+
The problem has been traditionally confused by the need of _transforming_ or mapping one image (generally referred to as _moving_) into another that serves as reference, with the goal of _fusing_ the information from both.
61+
An example of image fusion application would be the alignment of functional data from one individual's brain to the same individual's corresponding anatomical MRI scan for visualization.
62+
Therefore, "applying a transform" entails two operations: first, transforming the coordinates of the samples in the reference image $R$ to find their mapping $\vec{x}'$ on $M$ via $T\{\cdot\}$, and second an interpolation step as $\vec{x}'$ will likely fall off-the-grid of the moving image $M$.
63+
These two operations are confusing because, while the spatial transformation projects from $R$ to $M$, the data flows in reversed way after the interpolation of the values of $M$ at the mapped coordinates $\vec{x}'$.
9064

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$:
65+
# Software Architecture
9366

94-
$T\colon R \subset \mathbb{R}^n \to M \subset \mathbb{R}^n$
67+
There are four main components within the tool: an `io` submodule to handle the structure of the various file formats, a `base` submodule where abstract classes are defined, a `linear` submodule implementing $n$-dimensional linear transforms, and a `nonlinear` submodule for both parametric and non-parametric nonlinear transforms.
68+
Furthermore, _NiTranforms_ provides a straightforward _Application Programming Interface_ (API) that allows researchers to map point sets via transforms, as well as apply transforms (i.e., mapping the coordinates and interpolating the data) to data structures with ease.
9569

96-
$\vec{x} \mapsto \vec{x}' = f(\vec{x}).$
70+
To ensure the consistency and uniformity of internal operations, all transforms are defined using a left-handed coordinate system of physical coordinates.
71+
In words from the neuroimaging domain, the coordinate system of transforms is _RAS+_ (or positive directions point to the Righthand for the first axis, Anterior for the second, and Superior for the third axis).
72+
The internal representation of transform coordinates is the most relevant design decision, and implies that a conversion of coordinate system is necessary to correctly interpret transforms generated by other software.
73+
When a transform that is defined in another coordinate system is loaded, it is automatically converted into _RAS+_ space.
9774

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.
75+
_NiTransforms_ was developed using a test-driven development paradigm, with the
76+
battery of tests being written prior to the software implementations.
77+
Two categories of tests were used: unit tests and cross-tool comparison tests.
78+
Unit tests evaluate the formal correctness of the implementation, while cross-tool
79+
comparison tests assess the correct implementation of third-party software.
80+
The testing suite is incorporated into a continuous integration framework, which assesses the continuity of the implementation along the development life and ensures that code changes and additions do not break existing functionalities.
10481

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}'$.
82+
# Examples
11783

11884
# References

0 commit comments

Comments
 (0)