-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathDataFormats.html
More file actions
329 lines (215 loc) · 14.3 KB
/
Copy pathDataFormats.html
File metadata and controls
329 lines (215 loc) · 14.3 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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!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>PYME Data Formats — 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="PYME Metadata" href="metadata.html" />
<link rel="prev" title="Modifying PYMEAcquire and writing hardware drivers" href="ModifyingPYMEAcquire.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>
<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"><a class="reference internal" href="component_programs.html">Common Tasks</a></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="hacking.html">Extending PYME and writing plugins</a> »</li>
<li>PYME Data Formats</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="pyme-data-formats">
<span id="dataformats"></span><h1>PYME Data Formats<a class="headerlink" href="#pyme-data-formats" title="Permalink to this headline">¶</a></h1>
<div class="section" id="pyme-hdf5-h5">
<h2>PYME HDF5 (<code class="docutils literal notranslate"><span class="pre">.h5</span></code>)<a class="headerlink" href="#pyme-hdf5-h5" title="Permalink to this headline">¶</a></h2>
<p>This is the default format for saving streamed image data, and is based on
<a class="reference external" href="http://www.hdfgroup.org/HDF5/">HDF5</a>, an open format for scientific data storage.
HDF5 is a very flexible format, and PYME defines a root level dataset called <cite>ImageData</cite>
containg the raw image data, stores metadata in a group called <cite>MetaData</cite>, containing a
number of nested groups, and optionally an additional dataset called <cite>Events</cite> which
details events which happened during the acquisition (eg focus changes and protocol tasks).</p>
<p>Running <cite>h5ls</cite> on an example file gives the following output. Note that the dimension order for ImageData is Z/T, X, Y:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>DB3:~ david$ h5ls -r /Users/david/PYMEData/david/2016_11_30/30_11_series_A.h5
/ Group
/Events Dataset <span class="o">{</span><span class="m">3</span>/Inf<span class="o">}</span>
/ImageData Dataset <span class="o">{</span><span class="m">258</span>/Inf, <span class="m">1024</span>, <span class="m">256</span><span class="o">}</span>
/MetaData Group
/MetaData/Camera Group
/MetaData/Lasers Group
/MetaData/Lasers/l405 Group
/MetaData/Lasers/l488 Group
/MetaData/Positioning Group
/MetaData/Protocol Group
/MetaData/StackSettings Group
/MetaData/voxelsize Group
</pre></div>
</div>
<div class="topic">
<p class="topic-title first">Why HDF5?</p>
<p>Whilst HDF5 is used extensively for scientific data in the areas of geophysics
and astronomy, it is not currently particularly popular amoungst microscopists
with the default microscopy format being tiff. In deciding to use HDF5, the more
pertinent question might be <strong>Why not tiff?</strong> There are a number of quite
compelling reasons not to use tiff:</p>
<ul class="simple">
<li>Although TIFF is nominally a standardised format, very few (if any) programs
support the full tiff standard, making writing portable tiffs a non-trivial
proposition</li>
<li>Tiffs are limited in size to 2GB. Our raw data files are often ~ 6GB or more.
In principle this can be circumvented by saving each frame as an individual
file rather than in a multi-page tiff, but this runs into scalability issues
well before the 2GB limit (at ~1000 frames on windows/NTFS) due to filesystem issues
(file access becomes very slow due to the time taken to search through all
the file nodes in the directory and the disk becomes very fragmented).</li>
<li>Support for metadata and other accompanying information such as events is poor,
with the only real options being to write out an accompanying metadata file,
or to bastardise some of the existing tags (ala ImageJ) both of which negate
any portability advantages and invite data loss when copying/editing images.</li>
<li>Python support for TIFF leaves much to be desired, with the methods for
writing multi-page tiffs being poor and clunky at best, as well as usually
requiring the entire image sequence to be held in memory.</li>
</ul>
<p>By contrast, HDF5 offers:</p>
<ul class="simple">
<li>A flexible, open, self describing format</li>
<li>Well supported in Python, ImageJ (with a plugin), Matlab, and IDL (although
the IDL support is broken in some versions)</li>
<li>Unlimited file sizes</li>
<li>Transparent lossless compression (we get a factor of ~3 on image data)</li>
<li>High performance IO with atomic writes (ie if the acquisition program crashes
the data taken up to the point of the crash will be safe)</li>
</ul>
</div>
</div>
<div class="section" id="hdf5-results-h5r">
<h2>HDF5 Results (<code class="docutils literal notranslate"><span class="pre">.h5r</span></code>)<a class="headerlink" href="#hdf5-results-h5r" title="Permalink to this headline">¶</a></h2>
<p>This is the format in which analysis is stored. Like PYME H5 it is based on HDF5,
but rather than having an <em>ImageData</em> dataset, it has one called <em>FitResults</em> which
contains the fitted positions of all single molecule events. The <em>MetaData</em> and
<em>Events</em> are copied from the data file.</p>
</div>
<div class="section" id="tiff-tif">
<h2>TIFF (<code class="docutils literal notranslate"><span class="pre">.tif</span></code>)<a class="headerlink" href="#tiff-tif" title="Permalink to this headline">¶</a></h2>
<p>PYME supports <code class="docutils literal notranslate"><span class="pre">.tif</span></code> as a format for saving individual images and stacks, but not
for spooling (see above). There is preliminary support for analysing data stored as
TIFF stacks.</p>
</div>
<div class="section" id="psf-files-psf">
<h2>PSF Files (<code class="docutils literal notranslate"><span class="pre">.psf</span></code>)<a class="headerlink" href="#psf-files-psf" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">.psf</span></code> files are the result of extracting a psf from bead data and are used both
for 3D fitting and deconvolution. They consist of a python pickle object containing
the PSF data as a numpy array and a voxelsize definition.</p>
</div>
<div class="section" id="shiftfield-files-sf">
<h2>Shiftfield files (<code class="docutils literal notranslate"><span class="pre">.sf</span></code>)<a class="headerlink" href="#shiftfield-files-sf" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">.sf</span></code> files are saved vector shift fields used for correction of chromatic shift
in multi-colour imaging. Again, a python pickle.</p>
</div>
<div class="section" id="metadata-json-md-xml">
<h2>Metadata (<code class="docutils literal notranslate"><span class="pre">.json</span></code>, <code class="docutils literal notranslate"><span class="pre">.md</span></code>, <code class="docutils literal notranslate"><span class="pre">.xml</span></code>)<a class="headerlink" href="#metadata-json-md-xml" title="Permalink to this headline">¶</a></h2>
<p>PYME supports metadata in a number of formats, for more details see <a class="reference internal" href="metadata.html#metadata"><span class="std std-ref">PYME Metadata</span></a>.</p>
</div>
<div class="section" id="pyme-recipes-yaml">
<h2>PYME Recipes (<code class="docutils literal notranslate"><span class="pre">.yaml</span></code>)<a class="headerlink" href="#pyme-recipes-yaml" title="Permalink to this headline">¶</a></h2>
<p>These are used to store the details of processing pipelines used for either
standard (e.g. confocal) data analysis or for postprocessing super-resolution
reconstructions.</p>
</div>
<div class="section" id="pyme-compressed-images-pzf">
<h2>PYME Compressed Images (<code class="docutils literal notranslate"><span class="pre">.pzf</span></code>)<a class="headerlink" href="#pyme-compressed-images-pzf" title="Permalink to this headline">¶</a></h2>
<p>These are a very minimal container for images compressed with our experimental high performance lossy compression
protocol. They consist of a minimal header followed by the compressed data and are mostly designed as ‘wire’ protocol
for data transfer to and within our cluster. It is also our on disk storage format within the cluster, and can be embedded
within HDF5 files (at the expense of loosing portability). For further documentation see <a class="reference internal" href="api/PYME.IO.PZFFormat.html#module-PYME.IO.PZFFormat" title="PYME.IO.PZFFormat"><code class="xref py py-mod docutils literal notranslate"><span class="pre">PYME.IO.PZFFormat</span></code></a>.</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="metadata.html" class="btn btn-neutral float-right" title="PYME Metadata" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="ModifyingPYMEAcquire.html" class="btn btn-neutral float-left" title="Modifying PYMEAcquire and writing hardware drivers" 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>