-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:saalfeldlab/hot-knife
- Loading branch information
Showing
5 changed files
with
150 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
run_scripts/multi-sem/wafer-53/92_adjust_layer_intensity.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
ABSOLUTE_SCRIPT=`readlink -m $0` | ||
SCRIPT_DIR=`dirname ${ABSOLUTE_SCRIPT}` | ||
source ${SCRIPT_DIR}/00_config.sh | ||
|
||
umask 0002 | ||
|
||
if (( $# < 1 )); then | ||
echo """ | ||
USAGE: $0 <number of nodes> | ||
""" | ||
exit 1 | ||
fi | ||
|
||
N_NODES="${1}" # normalizing a 10-slab volume with 180 11-slot workers took 2 hours and 15 minutes | ||
NORMALIZE_METHOD="LOCAL_CONTRAST" | ||
|
||
SOURCE_DATASET="/wafer-53-align/run_20240410_173647/pass06" | ||
|
||
#----------------------------------------------------------- | ||
NORMALIZED_LAYER_SUFFIX="_norm-layer" | ||
NORMALIZED_LOCAL_SUFFIX="_norm-local" | ||
if [[ "${NORMALIZE_METHOD}" == "LAYER_INTENSITY" ]]; then | ||
NORMALIZED_SUFFIX="${NORMALIZED_LAYER_SUFFIX}" | ||
elif [[ "${NORMALIZE_METHOD}" == "LOCAL_CONTRAST" ]]; then | ||
NORMALIZED_SUFFIX="${NORMALIZED_LOCAL_SUFFIX}" | ||
else | ||
echo "ERROR: unknown NORMALIZE_METHOD of ${NORMALIZE_METHOD}" | ||
exit 1 | ||
fi | ||
|
||
NORMALIZED_SUFFIX="${NORMALIZED_SUFFIX}_inverted" | ||
|
||
SOURCE_PATH="${N5_SAMPLE_PATH}${SOURCE_DATASET}" | ||
|
||
if [[ ! -d ${SOURCE_PATH} ]]; then | ||
echo "ERROR: ${SOURCE_PATH} not found" | ||
exit 1 | ||
fi | ||
|
||
#----------------------------------------------------------- | ||
# Spark executor setup with 11 cores per worker ... | ||
|
||
export N_EXECUTORS_PER_NODE=2 # 6 | ||
export N_CORES_PER_EXECUTOR=5 # 5 | ||
# To distribute work evenly, recommended number of tasks/partitions is 3 times the number of cores. | ||
#N_TASKS_PER_EXECUTOR_CORE=3 | ||
export N_OVERHEAD_CORES_PER_WORKER=1 | ||
#N_CORES_PER_WORKER=$(( (N_EXECUTORS_PER_NODE * N_CORES_PER_EXECUTOR) + N_OVERHEAD_CORES_PER_WORKER )) | ||
export N_CORES_DRIVER=1 | ||
|
||
#----------------------------------------------------------- | ||
RUN_TIME=`date +"%Y%m%d_%H%M%S"` | ||
JAR="/groups/flyem/data/render/lib/hot-knife-0.0.5-SNAPSHOT.jar" | ||
CLASS="org.janelia.saalfeldlab.hotknife.SparkNormalizeN5" | ||
|
||
# /nrs/hess/render/export/hess.n5/render/wafer_52_cut_00030_to_00039/slab_045_all_align_t2_ic___20230123_162917 | ||
|
||
ARGV="\ | ||
--n5PathInput=${N5_SAMPLE_PATH} \ | ||
--n5DatasetInput=${SOURCE_DATASET} \ | ||
--normalizeMethod=${NORMALIZE_METHOD} \ | ||
--factors=2,2,1 \ | ||
--invert" | ||
|
||
NORMALIZED_DATASET="${SOURCE_DATASET}${NORMALIZED_SUFFIX}" | ||
NORMALIZED_DATASET_DIR="${N5_SAMPLE_PATH}${NORMALIZED_DATASET}" | ||
|
||
if [[ ! -d ${NORMALIZED_DATASET_DIR} ]]; then | ||
mkdir -p "${NORMALIZED_DATASET_DIR}" | ||
if [[ -f ${SOURCE_PATH}/attributes.json ]]; then | ||
cp "${SOURCE_PATH}"/attributes.json "${NORMALIZED_DATASET_DIR}" | ||
echo "copied ${SOURCE_PATH}/attributes.json to ${N5_SAMPLE_PATH}${NORMALIZED_DATASET}" | ||
fi | ||
fi | ||
|
||
LOG_DIR="logs" | ||
LOG_FILE="${LOG_DIR}/norm.${RUN_TIME}.out" | ||
|
||
mkdir -p ${LOG_DIR} | ||
|
||
# use shell group to tee all output to log file | ||
{ | ||
|
||
echo "Running with arguments: | ||
${ARGV} | ||
" | ||
/groups/flyTEM/flyTEM/render/spark/spark-janelia/flintstone.sh $N_NODES $JAR $CLASS $ARGV | ||
|
||
echo "normalized n5 volume is: | ||
-i ${N5_SAMPLE_PATH} -d ${NORMALIZED_DATASET} | ||
" | ||
} 2>&1 | tee -a ${LOG_FILE} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters