Skip to content

Commit 4f7a8d8

Browse files
committed
Add an example computing an image's average color.
1 parent c1ac4a6 commit 4f7a8d8

File tree

7 files changed

+499
-0
lines changed

7 files changed

+499
-0
lines changed

example-average-color/.dockerignore

Lines changed: 329 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,329 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
3+
### Vim template
4+
# swap
5+
[._]*.s[a-w][a-z]
6+
[._]s[a-w][a-z]
7+
# session
8+
Session.vim
9+
# temporary
10+
.netrwhist
11+
*~
12+
13+
# auto-generated tag files
14+
tags
15+
16+
### Cpp template
17+
# Compiled Object files
18+
*.slo
19+
*.lo
20+
*.o
21+
*.obj
22+
23+
# Precompiled Headers
24+
*.gch
25+
*.pch
26+
27+
# Compiled Dynamic libraries
28+
*.so
29+
*.dylib
30+
*.dll
31+
32+
# Fortran module files
33+
*.mod
34+
*.smod
35+
36+
# Compiled Static libraries
37+
*.lai
38+
*.la
39+
*.a
40+
*.lib
41+
42+
# Executables
43+
*.exe
44+
*.out
45+
*.app
46+
47+
### CMake template
48+
CMakeCache.txt
49+
CMakeFiles
50+
CMakeScripts
51+
Makefile
52+
cmake_install.cmake
53+
install_manifest.txt
54+
CTestTestfile.cmake
55+
56+
### Emacs template
57+
# -*- mode: gitignore; -*-
58+
*~
59+
\#*\#
60+
/.emacs.desktop
61+
/.emacs.desktop.lock
62+
*.elc
63+
auto-save-list
64+
tramp
65+
.\#*
66+
67+
# Org-mode
68+
.org-id-locations
69+
*_archive
70+
71+
# flymake-mode
72+
*_flymake.*
73+
74+
# eshell files
75+
/eshell/history
76+
/eshell/lastdir
77+
78+
# elpa packages
79+
/elpa/
80+
81+
# reftex files
82+
*.rel
83+
84+
# AUCTeX auto folder
85+
/auto/
86+
87+
# cask packages
88+
.cask/
89+
dist/
90+
91+
# Flycheck
92+
flycheck_*.el
93+
94+
# server auth directory
95+
/server/
96+
97+
# projectiles files
98+
.projectile### VirtualEnv template
99+
# Virtualenv
100+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
101+
.Python
102+
[Bb]in
103+
[Ii]nclude
104+
[Ll]ib
105+
[Ll]ib64
106+
[Ll]ocal
107+
[Ss]cripts
108+
pyvenv.cfg
109+
.venv
110+
pip-selfcheck.json
111+
112+
### Linux template
113+
*~
114+
115+
# temporary files which can be created if a process still has a handle open of a deleted file
116+
.fuse_hidden*
117+
118+
# KDE directory preferences
119+
.directory
120+
121+
# Linux trash folder which might appear on any partition or disk
122+
.Trash-*
123+
124+
### C template
125+
# Object files
126+
*.o
127+
*.ko
128+
*.obj
129+
*.elf
130+
131+
# Precompiled Headers
132+
*.gch
133+
*.pch
134+
135+
# Libraries
136+
*.lib
137+
*.a
138+
*.la
139+
*.lo
140+
141+
# Shared objects (inc. Windows DLLs)
142+
*.dll
143+
*.so
144+
*.so.*
145+
*.dylib
146+
147+
# Executables
148+
*.exe
149+
*.out
150+
*.app
151+
*.i*86
152+
*.x86_64
153+
*.hex
154+
155+
# Debug files
156+
*.dSYM/
157+
*.su
158+
159+
### Windows template
160+
# Windows image file caches
161+
Thumbs.db
162+
ehthumbs.db
163+
164+
# Folder config file
165+
Desktop.ini
166+
167+
# Recycle Bin used on file shares
168+
$RECYCLE.BIN/
169+
170+
# Windows Installer files
171+
*.cab
172+
*.msi
173+
*.msm
174+
*.msp
175+
176+
# Windows shortcuts
177+
*.lnk
178+
179+
### KDevelop4 template
180+
*.kdev4
181+
.kdev4/
182+
183+
### Python template
184+
# Byte-compiled / optimized / DLL files
185+
__pycache__/
186+
*.py[cod]
187+
*$py.class
188+
189+
# C extensions
190+
*.so
191+
192+
# Distribution / packaging
193+
.Python
194+
env/
195+
build/
196+
develop-eggs/
197+
dist/
198+
downloads/
199+
eggs/
200+
.eggs/
201+
lib/
202+
lib64/
203+
parts/
204+
sdist/
205+
var/
206+
*.egg-info/
207+
.installed.cfg
208+
*.egg
209+
210+
# PyInstaller
211+
# Usually these files are written by a python script from a template
212+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
213+
*.manifest
214+
*.spec
215+
216+
# Installer logs
217+
pip-log.txt
218+
pip-delete-this-directory.txt
219+
220+
# Unit test / coverage reports
221+
htmlcov/
222+
.tox/
223+
.coverage
224+
.coverage.*
225+
.cache
226+
nosetests.xml
227+
coverage.xml
228+
*,cover
229+
.hypothesis/
230+
231+
# Translations
232+
*.mo
233+
*.pot
234+
235+
# Django stuff:
236+
*.log
237+
local_settings.py
238+
239+
# Flask stuff:
240+
instance/
241+
.webassets-cache
242+
243+
# Scrapy stuff:
244+
.scrapy
245+
246+
# Sphinx documentation
247+
docs/_build/
248+
249+
# PyBuilder
250+
target/
251+
252+
# IPython Notebook
253+
.ipynb_checkpoints
254+
255+
# pyenv
256+
.python-version
257+
258+
# celery beat schedule file
259+
celerybeat-schedule
260+
261+
# dotenv
262+
.env
263+
264+
# virtualenv
265+
venv/
266+
ENV/
267+
268+
# Spyder project settings
269+
.spyderproject
270+
271+
# Rope project settings
272+
.ropeproject
273+
274+
### Xcode template
275+
# Xcode
276+
#
277+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
278+
279+
## Build generated
280+
build/
281+
DerivedData/
282+
283+
## Various settings
284+
*.pbxuser
285+
!default.pbxuser
286+
*.mode1v3
287+
!default.mode1v3
288+
*.mode2v3
289+
!default.mode2v3
290+
*.perspectivev3
291+
!default.perspectivev3
292+
xcuserdata/
293+
294+
## Other
295+
*.moved-aside
296+
*.xccheckout
297+
*.xcscmblueprint
298+
299+
### NodeJS template
300+
# Logs
301+
logs
302+
*.log
303+
npm-debug.log*
304+
305+
# Runtime data
306+
pids
307+
*.pid
308+
*.seed
309+
310+
# Directory for instrumented libs generated by jscoverage/JSCover
311+
lib-cov
312+
313+
# Coverage directory used by tools like istanbul
314+
coverage
315+
316+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
317+
.grunt
318+
319+
# node-waf configuration
320+
.lock-wscript
321+
322+
# Compiled binary addons (http://nodejs.org/api/addons.html)
323+
build/Release
324+
325+
# Dependency directory
326+
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
327+
node_modules
328+
329+

