diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3ca0cea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,64 @@ +FROM python:3.6.9-stretch + +# --------------------------------------------------------------------------------------------------------------------- +# Install Java +RUN apt-get update && apt-get install openjdk-8-jdk -y && apt-get clean + +# --------------------------------------------------------------------------------------------------------------------- +# Install Cytomine python client +RUN git clone https://github.com/cytomine-uliege/Cytomine-python-client.git && \ + cd /Cytomine-python-client && git checkout tags/v2.3.0.poc.1 && pip install . && \ + rm -r /Cytomine-python-client + +# --------------------------------------------------------------------------------------------------------------------- +# Install Neubias-W5-Utilities (annotation exporter, compute metrics, helpers,...) +RUN apt-get update && apt-get install libgeos-dev -y && apt-get clean +RUN git clone https://github.com/Neubias-WG5/neubiaswg5-utilities.git && \ + cd /neubiaswg5-utilities/ && git checkout tags/v0.8.8 && pip install . + +# install utilities binaries +RUN chmod +x /neubiaswg5-utilities/bin/* +RUN cp /neubiaswg5-utilities/bin/* /usr/bin/ + +# cleaning +RUN rm -r /neubiaswg5-utilities + +# --------------------------------------------------------------------------------------------------------------------- +# Install FIJI +# Install virtual X server +RUN apt-get update && apt-get install -y unzip xvfb libx11-dev libxtst-dev libxrender-dev + +# Install Fiji. +RUN wget https://downloads.imagej.net/fiji/Life-Line/fiji-linux64-20170530.zip +RUN unzip fiji-linux64-20170530.zip +RUN mv Fiji.app/ fiji + +# create a sym-link with the name jars/ij.jar that is pointing to the current version jars/ij-1.nm.jar +RUN cd /fiji/jars && ln -s $(ls ij-1.*.jar) ij.jar + +# Add fiji to the PATH +ENV PATH $PATH:/fiji + +RUN mkdir -p /fiji/data + +# Clean up +RUN rm fiji-linux64-20170530.zip + +# --------------------------------------------------------------------------------------------------------------------- +# ImageJ plugin +# install FeatureJ +RUN cd /fiji/plugins && \ + wget -O imagescience.jar \ + https://imagescience.org/meijering/software/download/imagescience.jar + +RUN cd /fiji/plugins && \ + wget -O FeatureJ_.jar \ + https://imagescience.org/meijering/software/download/FeatureJ_.jar + +# --------------------------------------------------------------------------------------------------------------------- +# add the local files +ADD LapClosetPartTracker.ijm /fiji/macros/macro.ijm +ADD wrapper.py /app/wrapper.py + +# set the entrypoint +ENTRYPOINT ["python", "/app/wrapper.py"] diff --git a/LapClosetPartTracker.ijm b/LapClosetPartTracker.ijm new file mode 100644 index 0000000..5330345 --- /dev/null +++ b/LapClosetPartTracker.ijm @@ -0,0 +1,97 @@ +// Author: Sébastien Tosi (IRB Barcelona) +// Contact: sebastien.tosi@irbbarcelona.org +// Version: 1.0 +// Date: 27/12/2019 + +// Path to input image and results +inputDir = "C:\\Users\\Seb\\Desktop\\in"; +outputDir = "C:\\Users\\Seb\\Desktop\\out"; + +// Parameters for Cytopacq time-lapse +LapRad = 9; +Thr = 0.05; + +// Read arguments from command line +arg = getArgument(); +parts = split(arg, ","); +for(i=0; i-1) inputDir=nameAndValue[1]; + if (indexOf(nameAndValue[0], "output")>-1) outputDir=nameAndValue[1]; + if (indexOf(nameAndValue[0], "LapRad")>-1) LapRad=nameAndValue[1]; + if (indexOf(nameAndValue[0], "Thr")>-1) Thr=nameAndValue[1]; +} + +images = getFileList(inputDir); +for(img=0; img