Tools

The pymerlin package comes with a few commandline tools which are installed as entry points by pip. The main one is pymerlin which does everything related to the registration and motion correction. The others are various useful tools for working with h5 and nifti files.

pymerlin

Main script to run MERLIN functions on the command line. Uses .h5 files as input, assuming that the dataset image is occupied by the image data.

The executable works like the git command with subcommands.

usage: pymerlin <command> [<args>]

Available commands are:
    reg         Register data
    merge       Merge registration into series
    moco        Run moco
    report      View report of data
    metric      Image metric analysis
    animation   Navigator and registration animation
    ssim        Calculate Structural Similarity Index Measure
    aes         Calculate Average Edge Strength
    nrmse       Calculate Normalised Root Mean Squared Error
    tukey       Applies Tukey filter to radial k-space data
    param       Makes a valid parameter file

To get more help for a specific command add -h.

>> pymerlin reg -h

usage: pymerlin reg [<args>]

MERLIN Registration

optional arguments:
-h, --help            show this help message and exit
--fixed FIXED         Fixed image
--moving MOVING       Moving image
--reg REG             Registration parameters
--log LOG             Registration history log
--fixout FIXOUT       Name of fixed image output
--moveout MOVEOUT     Name of registered moving image output
--rad RAD             Radius of fixed mask
--thr THR             Low image threshold
--sigma SIGMA [SIGMA ...]
                        List of sigmas
--shrink SHRINK [SHRINK ...]
                        Shrink factors
--metric METRIC       Image metric
--verbose VERBOSE     Log level (0,1,2)

h5viewer

Simple static 3-plane viewer of .h5 image data. Will read .h5 files in the riesling format, i.e. with a dataset named image.

usage: h5viewer file.h5

h5viewer

positional arguments:
H5          File input

optional arguments:
-v,         Volume to show (default=0)
-e,         Echo to show (default=0)
-h, --help  Show this help message and exit

h52nii

Converts riesling image .h5 file to nifti.

usage: h52nii h5image

h52nii converts from h5 to nii

positional arguments:
input       Input h5 image

optional arguments:
-h, --help  show this help message and exit
--out OUT   Output image

nii2h5

Converts a nifti file to riesling format .h5 image file

usage: nii2h5 niifile

nii2h5 converts from nii to h5

positional arguments:
input       Input nii image

optional arguments:
-h, --help  show this help message and exit
--out OUT   Output h5 image