-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathRecipes.html
More file actions
303 lines (189 loc) · 13.6 KB
/
Copy pathRecipes.html
File metadata and controls
303 lines (189 loc) · 13.6 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Using recipes for data processing and quantification — PYME 20.02.12 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Distance transform colocalization HOWTO" href="howtos/distancecolocalization.html" />
<link rel="prev" title="PSF Extraction" href="PSFExtraction.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> PYME
<img src="_static/pymeLogo.png" class="logo" alt="Logo"/>
</a>
<div class="version">
20.02.12
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Installation</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Installation/InstallationWithAnaconda.html">Installation of PYME on 64 bit Windows, OSX, or Linux</a></li>
<li class="toctree-l1"><a class="reference internal" href="Installation/InstallationFromSource.html">Installation for development or instrument control</a></li>
</ul>
<p class="caption"><span class="caption-text">User Guide</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="PYMEAcquire.html"><strong>PYMEAcquire</strong> - Instrument control and simulation</a></li>
<li class="toctree-l1"><a class="reference internal" href="Analysis.html"><strong>dh5view</strong> - Image Data Analysis and Viewing</a></li>
<li class="toctree-l1"><a class="reference internal" href="VisGUI.html"><strong>VisGUI</strong> - Visualising Localization Data Sets</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="component_programs.html">Common Tasks</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="LocalisationAnalysis.html">Analysing Localisation Microscopy data</a></li>
<li class="toctree-l2"><a class="reference internal" href="PSFExtraction.html">PSF Extraction</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Using recipes for data processing and quantification</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#connections-between-modules-execution-order-and-dependencies">Connections between modules, execution order, and dependencies</a></li>
<li class="toctree-l3"><a class="reference internal" href="#creating-and-running-recipes">Creating and running recipes</a></li>
<li class="toctree-l3"><a class="reference internal" href="#batch-processing">Batch Processing</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#command-line-interface">Command line interface</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="howtos/distancecolocalization.html">Distance transform colocalization HOWTO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="LocalisationAnalysis.html">Analysing Localisation Microscopy data</a></li>
</ul>
<p class="caption"><span class="caption-text">Development / Hacking</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="hacking.html">Extending PYME and writing plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="hacking.html#technical-details">Technical Details</a></li>
<li class="toctree-l1"><a class="reference internal" href="hacking.html#api-documentation">API Documentation</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">PYME</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="component_programs.html">Common Tasks</a> »</li>
<li>Using recipes for data processing and quantification</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="using-recipes-for-data-processing-and-quantification">
<h1>Using recipes for data processing and quantification<a class="headerlink" href="#using-recipes-for-data-processing-and-quantification" title="Permalink to this headline">¶</a></h1>
<p>Recipes are an experimental feature of PYME for automating image post-processing and anaylsis tasks, for both
super-resolution and conventional microscopy data. They allow you do define a processing workflow consisting of multiple
different tasks such as filtering or quantification and to run each of these tasks automatically over a set of images.
The concept is broadly similar to the ‘block’ or ‘pipeline’ processing models used in e.g. OpenInventor, Simulink,
Khorus/Cantata, or CellProfiler. My motivation behind developing recipes was to allow image processing scripts to be
written quickly without having to worry about file I/O, and keeping track of e.g. metadata, and for these scripts to be
able to be run in a variety of environments, with or without a GUI. The principle conceptual differences are thus:</p>
<blockquote>
<div><ul class="simple">
<li>PYME recipes have been designed around an easily edited textual representation (although a GUI is also available).</li>
<li>Image metadata (e.g. pixel sizes) is automatically propagated with the images.</li>
<li>many modules are very thin wrappers around the corresponding functions in either scipy or scikits-image.</li>
</ul>
</div></blockquote>
<p>An example of a recipe (as displayed in the GUI) is shown below.</p>
<img alt="_images/recipe.png" src="_images/recipe.png" />
<div class="section" id="connections-between-modules-execution-order-and-dependencies">
<h2>Connections between modules, execution order, and dependencies<a class="headerlink" href="#connections-between-modules-execution-order-and-dependencies" title="Permalink to this headline">¶</a></h2>
<p>Recipes differ from many of the existing block or pipeline architectures in that connections between modules and the
order in which modules are executed are both defined implicitly. Inputs and outputs to each module are assigned names,
or keys, which are then used to find locate each modules input data in a common namespace (implemented as a python
dictionary) and to store the modules output(s) in the same namespace. The connections between modules are then inferred
by matching input and output names, and the execution order determined using a dependency solver such that modules do
not execute before their inputs have been generated. This allows for a compact and quickly adaptable representation of
the recipe, which can easily be altered without having to manually re-connect a complex net. To link two modules, you
simply have to set the input name on the second module to the output name of the first.</p>
<p>Module names can be pretty much anything you choose, and should be descriptive. Avoiding spaces and non-alphanumeric
characters however is advised, particularly for input and output names. When used for batch processing, all names
beginning with <strong>in</strong> are considered to be inputs, and all names beginning with <strong>out</strong> are marked as outputs, and will
be saved to disk in the output directory. When operating within <em>dh5view</em>, recipes currently only support one input
(called <strong>input</strong>) and one output (<strong>output</strong>). In this case the <strong>input</strong> image is the currently open image, and the
<strong>output</strong> is displayed in a new window (or, in the case of measurement data as annotations to the current image).</p>
</div>
<div class="section" id="creating-and-running-recipes">
<h2>Creating and running recipes<a class="headerlink" href="#creating-and-running-recipes" title="Permalink to this headline">¶</a></h2>
<p>Recipes can be visually constructed using the PYME bakeshop. The bakeshop is opened by running</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>bakeshop
</pre></div>
</div>
<p>Recipe modules can then be added using the “Add Module” button, which will bring up a menu of module choices. Clicking
any of these modules displays documentation about the module and its parameters. After selecting the desired module,
clicking “Add” will open a dialog to enter input/output parameters for the recipe module. Once these parameters are
entered, the module can be added by clicking “OK”.</p>
<p>Modules can be edited once they have already been added either visually by clicking on the recipe module tile or
textually using the yaml-formatted text on the right-hand side of the bakeshop GUI. If you edit the recipe textually,
please press “Apply” before running or saving the recipe or your changes will be ignored.</p>
<p>Once the recipe is built, it can be saved or run directly in the bakeshop GUI. To run the recipe, enter the file pattern
in order to select the input files (e.g. <code class="docutils literal notranslate"><span class="pre">~/*.h5r</span></code> to select all h5r files in the top of the user’s home directory) before
clicking “Get Matches”. Enter the desired output directory where indicated before pressing “Bake”.</p>
</div>
<div class="section" id="batch-processing">
<h2>Batch Processing<a class="headerlink" href="#batch-processing" title="Permalink to this headline">¶</a></h2>
<p>Batch processing allows you to automatically run a pre-defined recipe over a series of input files.</p>
<div class="section" id="command-line-interface">
<h3>Command line interface<a class="headerlink" href="#command-line-interface" title="Permalink to this headline">¶</a></h3>
<p>The command line interface to batch processing is the script located at <code class="docutils literal notranslate"><span class="pre">PYME/Analysis/Modules/batchProcess.py</span></code>, and
can be called, for example as follows:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python /path/to/batchProcess.py -input1<span class="o">=</span>/path/to/input/channel1*.tif -input2<span class="o">=</span>/path/to/input/channel2*.tif recipe.yaml /path/to/output/dir
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="howtos/distancecolocalization.html" class="btn btn-neutral float-right" title="Distance transform colocalization HOWTO" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="PSFExtraction.html" class="btn btn-neutral float-left" title="PSF Extraction" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2016, David Baddeley
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>