-
Notifications
You must be signed in to change notification settings - Fork 10
/
generate.sh
executable file
·46 lines (37 loc) · 971 Bytes
/
generate.sh
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
#!/usr/bin/env bash
test -e .env && . .env
DIR=${DIR:-./data}
CLEAN=${CLEAN:-"--rm"}
set -e
set -u
set -x
IMS=IMS_XY-${XY}-Z-${Z}-T-${T}-C-${C}-XYC-${XC}-ZC-${ZC}.ims
ZARR=IMS_XY-${XY}-Z-${Z}-T-${T}-C-${C}-XYC-${XC}-ZC-${ZC}.ome.zarr
TIFF=IMS_XY-${XY}-Z-${Z}-T-${T}-C-${C}-XYC-${XC}-ZC-${ZC}.ome.tiff
BF2RAW=/opt/conda/bin/bioformats2raw
RAW2OMETIFF=/opt/conda/bin/raw2ometiff
echo IMS
time docker-compose run ${CLEAN} -v $DIR:$DIR \
generate $DIR \
$XY $Z $C $T $XC $ZC
echo ZARR
time docker-compose run ${CLEAN} -v $DIR:$DIR \
convert $BF2RAW \
--nested \
--chunk_depth $ZC \
--compression=raw \
$DIR/$IMS \
$DIR/out \
-w $XC -h $XC
echo TIFF
time docker-compose run ${CLEAN} -v $DIR:$DIR \
convert $RAW2OMETIFF \
--compression=raw \
$DIR/out \
$DIR/$TIFF
docker-compose run ${CLEAN} -v $DIR:$DIR \
convert mv \
$DIR/out/0 \
$DIR/$ZARR
docker-compose run ${CLEAN} -v $DIR:$DIR \
convert dd bs=1 count=1 if=/dev/random of=$DIR/1-byte