Closed gdevenyi closed 3 years ago
Without an initial average, the first average can be a mess if subjects don't actually overlap in space, probably implement something like this (using the median?)
quick-com-align.sh
#!/bin/bash set -euo pipefail tmpdir=$(mktemp -d) moving=$1 fixed=$2 output=$3 antsAI -d 3 --convergence 0 --verbose 1 -m Mattes[${fixed},${moving},32,None] -o ${tmpdir}/transform.mat -t AlignCentersOfMass antsApplyTransforms -d 3 -r ${fixed} -i ${moving} -t ${tmpdir}/transform.mat -o ${output} --verbose rm -rf ${tmpdir}
make-dumb-average.sh
#!/bin/bash tmpdir=$(mktemp -d) output=$1 shift inputs="$@" AverageImages 3 ${output} 1 ${inputs} for file in "$@"; do echo ./quick-com-align.sh ${file} ${output} ${tmpdir}/$(basename ${file}) | parallel done AverageImages 3 ${output} 1 ${tmpdir}/* for file in "$@"; do echo ./quick-com-align.sh ${file} ${output} ${tmpdir}/$(basename ${file}) | parallel done AverageImages 3 ${output} 1 ${tmpdir}/* rm -rf ${tmpdir}
Fixed by #20
Without an initial average, the first average can be a mess if subjects don't actually overlap in space, probably implement something like this (using the median?)
quick-com-align.sh
make-dumb-average.sh