forked from JoeSu666/isyntax2tiff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatchrun.sh
More file actions
47 lines (36 loc) · 1.61 KB
/
batchrun.sh
File metadata and controls
47 lines (36 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#SBATCH --account PAS2942
#SBATCH --job-name isyntax2tiff_batchrun
#SBATCH --array=1-153%4 # Adjust 50 to the number of images in your input_list.txt
#SBATCH --nodes=1 # Use 1 node per job (adjust as needed)
#SBATCH --ntasks=1 # 1 task per job
#SBATCH --cpus-per-task=4 # Adjust based on required CPU cores
#SBATCH --mem=24G # Adjust memory per job
#SBATCH --time=08:00:00 # Adjust max runtime
#SBATCH --output=logs/slurm_%A_%a.out
#SBATCH --partition=nextgen # Can also explicitly specify which cluster to submit the job to. Or, log in to the node and submit the job.
# Load necessary modules (if required)
module use $HOME/local/share/lmodfiles
module load pathologysdk/2.0-L1
module load miniconda3
source activate philips
# Define the input folder and output directory
OUTPUT_DIR=./outputs
# Create output directory if it doesn't exist
mkdir -p "$OUTPUT_DIR"
# Get the image filename from the input list
IMAGE=$(sed -n "${SLURM_ARRAY_TASK_ID}p" input_list.txt)
# Safety check: if empty, exit gracefully
if [ -z "$IMAGE" ]; then
echo "No image found for task ID ${SLURM_ARRAY_TASK_ID}"
exit 1
fi
# Get the basename without extension
BASENAME=$(basename "$IMAGE" .i2syntax)
echo "Processing image: $BASENAME"
# # Step 1: Convert iSyntax to Zarr
isyntax2raw write_tiles "$IMAGE" "$OUTPUT_DIR/${BASENAME}.zarr" --tile_width 1024 --tile_height 1024
echo "Finished writing Zarr file for $BASENAME"
# Step 2: Convert Zarr to OME-TIFF
raw2ometiff "$OUTPUT_DIR/${BASENAME}.zarr" "$OUTPUT_DIR/${BASENAME}.ome.tiff" --rgb
echo "Done converting $BASENAME to OME-TIFF"