Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openseadragon viewer for render service #124

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ COPY . /var/www/render/
RUN mvn clean

# use -T 1C option to multi-thread maven, using 1 thread per available core
RUN mvn -T 1C -Dproject.build.sourceEncoding=UTF-8 package && \
RUN mvn -T 1C -Dproject.build.sourceEncoding=UTF-8 -Dmaven.test.skip=true package && \
mkdir -p /root/render-lib && \
mv */target/*.*ar /root/render-lib && \
printf "\nsaved the following build artifacts:\n\n" && \
Expand All @@ -49,13 +49,13 @@ RUN mvn -T 1C -Dproject.build.sourceEncoding=UTF-8 package && \
# Once web service application is built, set up jetty server and deploy application to it.

# NOTE: jetty version should be kept in sync with values in render/render-ws/pom.xml and render/render-ws/src/main/scripts/install.sh
FROM jetty:9.4.43-jdk8-slim as render-ws
FROM jetty:9.4.9-jre8-alpine as render-ws

# add packages not included in alpine:
# curl and coreutils for gnu readlink
# fontconfig and ttf-dejavu for bounding box renderer ( see https://github.com/docker-library/openjdk/pull/202 )
USER root
RUN apt-get update && apt-get install -y curl coreutils fontconfig ttf-dejavu
RUN apk add --no-cache curl coreutils fontconfig ttf-dejavu

WORKDIR $JETTY_BASE

Expand All @@ -69,10 +69,10 @@ RUN ls -al $JETTY_BASE/* && \
COPY --from=builder /root/render-lib/render-ws-*.war webapps/render-ws.war
COPY render-ws/src/main/scripts/docker /render-docker
RUN chown -R jetty:jetty $JETTY_BASE

RUN chmod -R 777 $JETTY_BASE
EXPOSE 8080

ENV JAVA_OPTIONS="-Xms3g -Xmx3g -server -Djava.awt.headless=true" \
ENV JAVA_OPTIONS="-Xms45g -Xmx45g -server -Djava.awt.headless=true" \
JETTY_THREADPOOL_MIN_THREADS="10" \
JETTY_THREADPOOL_MAX_THREADS="200" \
LOG_ACCESS_ROOT_APPENDER="STDOUT" \
Expand All @@ -89,6 +89,12 @@ ENV JAVA_OPTIONS="-Xms3g -Xmx3g -server -Djava.awt.headless=true" \
NDVIZHOST="" \
NDVIZPORT="" \
NDVIZ_URL="" \
VIEW_OPENSEADRAGON_HOST_AND_PORT="" \
VIEW_DATA_PREP="" \
VIEW_DATA_PREPSH="" \
VIEW_OPENSEADRAGON_DATA_HOST="" \
VIEW_OPENSEADRAGON_DATA_SOURCE_FOLDER="" \
VIEW_OPENSEADRAGON_DATA_DESTINATION_FOLDER="" \
VIEW_CATMAID_HOST_AND_PORT="" \
VIEW_DYNAMIC_RENDER_HOST_AND_PORT="" \
VIEW_RENDER_STACK_OWNER="" \
Expand Down
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,42 @@ A collection of Java tools and HTTP services (APIs) for rendering transformed im
[render application]: <docs/src/site/markdown/render-app.md>
[render web services]: <docs/src/site/markdown/render-ws.md>
[RESTful APIs]: <docs/src/site/markdown/render-ws-api/render-ws-api.md>
[Docker packaging]: <docs/src/site/markdown/render-ws-docker.md>
[Docker packaging]: <docs/src/site/markdown/render-ws-docker.md>


# Openseadragon Viewer for Render service:

In this branch Openseadragon Viewer feature is developed for the Render Service.

Openseadragon is a web-based viewer for high resolution zoomable images implemented in Javascript. To know more about it please refer (https://openseadragon.github.io/)

In this branch Rendered images are converted to Deep Zoom images to feed into openseadragon viewer.

MagickSlicer is used to convert the rendered images to DZI(Deep Zoom Images) (https://github.com/VoidVolker/MagickSlicer)

The Rendered images and the converted DZI images are stored on a http server, which are used by openseadragon viewer.

A python script is used to run the DZI image convertion pipeline on the HPC cluster. This python script needs to be placed on HPC Cluster and
the file path should be provided as the parameter in the Dockerfile.

Here are the parameters which should be provided in Dockerfile to enable openseadragon viewer feature.

VIEW_OPENSEADRAGON_HOST_AND_PORT="" (render-ws/src/main/webapp/view/openseadragon.html file web URL)
VIEW_DATA_PREP="" \ (python file Path on the HPC cluster, openseadragon/derived_data_preparation_code/data_preparation.py)
VIEW_DATA_PREPSH="" \ (magick-slicer shell script path which is placed on HPC cluster, https://github.com/VoidVolker/MagickSlicer)
VIEW_OPENSEADRAGON_DATA_HOST="" \ (HTTP webserver where the rendered and DZI images are placed)
VIEW_OPENSEADRAGON_DATA_SOURCE_FOLDER="" \ (rendered images path on HPC cluster or http webserver link)
VIEW_OPENSEADRAGON_DATA_DESTINATION_FOLDER="" \ (Destination folder PATH on the HPC cluster)


In this branch, there is feature where you can submit a job to the cluster to convert rendered images to DZI images, cluster details and credentials can be provided through the user interface in stacks.html page.

you can view the DZI images of the stacks in the openseadragon viewer by clicking on 'view in openseadragon' hyperlink in the stacks section.








57 changes: 0 additions & 57 deletions docs/docs.iml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
Administrative elements required by org.scijava.maven.plugin.enforcer.RequireElements
that have to be copied. Too bad they can't just be taken from parent pom.
-->
<url>https://github.com/saalfeldlab/render</url>
<url>https://github.com/sukeshsangam/render</url>
<inceptionYear>2014</inceptionYear>
<organization><name>see parent</name></organization>
<licenses><license><name>see parent</name></license></licenses>
Expand All @@ -69,4 +69,4 @@
<license.copyrightOwners>Howard Hughes Medical Institute</license.copyrightOwners>
</properties>

</project>
</project>
Binary file not shown.
1 change: 1 addition & 0 deletions openseadragon/derived_data_preparation_code/MagickSlicer
Submodule MagickSlicer added at 1281bd
24 changes: 24 additions & 0 deletions openseadragon/derived_data_preparation_code/data_preparation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import urllib.request
import sys
import json
import os
import smtplib
from pathlib import Path
response = urllib.request.urlopen('http://'+sys.argv[9]+'/render-ws/v1/owner/'+sys.argv[1]+'/project/'+sys.argv[2]+'/stack/'+sys.argv[3]+'/bounds')
data_json=json.loads(response.read())
width=int(data_json['maxX']-data_json['minX'])
height=int(data_json['maxY']-data_json['minY'])
X=data_json['minX']
Y=data_json['minY']
minZ=data_json['minZ']
maxZ=data_json['maxZ']
#os.system("pip3 install pymongo")
#os.system("pip3 install dnspython")
for z in range(int(minZ),int(maxZ+1)):
source_folder=sys.argv[8]+sys.argv[1]+"/"+sys.argv[2]+"/"+sys.argv[3]
Path(source_folder).mkdir(parents=True, exist_ok=True)
urllib.request.urlretrieve("http://"+sys.argv[9]+"/render-ws/v1/owner/"+sys.argv[1]+"/project/"+sys.argv[2]+"/stack/"+sys.argv[3]+"/z/"+str(z)+"/box/"+str(X)+","+str(Y)+","+str(width)+","+str(height)+",1/jpeg-image?scale=1", source_folder+"/"+sys.argv[1]+"_"+sys.argv[2]+"_"+sys.argv[3]+"_"+str(z)+".jpg")
destination_folder=sys.argv[6]+sys.argv[1]+"/"+sys.argv[2]+"/"+sys.argv[3]+"/"+sys.argv[1]+"_"+sys.argv[2]+"_"+sys.argv[3]+"_"+str(z)+".jpg"
Path(destination_folder).mkdir(parents=True, exist_ok=True)
os.system(sys.argv[5]+" "+source_folder+"/"+sys.argv[1]+"_"+sys.argv[2]+"_"+sys.argv[3]+"_"+str(z)+".jpg"+" "+destination_folder)

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<version>2.3.0</version>

<description>A collection of tools and HTTP services (APIs) for rendering transformed image tiles.</description>
<url>https://github.com/saalfeldlab/render</url>
<url>https://github.com/sukeshsangam/render.git</url>
<inceptionYear>2014</inceptionYear>
<organization>
<name>Janelia Research Campus</name>
Expand Down Expand Up @@ -79,7 +79,7 @@
</mailingLists>

<scm>
<url>https://github.com/saalfeldlab/render</url>
<url>https://github.com/sukeshsangam/render.git</url>
</scm>

<issueManagement>
Expand Down
2 changes: 1 addition & 1 deletion render-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
Administrative elements required by org.scijava.maven.plugin.enforcer.RequireElements
that have to be copied. Too bad they can't just be taken from parent pom.
-->
<url>https://github.com/saalfeldlab/render</url>
<url>https://github.com/sukeshsangam/render</url>
<inceptionYear>2014</inceptionYear>
<organization><name>see parent</name></organization>
<licenses><license><name>see parent</name></license></licenses>
Expand Down
67 changes: 0 additions & 67 deletions render-app/render-app.iml

This file was deleted.

2 changes: 1 addition & 1 deletion render-ws-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
Administrative elements required by org.scijava.maven.plugin.enforcer.RequireElements
that have to be copied. Too bad they can't just be taken from parent pom.
-->
<url>https://github.com/saalfeldlab/render</url>
<url>https://github.com/sukeshsangam/render</url>
<inceptionYear>2014</inceptionYear>
<organization><name>see parent</name></organization>
<licenses><license><name>see parent</name></license></licenses>
Expand Down
Loading