#!/bin/bash
set -x

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

# We provide an example on how to compute the determinant
# of the deformation gradient det \grad y given a
# velocity field 

# 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 deformation-fields --velocity-x1 velocity-field-x1.nii.gz \
                                   --velocity-x2 velocity-field-x2.nii.gz \
                                   --velocity-x3 velocity-field-x3.nii.gz \
                                   -o ./ --save jacobian


#### commands explained
# > mpirun -np 20        --- execute with 20 MPI tasks 
# > $bindir/claire-tools --- name of the binary 
# > deformation-fields   --- command: compute deformation fields (--save)
# > --velocity-x1 <file> --- x1 component of velocity field (input; also -x2, -x3)
# > -o <folder>          --- output folder (where to store det-deformation-grad.nii.gz) 
# > --save jacobian      --- compute the determinant of the deformation gradient 




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

