#!/bin/bash
set -x

# execute setup (in case velocities are not available)
./check4vel.sh

# We provide an example on how to transport an image.
# Our input are an image and the three components of
# the velocity field (x1, x2, and x3). The output is
# the transported/deformed intput image.
# The dataset is a brain image of size 128x150x128.

# define directory for binary (relative path)
bindir=../../bin

# define directory for data (relative path)
datdir=../data

# execute claire-tools (backslashes are added for line breaks)
mpirun -np 20 $bindir/claire-tools transport-image --velocity-x1 velocity-field-x1.nii.gz \
                                   --velocity-x2 velocity-field-x2.nii.gz \
                                   --velocity-x3 velocity-field-x3.nii.gz \
                                   --input $datdir/brain01.nii.gz \
                                   --output-file brain01-transported.nii.gz


#### commands explained
# > mpirun -np 20        --- execute with 20 MPI tasks 
# > $bindir/claire-tools --- name of the binary 
# > transport-image      --- command: transport (deform) the input image
# > --velocity-x1 <file> --- x1 component of velocity field (input; also -x2, -x3)
# > --input <file>      --- template image (image to be transported; input)
# > --output-file <file> --- output image (output)




################################################################
# This script is part of the C++ software
#                        ---  CLAIRE  ---
# For details see https://github.com/andreasmang/claire
################################################################

