-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbioformatsToOmeTIFF.Dockerfile
43 lines (36 loc) · 1.76 KB
/
bioformatsToOmeTIFF.Dockerfile
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
# build via
# docker build --force-rm -t kitware/bioometiff -f bioformatsToOmeTIFF.Dockerfile .
# run something like
# docker run --rm -it -v /mnt/data2:/data kitware/bioometiff /data/NCISEER/Mouse/SEER_Mouse_1_17158538.svs --rgb --compression=JPEG --quality=70 /data/SEER_Mouse_1_17158538.ome.tiff
# Make sure the output file does not exist; otherwise, it will get appended to
# rather than replaced.
# Contrary to the --help statement, compression options are
# NONE, LZW, JPEG, JPEG-2000, 'JPEG-2000 Lossy'
# For JPEG-2000 Lossy, quality is a floating point number of bits per sample in
# the compressed data stream (e.g., from 0 to the bits per sample of the
# image).
# JPEG compression duplicates the jpeg headers, greatly increasing the output
# file size over what is expected.
FROM python:3.12-slim
RUN apt-get update && \
apt-get install -y \
curl \
less \
libblosc1 \
unzip \
vim \
&& true
RUN pip install large-image-source-bioformats --find-links https://girder.github.io/large_image_wheels
RUN mkdir /project && \
cd /project && \
curl -L https://github.com/glencoesoftware/bioformats2raw/releases/download/v0.9.4/bioformats2raw-0.9.4.zip -o bioformats2raw.zip && \
unzip bioformats2raw.zip && \
mv bioformats2raw-0.9.4 bioformats2raw && \
curl -L https://github.com/glencoesoftware/raw2ometiff/releases/download/v0.7.1/raw2ometiff-0.7.1.zip -o raw2ometiff.zip && \
unzip raw2ometiff.zip && \
mv raw2ometiff-0.7.1 raw2ometiff && \
true
WORKDIR /project
RUN echo 'bioformats2raw/bin/bioformats2raw --max-workers=`nproc` --target-min-size=1024 --progress "$1" /tmp/output' > /project/run.sh && \
echo 'raw2ometiff/bin/raw2ometiff --progress /tmp/output "${@:2}"' >> /project/run.sh
ENTRYPOINT ["bash", "/project/run.sh"]