-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from incf-nidash/add-license-1
Create LICENSE, README, first example
- Loading branch information
Showing
5 changed files
with
74 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 INCF-NIDASH | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,24 @@ | ||
# nidmresults | ||
A Python library to read and write [NIDM-Results](http://nidm.nidash.org/specs/nidm-results.html) packs. | ||
|
||
You are free to copy, modify, and distribute nidmresults with attribution under the terms of the MIT license. See the [LICENSE file](LICENSE.md) for details. | ||
|
||
## Install | ||
nidmresults is distributed with [PyPI](https://pypi.org/project/nidmresults/), to install the latest relase you can use: | ||
``` | ||
pip install nidmresults | ||
``` | ||
|
||
To work with the current developement version we recommend cloning this repository locally and then install using | ||
``` | ||
python setup.py install | ||
``` | ||
|
||
## Example of usage | ||
|
||
Examples are available in the [examples](examples) folder. | ||
|
||
## Contributing | ||
Thanks for your interest in contributing to nidmresults. All contributions are very welcome! If you experience difficulties using the library, please [open an issue](https://github.com/incf-nidash/nidmresults/issues/new) describing the problem. See the list of [current issues](https://github.com/incf-nidash/nidmresults/issues). | ||
|
||
|
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,26 @@ | ||
# Example: reading a NIDM pack available on NeuroVault | ||
import os | ||
import json | ||
import shutil | ||
import tempfile | ||
import nidmresults as nidm | ||
import urllib.request | ||
|
||
# Download the NIDM pack locally | ||
nidm_url = 'https://neurovault.org/collections/2210/fsl_default_130.nidm.zip' | ||
nidmpack = "2210_fsl_default_130.nidm.zip" | ||
|
||
if not os.path.isfile(nidmpack): | ||
print('Downloading ' + nidmpack) | ||
urllib.request.urlretrieve(nidm_url, nidmpack) | ||
|
||
# Known issues with NIDM packs in collection 2210 | ||
to_replace = { | ||
' \\ntask': '\\\\n task', | ||
';\n nidm_coordinateVectorInVoxels: "null"^^xsd:string .': | ||
'.'} | ||
|
||
# Read the NIDM pack | ||
nres = nidm.load(nidmpack, to_replace=to_replace) | ||
|
||
print(json.dumps(nres.get_info(), indent=4)) |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
setup( | ||
name="nidmresults", | ||
version="2.0.0", | ||
version="2.0.1-dev1", | ||
author="Camille Maumet", | ||
author_email="[email protected]", | ||
description=( | ||
|