Analysing data not generated by PYMEAcquire

There are two key aspects to analysing data not generated by PYME - getting the data into a format that PYME understands, and filling in the required metadata entries.

There are two principle ways of doing this:

Directly analysing the data (reccomended method)

PYME supports analysing directly from tiff stacks (all time points in one file) and from sequences of individual tiffs (each frame is a seperate file). PYME also makes use of image metadata such as the pixel size and various camera properties. PYME supports a number of ways of specifying the metadata, but the easiest is to create a .md file for each image you want to analyse (or to copy a template and just change the bits which are different).

This file should consist of a number of lines having the syntax:

md['entryname'] = value

The metadata entries are heirachial and use a dot notation (eg Camera.ADOffset)

Required Metadata Entries

An absolute minimum set of metadata parameters is outlined below:




x pixel size in μm


y pixel size in μm


The calibrated electron multiplying gain (1 for ordinary CCDs and sCMOS)


EM excess noise factor (1.41 for EMCCDs, 1 for standard CCDs / sCMOS). See doi:10.1109/TED.2003.813462


Number of photo-electrons per camera count (ADU)


Read out noise (standard deviation) in photoelectrons (e-).


Analog to digital offset (dark level, or average value of camera pixels when no light is incident) in ADU. Not strictly required as PYME will try and guess this from dark frames at the beginning of the sequence, but unless your acquisition is a very good match to the PYMEAcquire protocols this is unlikely to work well.

Tiff Stacks

For tiff stacks the .md file ought to be in the same directory and have the same name (modulo extension) as the .tif file

Once you’ve created the .md file, just launch:

dh5view -m LM <filename>.tif

if you want to perform localisation microscopy analysis, or:

dh5view <filename>.tif

for psf extraction, deconvolution, or other general purpose image processing tasks (the `` -m LM`` option launches dh5view in it’s localisation analysis personality).

Tiff Sequences

For tiff sequences, the metadata file requires an additional entry, SeriesPattern, which identifies the files which comprise the sequence. This is a wildcard string - if for example, your data is in Frame001.tif, Frame002.tif, Frame003.tif etc … a reasonable pattern could be

md['SeriesPattern'] = 'Frame*.tif'

This means that the .md file doesn’t need to have the same name as the individual data files, and you now load the .md file rather than one of the .tif images. Eg.:

dh5view -m LM <filename>.md

Tweaking the metadata

Once you have loaded the data one can further tweak the metadata (using the Metadata tab) of dh5view. Missing entries can to be added in the command window by executing:

image.mdh['entryname'] = value

Unfortunately these changes don’t persist (following the rational that raw data should be immutable) and will need to be re-entered each time you load and analyse the data - change the .md file, or export the data as PYMEs native .h5 format if you want to keep the changes.

Converting the data to PYMEs native .h5 or .pcs formats (old method)

This is generally not recommended, as it’s more work for the user. Load the data into dh5view, fill out all the metadata, and save to either .h5 or to the cluster. You might want to consider this if you want to take advantage of our file compression. It might also give small improvements to analysis speed and memory usage (although in practice this is likely to be offset by the time it takes to convert).