example-average-color/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.9-slim
2+
MAINTAINER David Manthey <[email protected]>
3+
4+
RUN pip install --find-links https://girder.github.io/large_image_wheels large_image[sources]
5+
RUN pip install --pre girder-slicer-cli-web
6+
7+
COPY . $PWD
8+
ENTRYPOINT ["python", "./cli_list.py"]

example-average-color/README.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
This is an example docker with a few inputs and outputs that computes the
2+
average color of a large image.
3+
4+
To build, use docker in this directory::
5+
6+
docker build --force-rm -t girder/slicer_cli_web:average_color .
7+
8+
To run, you'll need an image that can be read by the large_image library.
9+
You can run this as a command line, mounting a directory for input and output,
10+
like so::
11+
12+
docker run --rm -t -v /local/image/path:/input:ro -v /local/output/path:/output --rm -it girder/slicer_cli_web:average_color average_color /input/sample_image.svs /output/annotation.json --returnparameterfile /output/results.txt --channel=red
13+
14+
You can also enumerate available algorithms::
15+
16+
docker run --rm -t girder/slicer_cli_web:average_color --list_cli
17+
18+
And get help for the one available algorithm::
19+
20+
docker run --rm -t girder/slicer_cli_web:average_color average_color --help
21+
22+

0 commit comments

Comments
 (0)