-
Notifications
You must be signed in to change notification settings - Fork 260
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
WIP: CIFTI2 spec reader and writer #249
Merged
Merged
Changes from 183 commits
Commits
Show all changes
189 commits
Select commit
Hold shift + click to select a range
6fa78bc
enh: first pass at the cifti2 reader
satra e80b4bc
fix: remove cifti element spec
satra 2262b73
enh: cifti writer enabled
satra db0d2af
ref: initial refactor towards cifti datatypes
satra c862285
fix: updated to reflect latest CIFTI-2 spec and nifti extensions
satra 645edaa
tst: added test data
satra 3d19b50
fix: voxelindicesijk initialization, header version check, typo in er…
satra e1ab596
fix: version number for looseversion
satra 8b0feb6
tst: added basic io tests
satra 75a2906
fix: removed redundant file writing
satra cc72b49
fix: unicode in docstring
satra 9a092d5
fix: py3k bytes reading for numpy
satra dffd0fb
fix: move cifti to check to top level function
satra 4592905
fix: started cleaning up classes - removing prints and adding tests
satra 501c352
adding some cifti properties
satra 503875e
fix: conflict with cifti additions
satra dbd7bfc
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra b6fcb50
fix: resolved conflict
satra a55e92f
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra ec031a0
BUG: Fixed string encoding for python 3
MichielCottaar ecc4892
Merge pull request #1 from MichielCottaar/enh/cifti_python3
satra 4668e26
fix: resolved conflicts
satra 3c9918a
Merge remote-tracking branch 'origin/enh/cifti2' into enh/cifti2
satra d03f68d
Merge remote-tracking branch 'upstream/master' into c2
5f2afe2
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra 71e2e1b
BF: files must be makeable (they're made!) for this test.
9eb7ae8
save conversion logic is not as strong as needed (should really use m…
419da77
Localize Cifti to /cifti; use nib.load/save
4d65a82
ENH: add xmlutils.XmlParser
0ca2ef8
Use _to_xml_element, snake_case properties, remove numXXX props, neve…
7fa2e62
Use assert_equal(a,b) instead of assert_true(a==b)
3dd6ddd
fix: move intent_codes.
d94260a
fix: no xmlimage
a044a1f
Merge branch 'flake8-in-travis' into satra/enh/cifti2
03b60d9
STY: pep8 updates
1c4591b
Add a write_morph_data function.
86f44f8
Add a write_morph_data function.
060dcec
cifti=>cifti2, Cifti=>Cifti2
8b5ac2e
FIX: Take care of byte vs. string / BytesIO vs. StringIO encodings fo…
ea30b03
Merge pull request #3 from bcipolli/satra/enh/cifti2
bcipolli 9a3fb6f
Merge remote-tracking branch 'upstream/master' into enh/cifti2
5354bd0
FIX: import reduce for python3
MichielCottaar 4a7ef3a
FIX: removed encode on a bytes object
MichielCottaar 5be1144
Merge pull request #4 from MichielCottaar/enh/cifti2-python3
satra ceb0900
FIX: allow applies_to_matrix_dimension to be a comma-seperate list
MichielCottaar 9f22915
Merge pull request #5 from MichielCottaar/enh/cifti2-dconn
satra 8f7297f
RF: Switch to locally-defined underscore function
effigies b95ce80
BF: Update Cifti2Label._to_xml_element
effigies e5d6443
TST: Exercise Cifti2 classes more thoroughly
effigies 3ef28f5
BF: Add label_table to named_map structure
effigies f5de829
Merge pull request #6 from effigies/enh/cifti2
satra ca37d4c
fix: resolved conflict
satra 2e4a483
DOC: Update docstrings
effigies 7ad3133
Merge pull request #7 from effigies/cifti2_docstrings
satra dcb3c0c
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra 474d331
Merge remote-tracking branch 'origin/enh/cifti2' into enh/cifti2
satra 97942fa
fix: resolved conflict
satra 9caabb9
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra c1eb9bc
enh: first pass at the cifti2 reader
satra ca66f5e
fix: remove cifti element spec
satra 8482495
enh: cifti writer enabled
satra 3d73dff
ref: initial refactor towards cifti datatypes
satra 7551209
fix: updated to reflect latest CIFTI-2 spec and nifti extensions
satra cad2032
tst: added test data
satra 9c7dd28
fix: voxelindicesijk initialization, header version check, typo in er…
satra fdec65b
fix: version number for looseversion
satra 7d0a80e
tst: added basic io tests
satra 0c06213
fix: removed redundant file writing
satra ab34b94
fix: unicode in docstring
satra 20d6a54
fix: py3k bytes reading for numpy
satra ca47113
fix: move cifti to check to top level function
satra f9a694f
fix: started cleaning up classes - removing prints and adding tests
satra 73ba2f6
adding some cifti properties
satra ba174f9
BUG: Fixed string encoding for python 3
MichielCottaar 5289189
BF: files must be makeable (they're made!) for this test.
d9476b2
save conversion logic is not as strong as needed (should really use m…
dd0f897
Localize Cifti to /cifti; use nib.load/save
f199da5
Use _to_xml_element, snake_case properties, remove numXXX props, neve…
5106a5a
Use assert_equal(a,b) instead of assert_true(a==b)
67abcaf
fix: move intent_codes.
044a62a
fix: no xmlimage
54cc1b8
STY: pep8 updates
d980dab
cifti=>cifti2, Cifti=>Cifti2
c2486c5
FIX: Take care of byte vs. string / BytesIO vs. StringIO encodings fo…
41c8d9a
FIX: import reduce for python3
MichielCottaar 0d0dee4
FIX: removed encode on a bytes object
MichielCottaar 36e4c84
FIX: allow applies_to_matrix_dimension to be a comma-seperate list
MichielCottaar 13f156d
RF: Switch to locally-defined underscore function
effigies 805455f
BF: Update Cifti2Label._to_xml_element
effigies 33cd7c9
TST: Exercise Cifti2 classes more thoroughly
effigies ecd2267
BF: Add label_table to named_map structure
effigies 42f8075
DOC: Update docstrings
effigies 57cdf36
Fix Cifti2TransformationMatrixVoxelIndicesIJKtoXYZ to_xml method
demianw 31a3434
Changed the cifti2.py assertions for exceptions
demianw 23487f3
Changed the parse_cifti2_fast.py assertions for exceptions
demianw b156f73
Fixed MetaData and its testing
demianw 7980b13
Exporting the CIFTIHeaderException to the cifti2 namespace
demianw 6082c4c
Improved verification/compatibility of the label object with the stan…
demianw db55bdc
All elements below MatrixIndicesMap fixed and tested
demianw 90c4aae
Newline homogeneization
demianw b11aec3
Fixed header information
demianw c9452b1
Cleaned the metaclass helpers
demianw 1246310
Fixed docstring
demianw 9207cff
Fixed style and function of MetaData
demianw 1565f3b
MetaData now behaves like a mapping
demianw 81727ad
Interface of LabelTable closer to that of Sequence
demianw e7272df
Better agreement between the Label element and its specification
demianw b305826
Several docstring fixes as well as removed the squeeze
demianw 04a961b
Code cleaned
demianw 6cc4c1b
Code cleanup
demianw 2bd867e
Fixed docstring
demianw 20a67b4
Removed comments
demianw d34edb1
Added submodule for CIFTI2 testing
demianw 9388fe4
Added test data as submodule
demianw c23bee7
Added more I/O tests fixed load/save functions:
demianw 6865feb
CIFTI2: MetaData and LabelTable now behave like MutableMapping
demianw ba09103
CIFTI2: MatrixIndicesMap has a MutableSequence behavior
demianw 7751664
Simplified testing by assuming that the parsed header is correct
demianw aa7191d
CIFTI2 Improved MatrixIndecesMap interface
demianw 4a9131e
CIFTI2 Cleanup
demianw 27d069a
CIFTI2 simplifications in implementation and testing due to the new i…
demianw 9a2d7be
Compatibility with new/future nifti interface
demianw db6a468
Fix testing dependency on lxml
demianw 739e00f
RF+BF: refactor error checking for CIFTI2 headers
matthew-brett 0e8c4a8
RF: set CIFTI2 pixdims to 1 when qform code 0
matthew-brett f95cb5b
VertexIndices and VoxelIndicesIJK now have a MutableSequence interface
demianw 41875ad
Improved testing coverage
demianw f73dcf4
RF: avoid deprecated `getchildren` Element method
matthew-brett aeb66db
RF: use image.header instead of image.get_header()
matthew-brett 4e1f7d6
Better handling of volumes in the MatrixIndicesMap
demianw 5e0ee6e
Deleted intent_code restriction
demianw 361f953
Removed lxml dependency
demianw c8bd752
Increased testing coverage and removed residual methods
demianw 45cc854
Clarified code in _Cifti2AsNiftiImage __init__
demianw 3bac385
Changed Cifti2Vertices such that it behaves like a sequence. Added co…
demianw 0ba811c
Address comments
effigies c2dbd16
Icreased testing coverage. Cleaned up code
demianw fef51b8
Corrected problem in new nifti header checks
demianw 58fae01
Increased testing coverage and code cleanup
demianw 06313c9
Fixed python 2.7 incompatibility in tests
demianw a042e27
MAINT: PEP8 and import cleanup for cifti2 tests
matthew-brett c6193e9
RF+DOC: refactor log_chk into own function
matthew-brett a5cd5db
RF+TST: refactor various analyze / nifti checks
matthew-brett f5866a9
Removed commented code
demianw bcbfb78
RF: refactor labeltable checking
matthew-brett b7a3326
Remove affine attribute from CIFTI2 image __init__
demianw 90f2a4c
CIFTI2 reading now is performed without loaading all file from disk
demianw fecd0f2
MetaData can be built from a mapping
demianw 61fc9a7
Improved docstring of Cifti2BrainModel
demianw 33ed37a
Improved docstring of Cifti2MatrixIndicesMap
demianw ac3f0a6
Code clean
demianw bd94e5b
Code clean
demianw c90a7b5
Renamed parse_cifti2_fast to parse_cifti2
demianw c3ec7f0
RF: refactor array proxy generator for indentation
matthew-brett 3d21376
NF: add reshape_dataobj function
matthew-brett df47554
NF+TST: add dtype attribute to Analyze arrayproxy
matthew-brett 97405ad
RF: split up image API tester into mixins
matthew-brett 42501a5
RF+TST: refactor dataobj attribute into own class
matthew-brett 2dffa52
TST: add tests for FileBasedHeader objects
matthew-brett 9af9f4f
RF: refactor Cifti2Image API
matthew-brett 4a33af1
RF+TST: drop CIFTI Matrix check, add tests
matthew-brett 7ca5338
DOC: add text from CIFTI2 specification
matthew-brett aeb7f80
RF+DOC: more cleanup of docs, some refactoring
matthew-brett 068d9ac
Renamed CIFTI2HeaderError to Cifti2HeaderError
demianw ef57b77
Unified the CIFTI2 spelling in the documentation
demianw a83b523
Fixed documentation typo
demianw 0c429fe
TEST: Move shape API tests into DataInterfaceMixin
effigies 2b1dd2f
fix: resolved conflicts
satra c0edd58
fix: Brainstructures import name
satra ed28056
removed accidentally introduced parse cifti2 fast
satra fe36d47
removed data folder
satra 060e65a
added extra line
satra 2a2ad9c
Added convenience functions
demianw a4a6c8e
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra 0df5209
a fix for internal variable name and more tests
satra 0964d6d
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra 6d0ac2f
TEST: reads in all CIFTI axis types and check the output
MichielCottaar 3ced10a
BF: labels in a dlabel file are loaded as string rather than bytes in…
MichielCottaar f651b07
TEST: create most CIFTI file types from scratch and read them back in
MichielCottaar badbbca
TEST: define volume dimensions, affine & number of vertices
MichielCottaar 62c56fe
BF: ensure that voxel indices have the correct shape
MichielCottaar 6591cf4
Merge pull request #16 from MichielCottaar/enh/cifti2-tests
satra 2c3350b
Merge remote-tracking branch 'upstream/master' into enh/cifti2
satra 2fa22d1
adding newline
satra 72fcdc9
resolved conflict
satra 4b389e9
BF: delete images to allow Windows to delete dir
matthew-brett ab1801f
Merge pull request #17 from matthew-brett/cifti-fix
satra e4f3176
PEP8: test file
satra 9e1de24
ref: if formulation
satra 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
There are no files selected for viewing
This file contains 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
Submodule nitest-cifti2
added at
26b7cb
This file contains 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
This file contains 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
This file contains 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,27 @@ | ||
# 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. | ||
# | ||
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## | ||
"""CIfTI format IO | ||
|
||
.. currentmodule:: nibabel.cifti2 | ||
|
||
.. autosummary:: | ||
:toctree: ../generated | ||
|
||
cifti2 | ||
""" | ||
|
||
from .parse_cifti2 import Cifti2Extension | ||
from .cifti2 import (Cifti2MetaData, Cifti2Header, Cifti2Image, Cifti2Label, | ||
Cifti2LabelTable, Cifti2VertexIndices, | ||
Cifti2VoxelIndicesIJK, Cifti2BrainModel, Cifti2Matrix, | ||
Cifti2MatrixIndicesMap, Cifti2NamedMap, Cifti2Parcel, | ||
Cifti2Surface, | ||
Cifti2TransformationMatrixVoxelIndicesIJKtoXYZ, | ||
Cifti2Vertices, Cifti2Volume, CIFTI_BRAIN_STRUCTURES, | ||
Cifti2HeaderError, CIFTI_MODEL_TYPES, load, save) |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these set of lines have any effect on the generated documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthew-brett - these were copied over from the prior
__init__
files that things were tracked from:gifti, nicom
. if there is no need for this perhaps that can be handled in a separate PR going across nibabel.is there an automated documentation builder somewhere for pull-requests and the main repo?