rudolphpienaar / mgz_converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pl-mgz_converter

image

image

image

Table of Contents

Abstract

mgz_converter.py is a ChRIS-based application that takes Brain MRI images present in mgz format from the input diretctory, converts them to png or npy format based on the conversion type and saves output to the output directory.

Synopsis

python mgz_converter.py                                         \
    [-v <level>] [--verbosity <level>]                          \
    [--version]                                                 \
    [--man]                                                     \
    [--meta]                                                    \
    [--conversion_type <conversion_type>]                       \
    <inputDir>                                                  \
    <outputDir>                                                 \

Agruments

[-v <level>] [--verbosity <level>]
Verbosity level for app. Not used currently.

[--version]
If specified, print version number. 

[--man]
If specified, print (this) man page.

[--meta]
If specified, print plugin meta data.

[--conversion_type <conversion_type>]     
Should be specified,
If the <conversion_type> is 1, converts the input mgz images to png
If the <conversion_type> is 2, converts the input mgz images to npy

Run

This plugin can be run in two modes: natively as a python package or as a containerized docker image.

Using PyPI

To run from PyPI, simply do a

and run with

to get inline help. The app should also understand being called with only two positional arguments

Using docker run

To run using docker, be sure to assign an "input" directory to /incoming and an output directory to /outgoing. Make sure that the $(pwd)/out directory is world writable!

Now, prefix all calls with

Thus, getting inline help is:

Examples

Convert mgz images to png

This will convert the *.mgz images present in the input directory to *.png format and saves them inside out/png directory

Convert mgz images to npy

This will convert the *.mgz images present in the input directory to *.npy format and saves them inside out/numpy directory

About

License:MIT License


Languages

Language:Python 83.1%Language:Shell 9.2%Language:Dockerfile 7.6%