forked from waldronlab/ImageSC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTileSVS.sh
More file actions
executable file
·36 lines (31 loc) · 747 Bytes
/
Copy pathTileSVS.sh
File metadata and controls
executable file
·36 lines (31 loc) · 747 Bytes
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
#!/bin/bash
oldDir=$(pwd)
cd /scratch/${3}/
shopt -s nullglob
FILES=(*.svs)
if [ ${#FILES[@]} -eq 0 ]; then
echo "no svs files found"
else
for i in "${FILES[@]}"
do
FOLDER=$(echo ${i} | cut -d. -f1)
if [ -d ${FOLDER} ]; then
echo "${FOLDER} exists"
else
mkdir ${FOLDER}
echo "$i -> ${FOLDER}"
vips dzsave ${i} ${FOLDER}/ --suffix ${2} --tile-size ${1} --depth 1
cd ./${FOLDER}/${FOLDER}_files/0
shopt -s dotglob
mv -- * ../..
shopt -u dotglob
cd ../..
rm -r ./${FOLDER}_files
mv *.dzi ../
cd ..
fi
done
fi
shopt -u nullglob
cd ${oldDir}
echo "done"