-
Notifications
You must be signed in to change notification settings - Fork 264
ENH,WIP: New transforms module #656
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
Closed
+966
−3
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
3cfff0d
ENH: Add an utility to calculate obliquity of affines
oesteban c92d560
enh(tests): add not-oblique test, move tests to ``test_affines.py``
oesteban da8da56
enh: return radians unless degrees=True
oesteban 253a256
enh: address @matthew-brett's comments
oesteban 04584b6
doc: add link to AFNI's documentation about *obliquity* [skip ci]
oesteban 70d9620
Initial commit
oesteban 36a1764
add TransformBase
oesteban 2a700c9
8000
code>
add new module
oesteban Aug 1, 2018
fda2bfe
add documentation, core functionality
oesteban 3ef5adc
add a deformation field transform
oesteban 189a662
optimize deformation field
oesteban 2619ae4
pre-cache transformed indexes
oesteban 4e7c19b
used cached field
oesteban 23d7002
add caching of deltas in voxel coordinates
oesteban 2acd9f3
add bspline cython extension
oesteban 385ceff
a smarter ImageSpace
oesteban fa030a4
add comment
oesteban fd418fe
remove cython module
oesteban 13d722f
cleanup
oesteban 253aed5
starting with bspline transform
oesteban 47c2a57
finishing b-spline interpolation
oesteban 4478c06
Add base implementation of transforms and change base implementation …
oesteban 99fa15d
export to hdf5
oesteban 5eed01d
corrections to adhere the current x5 format draft
oesteban 632e068
fix coordinates translation in affines, import itk affines
oesteban f2c062e
wip: reads & writes ITK's MatrixOffsetTransformBase transforms, with …
oesteban 8eb670d
fix: print warnings to stderr, sty: minimal fixes
oesteban 799fb6e
enh(affines): write out AFNI 12-parameters files
oesteban ce36f06
enh(transforms): finish up a x5-to-fsl writer of affines
oesteban 8e1bf44
enh(transforms): improve generation of x5 structures of reference spaces
oesteban e2df7cc
fix(transforms): string formating forgotten when writing ITK transforms
oesteban c5d10ed
wip(transforms): writing up some linear transform readers
oesteban a18ce1d
enh(transform): HDF5 - set values as attributes; generalize affines t…
oesteban 9902f50
enh: apply some early comments from @effigies.
oesteban fe74efb
fix: add a first battery of tests
oesteban 596994c
enh: add tests for affines stored in AFNI format (non-oblique images)
oesteban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add bspline cython extension
- Loading branch information
commit 2acd9f39c4500181ef5c52c238bcd880d0cd1f29
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,3 +84,4 @@ Thumbs.db | |
doc/source/reference | ||
venv/ | ||
.buildbot.patch | ||
nibabel/maths/bspline.c | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- | ||
# vi: set ft=python sts=4 ts=4 sw=4 et: | ||
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## | ||
# | ||
# See COPYING file distributed along with the NiBabel package for the | ||
# copyright and license terms. | ||
# | ||
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## | ||
"""Geometric transforms | ||
|
||
.. currentmodule:: nibabel.maths | ||
|
||
.. autosummary:: | ||
:toctree: ../generated | ||
|
||
maths | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
8000 | # emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- | |
# vi: set ft=python sts=4 ts=4 sw=4 et: | ||
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## | ||
# | ||
# See COPYING file distributed along with the NiBabel package for the | ||
# copyright and license terms. | ||
# | ||
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## | ||
''' Cython math extension ''' | ||
from __future__ import division | ||
import numpy as np | ||
cimport numpy as np | ||
cimport cython | ||
from libc.math cimport fabs | ||
|
||
|
||
cdef double c_cubic(double x) nogil: | ||
cdef: | ||
double x_t = fabs(x) | ||
|
||
if x_t >= 2.0: | ||
return(0.0) | ||
if x_t <= 1.0: | ||
return(2.0 / 3.0 - x_t**2 + 0.5 * x_t**3) | ||
elif x_t <= 2.0: | ||
return((2 - x_t)**3 / 6.0) | ||
|
||
|
||
def cubic(double x): | ||
""" | ||
Evaluate the univariate cubic bspline at x | ||
|
||
Pure python implementation: :: | ||
|
||
def bspl(x): | ||
if x >= 2.0: | ||
return 0.0 | ||
if x <= 1.0: | ||
return 2.0 / 3.0 - x**2 + 0.5 * x**3 | ||
elif x <= 2.0: | ||
return (2 - x)**3 / 6.0 | ||
""" | ||
return(c_cubic(x)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.