Skip to content

Commit

Permalink
Tidied up files with folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ruaridhg committed Nov 8, 2024
1 parent e4555c6 commit f4b2938
Show file tree
Hide file tree
Showing 15 changed files with 9 additions and 393 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions install_randomiser.sh

This file was deleted.

Binary file added output_files/output_frames_f10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions randomisation_seed.sh

This file was deleted.

63 changes: 0 additions & 63 deletions randomisation_seed_needs_inputs.sh

This file was deleted.

84 changes: 0 additions & 84 deletions scripts/Cluster_running.sh

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/install_randomiser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

source ~/.bash_profile

# zip randomiser, launch blender and install+enable
zip ../randomiser.zip -FS -r ../randomiser/
blender ../blend_files/sample.blend --python ../install_and_enable_addons.py -- ../randomiser.zip
75 changes: 2 additions & 73 deletions scripts/randomisation_seed.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,77 +1,6 @@
#!/usr/bin/env bash
source ~/.bash_profile

#Setup blender path
alias blender=/home/lbinding/software/blender-4.2.3-linux-x64/blender
blender=/home/lbinding/software/blender-4.2.3-linux-x64/blender

# Get script name
script_name=`basename $0`
#Get script location
script_path="$(dirname "$(realpath "$BASH_SOURCE")")"

# Setup user paths
# Loop over arguments looking for -i and -o
args=("$@")
i=0
while [ $i -lt $# ]; do
#Set blender data
if ( [ ${args[i]} = "-blend" ] ) ; then
let i=$i+1
blend_file=${args[i]}
elif ( [ ${args[i]} = "-seed" ] ) ; then
# Set seed value
let i=$i+1
seed_num=${args[i]}
elif ( [ ${args[i]} = "-json_in" ] ) ; then
# Set json input
let i=$i+1
json_input=${args[i]}
elif ( [ ${args[i]} = "-json_out" ] ) ; then
# Set json output
let i=$i+1
json_output=${args[i]}
elif ( [ ${args[i]} = "-frame" ] ) ; then
# Set frame number
let i=$i+1
frame=${args[i]}
elif ( [ ${args[i]} = "-basename" ] ) ; then
# Set base output
let i=$i+1
base_output=${args[i]}
fi
let i=$i+1
done

#Check to make sure all required inputs are assigned
if [ -z "${blend_file}" ] || [ -z "${seed_num}" ] || [ -z "${json_input}" ]; then
correct_input=0
else
correct_input=1
fi

#Check the user has provided the correct inputs
if ( [[ ${correct_input} -eq 0 ]] ) ; then
echo ""
echo "Incorrect input. Please see below for correct use"
echo ""
echo "Options:"
echo " -blend: Absolute path to working directory -- REQUIRED"
echo " -json_in: Input dwi data (full path) -- REQUIRED"
echo " -json_out: Input bvec data (full path) -- REQUIRED"
echo " -seed: Input bval data (full path) -- REQUIRED"
echo " -frame: Input number (full path) -- REQUIRED"
echo " -basename: Input basename (full path) -- REQUIRED"
echo ""
echo "${script_name} -blend /home/username/colon.blend -json_in /home/username/input.json -json_out /home/username/output.json -json /home/username/synb0/dwi.json -seed 32 -frame 10 -basename /home/username/output_frame"
echo ""
exit
fi



# zip randomiser, launch blender and install+enable, set seed and input bounds
zip ${script_path}/randomiser.zip -FS -r ${script_path}/randomiser/
#${blender} ${blend_file} --python ${script_path}/install_and_enable_addons.py -- ${script_path}/randomiser.zip --seed 32 --input ${json_input} --output ${json_output}

${blender} -b ${blend_file} --python ${script_path}/install_and_enable_addons.py -- ${script_path}/randomiser.zip --seed 32 --input ${json_input} --frame 10 --basename ${base_output}
zip ../randomiser.zip -FS -r ../randomiser/
blender ../blend_files/sample.blend --python ../install_and_enable_addons.py -- ../randomiser.zip --seed 32 --input ../input_files/input_bounds.json --output ../output_files/output_randomisations_per_frame1697116725.310647.json
85 changes: 0 additions & 85 deletions scripts/randomisation_seed_LB_local.sh

This file was deleted.

Loading

0 comments on commit f4b2938

Please sign in to comment.