Giter VIP home page Giter VIP logo

pyneurovault_upload's Introduction

pyneurovault_upload

Python library for interfacing with http://neurovault.org upload API

Installation

git clone https://github.com/ljchang/pyneurovault_upload.git
cd pyneurovault_upload
python setup.py install

Example Usage

Initialize a Client instance

First, we need to create an instance of the Client class. This requires adding your NeuroVault personal access token which can be found under “Personal Access tokens” tab in the Account Settings.

from pyneurovault_upload.api import Client

api = Client(access_token='your_neurovault_personal_access_token')

Create a Collection

To create a new collection in NeuroVault you need to pass a dictionary of all of the metadata you would like to specify in the collection. At a minimum you must specify a collection name.

collection = api.create_collection('name of new collection')

Add Image to Collection

Once a collection is created you can add images to it using the add_image() method. You need to pass a string indicating the path to the file you would like to upload. You also need to pass a few mandatory parameters, which include the image name, the image modality, and the map type.

image_file_path = 'path/to/image/file.nii.gz'

image = api.add_image(
    collection.id,
    image_file_path,
    name='Parcellation_k25',
    modality='Other',
    map_type='Pa'
)

Delete a Collection

To delete a collection you can simply run the delete_collection() method. You can delete any collection that you own. Be careful with this as you will be unable to recover any collections that you delete!

api.delete_collection(collection.id)

pyneurovault_upload's People

Contributors

burnash avatar ljchang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.