Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affine registration PR 3/3 #654

Merged
merged 47 commits into from Jul 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7470b65
Add imaffine module and tests
omarocegueda Apr 19, 2015
2deea09
RF: move both scale space classes to their own module
omarocegueda May 23, 2015
e471ab1
Add tutorial for affine registration
omarocegueda May 24, 2015
526f5c5
Display images in the affine registration tutorial
omarocegueda May 24, 2015
c47f6c3
Remove non-ascii character
omarocegueda May 24, 2015
b34cb7d
Restore valid examples list, fix call to overlay_slices
omarocegueda May 24, 2015
e4c576c
DOC: display sagital, coronal and axial slices in the tutorial
omarocegueda May 24, 2015
7de4d6e
PEP8 : full review using Spyder. RF: use X_grid2world, X_world2grid n…
omarocegueda May 24, 2015
6829a7c
TEST: fix tests for scale space
omarocegueda May 24, 2015
433c8be
RF: Change default optimization method to L-BFGS-B
omarocegueda May 24, 2015
8ce08e0
TEST: increate test coverage, pass maxfun argument instead of maxiter…
omarocegueda May 24, 2015
8622c73
TEST: increase test coverage
omarocegueda May 25, 2015
d770db1
BF: use joint PDF dimensions instead of joint gradient's. Eliminate s…
omarocegueda May 25, 2015
610d0b9
DOC: corrections and extensions to docstrings. RF: remove opt_tol arg…
omarocegueda May 26, 2015
381c84e
DOC: indicate and explain optional arguments and their defaults in im…
omarocegueda May 26, 2015
4c01b34
BF: pass separate value and gradient functions for scipy<=0.12
omarocegueda May 29, 2015
fa8081b
RF: use X_grid2world and X_world2grid naming convention. BF: remove t…
omarocegueda Jun 7, 2015
a6d3766
BF: update function signature in doctest. Add keyword to argument.
omarocegueda Jun 7, 2015
a3bd5cf
DOC: add space after 'shape' in argument descriptions
omarocegueda Jun 7, 2015
edab669
DOC: add space before colon in parameter documentation
omarocegueda Jun 7, 2015
8ebd11d
RF: use relative imports
omarocegueda Jun 8, 2015
5b461a7
RF: specify sampling proportion as a float in (0,1] instead of an int…
omarocegueda Jun 8, 2015
16ec3d1
RF: define only one update function instead of two separate updates f…
omarocegueda Jun 14, 2015
beca449
BF: remove call to _update_dense, use unified _update instead
omarocegueda Jun 14, 2015
12a1b1d
BF: pass parameters in call to _update. DOC: require sequence, not ne…
omarocegueda Jun 14, 2015
8aeef10
BF: update tutorial. RF: change string option from 'origins' to 'voxe…
omarocegueda Jun 14, 2015
c36239b
RF: make printed messages optional by using vervosity levels.
omarocegueda Jun 14, 2015
6f880a7
TEST: update starting_affine argument to 'voxel-origin' instead of 'o…
omarocegueda Jun 14, 2015
40f0649
PEP8: max. 79 characters per line
omarocegueda Jun 29, 2015
3577e02
RF: rename value_and_gradient to distance_and_gradient. Update the tu…
omarocegueda Jun 29, 2015
11e3117
NF: add AffineMap class and use it instead of transform_image (removed)
omarocegueda Jun 30, 2015
e4f00d2
RF: extend vector_fields and mattes modules to support both float32 a…
omarocegueda Jul 9, 2015
4d2971a
RF: rename mattes module and its classes. Move the computation of MI …
omarocegueda Jul 11, 2015
3d43365
BF: remove reference to old mattes module
omarocegueda Jul 11, 2015
033e13f
RF: return ValueError instead of returning flag for non-invertible tr…
omarocegueda Jul 11, 2015
66d8a86
RF: define gradient functions as def instead of cdef to make template…
omarocegueda Jul 11, 2015
b51644e
RF: raise custom exception on singular affine. DOC: explain how affin…
omarocegueda Jul 15, 2015
491868d
RF: select transform method using a dictionary
omarocegueda Jul 15, 2015
26bccef
RF: rename 'warp_affine' methods to 'transform_affine'
omarocegueda Jul 15, 2015
ee2b0f1
BF: cast image to float64 for linear interpolation
omarocegueda Jul 16, 2015
3387773
RF: remove ParzenMutualInformation (and its tests) infavor of a simpl…
omarocegueda Jul 23, 2015
576ba33
RF: remove unused random sampling functions in favor of deterministic…
omarocegueda Jul 23, 2015
18c5979
BF: evaluate image gradient and transform Jacobian at the right point…
omarocegueda Jul 23, 2015
42c78ab
TEST: check all exceptions from parzenhist module
omarocegueda Jul 23, 2015
bea7437
BF: use right affine for inverse transform. TEST: test inverse transform
omarocegueda Jul 24, 2015
9f2bc33
BF: update tutorial. Get max_iter from scales in the right order.
omarocegueda Jul 24, 2015
741e3c0
DOC: add missing blank lines in tutorial
omarocegueda Jul 24, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions dipy/align/expectmax.pyx
Expand Up @@ -7,7 +7,7 @@
import numpy as np
cimport cython
cimport numpy as cnp
from fused_types cimport floating, number
from .fused_types cimport floating, number
cdef extern from "dpy_math.h" nogil:
int dpy_isinf(double)
double floor(double)
Expand Down Expand Up @@ -367,24 +367,24 @@ def compute_em_demons_step_2d(floating[:,:] delta_field,

Parameters
----------
delta_field : array, shape(R, C)
delta_field : array, shape (R, C)
contains, at each pixel, the difference between the moving image (warped
under the current deformation s(. , .) ) J and the static image I:
delta_field[i,j] = J(s(i,j)) - I(i,j). The order is important, changing
to delta_field[i,j] = I(i,j) - J(s(i,j)) yields the backward demons step
warping the static image towards the moving, which may not be the
intended behavior unless the 'gradient_moving' passed corresponds to
the gradient of the static image
sigma_sq_field : array, shape(R, C)
sigma_sq_field : array, shape (R, C)
contains, at each pixel (i, j), the estimated variance (not std) of the
hidden variable associated to the intensity at static[i,j] (which must
have been previously quantized)
gradient_moving : array, shape(R, C, 2)
gradient_moving : array, shape (R, C, 2)
the gradient of the moving image
sigma_sq_x : float
parameter controlling the amount of regularization. It corresponds to
$\sigma_x^2$ in algorithm 1 of Vercauteren et al.[2]
out : array, shape(R, C, 2)
out : array, shape (R, C, 2)
the resulting demons step will be written to this array

Returns
Expand Down Expand Up @@ -463,24 +463,24 @@ def compute_em_demons_step_3d(floating[:,:,:] delta_field,

Parameters
----------
delta_field : array, shape(S, R, C)
delta_field : array, shape (S, R, C)
contains, at each pixel, the difference between the moving image (warped
under the current deformation s ) J and the static image I:
delta_field[k,i,j] = J(s(k,i,j)) - I(k,i,j). The order is important,
changing to delta_field[k,i,j] = I(k,i,j) - J(s(k,i,j)) yields the
backward demons step warping the static image towards the moving, which
may not be the intended behavior unless the 'gradient_moving' passed
corresponds to the gradient of the static image
sigma_sq_field : array, shape(S, R, C)
sigma_sq_field : array, shape (S, R, C)
contains, at each pixel (k, i, j), the estimated variance (not std) of
the hidden variable associated to the intensity at static[k,i,j] (which
must have been previously quantized)
gradient_moving : array, shape(S, R, C, 2)
gradient_moving : array, shape (S, R, C, 2)
the gradient of the moving image
sigma_sq_x : float
parameter controlling the amount of regularization. It corresponds to
$\sigma_x^2$ in algorithm 1 of Vercauteren et al.[2].
out : array, shape(S, R, C, 2)
out : array, shape (S, R, C, 2)
the resulting demons step will be written to this array

Returns
Expand Down
9 changes: 2 additions & 7 deletions dipy/align/fused_types.pxd
@@ -1,8 +1,3 @@
cimport cython
ctypedef fused floating:
cython.float

ctypedef fused number:
cython.float
cython.short
cython.int
ctypedef cython.floating floating
ctypedef cython.numeric number
1,089 changes: 1,089 additions & 0 deletions dipy/align/imaffine.py

Large diffs are not rendered by default.