GithubHelp home page GithubHelp logo

amitvakula / air_download Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johncolby/air_download

0.0 1.0 0.0 9 KB

Command line interface to the Automated Image Retrieval (AIR) Portal

License: MIT License

Python 100.00%

air_download's Introduction

Automated Image Retrieval (AIR) Download

This is a small wrapper interface to the AIR web API. This will help you to batch download radiology studies if you have this service available on your PACS system.

Install

Install the air_download package directly from the git repository like:

pip install git+https://github.com/johncolby/air_download

(modify URL if the repository lives somewhere other than github)

Usage

air_download -c /path/to/air_login.txt https://air.<domain>.edu/api/ 11111111

Login credentials should be stored in a plain text file like:

AIR_USERNAME=username
AIR_PASSWORD=password

Please ensure this file is reasonably secure.

chmod 600 air_login.txt

Alternatively, credentials may be stored as environment variables like:

AIR_USERNAME=username
AIR_PASSWORD=password
export AIR_USERNAME AIR_PASSWORD

air_download https://air.<domain>.edu/api/ 11111111

Type air_download -h for the help text.

$ air_download -h
usage: air_download [-h] [-c CRED_PATH] [-p PROFILE] [-o OUTPUT] URL ACCESSION

positional arguments:
  URL                   URL for AIR API, e.g. https://air.<domain>.edu/api/
  ACCESSION             Accession # to download

optional arguments:
  -h, --help            show this help message and exit
  -c CRED_PATH, --cred_path CRED_PATH
                        Login credentials file. If not present, will look for
                        AIR_USERNAME and AIR_PASSWORD environment variables.
                        (default: None)
  -p PROFILE, --profile PROFILE
                        Anonymization Profile (default: -1)
  -o OUTPUT, --output OUTPUT
                        Output path (default: ./<Accession>.zip)

From within python, you can also import the module directly, so that it may be integrated with other tools.

import air_download.air_download as air
import argparse

args = argparse.Namespace()
args.cred_path = '/path/to/air_login.txt'
args.URL       = 'https://air.<domain>.edu/api/'
args.acc       = '11111111'
args.profile   = -1
args.output    = '11111111.zip'

air.main(args)

air_download's People

Contributors

johncolby 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.