sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor...

19
SDmixer Open source software for 2D/3D multicolor single molecule localization-based super-resolution microscopy Documentation and Manual by Georgi Tadeus André Lampe Jan Schmoranzer Freie Universität Berlin and Leibniz Institut für Molekulare Pharmakologie Berlin April 2015 Correspondence: [email protected] Written by Georgi Tadeus: [email protected] Prebuild binaries can be downloaded at https://sourceforge.net/projects/sdmixer/ The source code is available at https://github.com/gtadeus/sdmixer2 27.04.2015 - v1.0

Transcript of sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor...

Page 1: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

SDmixer

Open source software for 2D/3D multicolor single molecule localization-based super-resolution microscopy

Documentation and Manual

by Georgi Tadeus André Lampe

Jan Schmoranzer

Freie Universität Berlin and Leibniz Institut für Molekulare Pharmakologie Berlin April 2015

Correspondence: [email protected]

Written by Georgi Tadeus: [email protected]

Prebuild binaries can be downloaded at https://sourceforge.net/projects/sdmixer/ The source code is available at https://github.com/gtadeus/sdmixer2 27.04.2015 - v1.0

Page 2: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration errors and chromatic aberrations. Here, we describe ‘SDmixer’, a versatile open-source software tool that enables any laboratory to perform rapid SD-based SMLM. SDmixer is based on a C++ code and runs on both Windows and Linux platforms. A graphic user interface (GUI) allows users to perform 2D or 3D spectral demixing on image stacks from any SML software (natively from rapidSTORM) and to reconstruct the super-resolved multicolor TIFF images with flexible output options. The experimental system and concept of spectral demixing (SD) has been described previously (Lampe A. et al. Biol. Cell 2012; Lampe A. et al. Meth. Appl. Fluor. 2015). Here, we provide a detailed documentation on how to use the SDmixer, including notes on important aspects and suggestions for starting parameters. The software tool SDmixer was developed by G. Tadeus at the Freie Universität Berlin and the Leibniz Institut für Molekulare Pharmakologie Berlin in C++ using the cross-platform framework Qt. Prebuild binaries can be downloaded at: https://sourceforge.net/projects/sdmixer/ The source code is available at: https://github.com/gtadeus/sdmixer2 Example data and settings (Example-SDmixer.zip) to test the performance of SDmixer can be downloaded at: http://sourceforge.net/projects/sdmixer/files/?source=navbar A quick guide to test SDmixer using sample data is given at the end of this manual (s. Supplements).

Input file properties SDmixer reads space separated text files containing the lists of localizations with one localization per line.

Loading rapidSTORM localization files SDmixer is natively capable of reading files obtained with the super-resolution localization software rapidSTORM (Wolter et al. Opt. Exp. 2014). rapidSTORM can be downloaded here: http://www.super-resolution.biozentrum.uni-wuerzburg.de/research_topics/rapidstorm/

Loading non-rapidSTORM localization files White space separated files created with any other localization software such as the popular QuickPALM (Henriques et al., Nat Meth. 2010) can be used as input files as well. In this case the user must specify the columns as described in the Section Expert Settings and Alternative XML header.

Page 3: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Using the software When starting the software, the Session tab is loaded by default. The graphical user interface (GUI) supports drag and drop for TXT input files and PNG filter files. Loaded input files are displayed in the Session tab and are processed sequentially, allowing batch processing. Output files are written into the Output Directory, or if the field is left empty into the same directory of the respective input file. The computational stages (PairFinder, MultiColorFilter and Reconstruction) are selected with check boxes. It is possible to run the procedure with a 3D data set ignoring the z information by selecting Force 2D Analysis. The computation itself is started with the Start demixing button. We recommend to save the settings (File Save settings) prior to starting the analysis. Once started the computation process can be terminated by the Stop button that is only visible during active computation. The cleanup process of a canceled calculation may take a few minutes.

Session

Save Session All settings entered into the GUI can be saved and reloaded for future sessions, using File Save Settings as… from the menu. The default settings are saved into the home directory in a file called “sdmixer_default_settings.txt”. The current session can be set as default by selecting File Set Settings as Default from the menu. Previous settings can be loaded under File Load Settings … from the menu.

Page 4: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

File Info The input file information (dimensions, rows, columns, coordinate range from header etc.) is displayed if available for the active file in the list. Selecting a file from the input file list updates the File Info field on the right. The rows (total number of localizations) and columns are derived from the file itself and all other information such as Dimensions or Size are read from the rapidSTORM XML header. Dimension will be “3” if a z coordinate is defined in the header. The minimum and maximum values of each coordinate in x,y and z are taken from the header, they are not derived from the contents of the file itself. Note, for reading other file formats, please refer to Expert Settings. Computation SDmixer consists of three sequential computational stages (PairFinder, MultiColorFilter and Reconstruction) each producing intermediate results that can be viewed by the user. In each section we provide starting parameters that have proven useful in our experiments. The three stages can be executed independently by selecting the desired stages in the Session Tab. This allows for example to skip the PairFinder stage and to use the intermediate results from a previous PairFinder run for the subsequent Filter stage. The Reconstruction stage can also be executed alone, using a localization data set as input file in order to create a TIFF image from x,y (and z) coordinates. The Reconstruction stage allows also an efficient generation of TIFF images from x, y (and z) coordinates, i.e. from the rapidSTORM output files, without spectral demixing.

PairFinder During the PairFinder stage single molecule localization pairs are identified to allow registration free multicolor dSTORM as described previously (Lampe A. et al. Biol. Cell 2012; Lampe A. et al. Meth. Appl. Fluor. 2015).

Page 5: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Image Properties Pixelsize: The value Pixelsize should be set according to the pixel size in nm of the raw data (single molecule blinking movie) acquired with the fluorescence microscope. Camera Orientation: Spectral demixing of two spectrally overlapping, but shifted, fluorophore emission spectra is performed most efficiently with a single camera setup and a dichroic-based emission splitter (i.e. Optosplit II, Cairn Optics) that projects the short and long wavelength emission channels side-by-side onto the same camera (for details see Lampe A. et al. Biol. Cell 2012; Lampe A. et al. Meth. Appl. Fluor. 2015). A typical SD-dSTORM setup therefore generates dual-view images that are either oriented Left-Right or Top-Bottom. Please, set the Camera Orientation and Short Channel Position field according to your setup. The drop-down menu Short Channel Position defines which side of the dual-view input movie features the shorter wavelength.

In case a two camera setup is used the separate localization files from both cameras should be joined into one file to allow the PairFinder procedure that is based on a geometrical offset vector. Most single molecule localization software tools offer the option to merge localizations from two movies into a single localization file. By selecting an appropriate offset (size of the field of view) in x or y it is then possible to obtain localization files with a “left-right” or “top-bottom” geometry, respectively.

Example dual-view single molecule images (still frame during SD-dSTORM acquisition) showing dual-view camera orientation (“Top-Bottom”). Top (long wavelength channel), bottom (short wavelength channel). The offset is indicated as a red arrow. The search radius as a blue dotted circle. The pair-finder can be set to work both ways, from short to long or from long to short channel.

Offset The Offset values represent the displacement vector between each localization pair (s. Fig. above) and is a constant geometrical value for each emission splitter. The three fields x,y,z should be set according to the geometry of the dual view input file. SDmixer offers the possibility to set x and y offset values in either pixel (px) or nm units. Using px units are

Page 6: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

convenient since the offset can be measured directly from the input movie, for example by measuring the distance between two features that appear in both channels in ImageJ. Naturally, if the movie is oriented Left-Right, the x offset is much larger than the y offset and vice versa for the Top-Bottom orientation. It is possible to define the offset in nm units which is essentially the offset in px units multiplied with the value from Pixelsize. Internally SDmixer uses nanometer units for calculation and therefore Pixelsize needs to be specified.

Note: The value for the z offset is usually (i.e. for astigmatism derived 3D data) determined by the 3D calibration during image acquisition. Therefore, z can only be specified in absolute distance units, namely in nm. If the short and long wavelength channels are calibrated separately, depending on the system, there might be a small off-set in z (Lampe A. et al. Biol. Cell 2012; Lampe A. et al. Meth. Appl. Fluor. 2015). In most cases the z offset is negligible and can be set to zero.

Note: It is not necessary to provide a highly precise lateral (x,y) offset since the SDmixer automatically optimizes the offset for maximal localization pairs within the Offset Optimization (s. below).

Search Radius (Epsilon) The values in x,y and z Search Radius determine the ellipsoid at the end of the offset vector in which localizations are searched for to pair them. When more than one localization is found, these localizations are neglected from the list of candidates for pairs to prevent false assignment.

Starting values: Values of 150 nm for x and y and 300 nm for z are good values to start with. Note, that depending on your label density, lower values can be beneficial but can result in low numbers of identified localizations pairs and poor reconstruction.

Offset optimization To maximize the number of found localization pairs, we recommend to use the Offset Optimization algorithm to tune the initial guess of the x,y offset from the measured dual view geometry. This algorithm performs the pair-finding algorithm on the first 𝑛 frames (Subset) with varying offset values, centered around the initial guess (Offset). Offset values are varied in Increments within the total Range in either pixels or nm. The x and y offsets that generate the highest number of found pairs are used for further calculation and stored in the logfile. The z offset is not taken into account during the offset optimization.

Starting values: Usually 1000-2000 frames as a Subset, an Increment of 0.3 px and a Range of 12. These values vary the offset vector in a square of 7.2 x 7.2 px2 centered at the initial guess of the lateral offset.

Grouping Some fluorophores (especially fluorescent beads used as fiduciary markers drift correction) are “ON” during more than one, sometimes several, consecutive frames. SDmixer offers an algorithm that groups pairs which are “ON” in more than one consecutive frame within the distance provided in Search Range. These localizations are replaced with a new localization at the center of mass of the group within the first frame of its occurrence. The new intensity is set to the sum of intensities of the localizations of the group. Grouping therefore can have a great

Page 7: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

impact on the Intensity Space (see Multicolor Filter section) and might improve the separation of different fluorophores.

Note: This option should be used with caution, since it could merge localizations from multiple fluorophores in close proximity, especially at high labeling densities in the sample. Due to the nature of single molecule localization techniques, different emitters are not distinguishable from each other.

MultiColorFilter Key to understand the multicolor filtering process is to understand the intensity space (below).

The Intensity Space

After identifying localization pairs with the Pair Finder their intensities in short- and long-wavelength channels are plotted into a 2D histogram, referred to as the ‘intensity space’. Spectrally different fluorophores should show distinct distributions (s. above), strongly depending both on the dichroic mirror used to separate the channels and the imaging buffer. The orientation (short vs. long), the dynamic range (intensity units) and size of the graphical plot can be set in the MultiColorFilter tab. This has a direct impact of the size of the expected filter-image by the software. The intensity space is plotted automatically and stored in the working directory in a file ending with “_IntensitySpace.png”.

Page 8: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

The color filters are highly specific for the dye and imaging buffer used, thus, we recommend designing custom filters. Filter files are graphic representations of areas in the intensity space that are used for the color assignment, with one filter file per color channel. Custom-designed filters are loaded into SDmixer as PNG files offering maximum freedom in their design. Filter files must be PNG files containing only the colors black and white (binary). Localization pairs within black areas are excluded while pairs within white areas are assigned to a color, depending on the filter name (filter1, filter2). By applying custom-designed filters each pair is assigned to a specific color channel (1 or 2) or discarded according to its position.

Creating Custom Color Filters To design custom color filters, please follow these procedures:

Test sample preparation and SD-dSTORM imaging Single color samples stained individually with dyes chosen for 2-color SD-dSTORM are prepared using the same protocol as for dual color samples. Both samples are imaged under the same conditions (buffer, imaging parameters: i.e. laser power, fluorescent filters) as used later in the multicolor sample. After data acquisition and determination of single molecule localization with a third party software (i.e. rapidSTORM), these separate localization text files are processed using SDmixer.

Data analysis with SDmixer ● Set up one previously prepared input file in the Settings tab and provide the necessary

information for the PairFinder stage.

Page 9: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

● Enter the maximal intensity values from the localization data set (i.e. 80,000 for the short wavelength channel and 30,000 for the long wavelength channel) in Filter Settings.

● Create a white PNG file with the same proportions (i.e. using Photoshop or Gimp). The size of the PNG image should be reduced by using the Precision factor in Filter Settings. If Precision is set to 0.1, a PNG file with the size 8,000 x 3,000 or 3,000 x 8,000, depending on the Filter Orientation is expected.

● Make sure the option Plot Intensity Space is selected and start the demixing session (PairFinder, MultiColorFilter and Reconstruction checked in the Session Tab).

In the output directory, a PNG file will be created (“_IntensitySpace.png”) with the intensity values of one channel plotted along the intensity values of the other channel, according to the chosen filter orientation. Initially the all-white filter image will include all pairs in the reconstructed image.

Optimizing the color filter for low crosstalk The intensity space images (“_IntensitySpace.png”) from single color measurements serve as templates to custom design the color filters. Load your intensity space images into your favorite image manipulation software (e.g. GIMP or Photoshop) and create a transparent layer on top of each different intensity space. To fine-tune the filters focus on areas where the localization populations of the two dyes overlap. The overlap regions should be excluded (made black) to minimize crosstalk. Make sure you end up with two overlapping black areas in both layers and you extend the black area to the border of the layers. You should be left with two different transparent areas that only (ore mostly) contain one specific color localizations and vice versa. Fill the transparent areas left over with white and check if the white areas are not intersecting each other. Save those layers individually (e.g. as filter01.png and filter02.png). Load the two filters into MultiColorFilter in SDmixer and run the demixing process again with your measurements from the single color experiments. You should end up with two reconstructed images, where one is showing the structure and the other is completely (or mostly) blank. To quantify the crosstalk, check the log file of the ‘blank’ image to see how many wrong color localizations were assigned. Repeat this for the other color channel.

Note: To minimize crosstalk to below 1%, usually this process is repeated several times. If dyes and imaging conditions stay fixed, these custom filters can be used in all following spectral demixing experiments.

Page 10: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Filters derived from Intensity Spaces from single-color measurements. Left: the binary filter images. Right: filters with the Intensity Space distribution from single color experiments using 2 separable dyes.

Filter Settings Set the Filter Settings to the maximum intensities plotted in the graphical representation of the intensity space.

Note: Usually, the dual-view alignment is stable and the same imaging parameters (camera settings, objective, laser intensities) are used for the same dyes. In this case the custom-designed filters can be used indefinitely. The loss of localizations by applying the color filters is usually between 10 – 40 %, depending on the initial threshold of the localization algorithm. Note, that the loss of localizations is the price for true dual color imaging without crosstalk and registration error. We recommend taking great care in optimizing your filters to minimize crosstalk.

Page 11: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Image Reconstruction

General Settings The x,y and z coordinates of the localizations (i.e. pairs) are floating point values which have to be converted into integer image coordinates. The super-resolved reconstruction, however, contains finite pixel sizes. In order to reduce the image size and to display the image according to its physical resolution, the Super-Resolution Pixel Size (in Output Image Properties) should be defined under General Settings (super-res pixel size). When choosing the Super-Resolution Pixel Size the user should consider the experimental localization precision of the system used (see section “Gaussian blur” for more details).

Starting values: For single molecule localization techniques the localization precision is typical around 25 nm in x/y. In this case we recommend using a Super-Resolution Pixel Size of 10 nm, factor 2.5 smaller. In analogy for z pixel size we recommend a Super-Resolution Pixel Size of 25 nm if the localization precision in z is 66 nm.

Note: Whole common divisors should be avoided to prevent image artifacts.

Non-Linear Histogram Equalization An image reconstructed from single molecule localizations displays grey values that scale linearly with the number of localizations per defined pixel size. This representation often suffers from a very small dynamic range (only very few localizations per pixel) such that the image details (biological structure) remain invisible due to the lack of contrast, especially when very bright objects (antibody cluster, beads) are within the field of view. SDmixer offers the option for contrast enhancement via non-linear intensity histogram equalization. If the sample contains very bright signals (i.e. from fluorescent beads used for drift correction or for 3D calibration) the non-linear histogram equalization is useful to enhance the often low contrast signal from the

Page 12: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

biological structure. This algorithm essentially enhances low contrast features while keeping high contrast features (s. Fig below).

Histogram equalization can be used to enhance low signals (low localization counts) in the output TIFF image. There are three input parameters for the contrast enhancement, which are explained in detail in the supplement (s. below). The Correction Coefficient (a number between 0 and 1) controls the spread of the histogram reciprocally to its value. The lower the coefficient the closer does the distribution stay to its original (linear) values. The Threshold (a number between 0 and 1) can be used to define the maximum intensity cutoff. A Threshold of 0 would result in a dark image while a Threshold of 1 uses the full 16-bit range. The soft mode reduces disturbing effects resulting from the contrast enhancement.

Starting values: A correction coefficient of 0.8, threshold of 1 and soft mode enabled are good starting values.

Nearest neighbor statistic SDmixer can be used to calculate the k-nearest neighbor statistic of the single molecule localization dataset. Nearest neighbor analysis could provide useful information on the density of the detected localizations inside clustered areas and could provide an upper boundary for the Nyquist resolution. The Euclidian distances of each localization and its nearest neighbor are calculated and the min, max and median distance values are reported in the log file.

Gaussian blur with experimental precision Although super-resolution imaging is theoretically possible with arbitrary precision only limited by the square root of detected photons, the experimental resolution highly depends on the physical setup, the fluorophores and labelling strategies. To account for this in the image reconstruction, the experimentally independently determined localization precision

Page 13: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

(optimally obtainable resolution) can be entered in the FWHM_xy and FWHM_z fields. The values are used to calculate a 3x3 (or 3x3x3 in case of a 3D dataset) Gaussian kernel and to convolve it with the reconstructed image resulting in the precision corrected representation of the experimental resolution.

Note: The convolution manipulates the grey values of the reconstructed image. This operation is performed in-place to save the required amount of RAM. However the convolution still consumes approximately twice the memory needed to store the reconstructed image. Again SDmixer uses memory mapped files to store the computational results on the hard disk drive in case the system cannot allocate the needed amount of space in the RAM. SDmixer does not separate the Gaussian kernel in the 3D case, thus allowing different FWHM values in x,y and z direction.

Note: About localization precision and resolution: The Gaussian “blurring” of the reconstructed localization image with the localization precision follows the principle of Abbe’s resolution limit. In localization microscopy the optimally obtainable resolution of the system depends on the precision of how accurately a single fluorophore can be localized in a given system (including sample drift). The full width half maximum (FWHM) of a Gaussian can be taken as a graphical representation of this ‘resolution’. Using the Gaussian blur, two spots that are closer to each other than the localization precision will be merged into one. This avoids artificial over-sampling above the experimental resolution.

Starting values: For a localization precision of 25 nm in x/y it is practical to set the Super-Resolution Pixel Size in x/y to 10 nm. As a rule of thumb, the pixel size of the reconstructed image should be at least 2.5 fold lower than the localization precision and whole multiples should be avoided (e.g. for 30 nm precision, choose 8 nm or 12 nm rather than 10 nm pixel size).

LZW Compression In order to reduce file size of the reconstructed TIFF image we strongly recommend the use of the built-in LZW compression option. In particular, an uncompressed 3D TIFF file with a field of view of 40 x 40 µm and a z-range of 1 µm will have a size of about 1600 MB. With LZW compression, the file size depends strongly on the number of localizations represented in the image, but less on its dimensions. For a dataset with 4,000,000 localizations and the same dimensions as mentioned above, the LZW compressed image-stack would only have the size of about 14 MB.

Crop in z dimension In order to reduce computational time and file size, or exclude regions from further analysis, SDmixer offers the option to Crop in z. The File Info box on the Session tab gives you information about the minimum and maximum value of z of a file with three dimensions. By raising the minimum and lowering the maximum the number of resulting slices in the reconstructed image is reduced. For Example: The z values in the File Info box on the session tab are set to “z min = 400” and “z max = 2200”. For a “z Super-Resolution Pixel Size of 25 nm” this will result in (2,200 - 400) /

Page 14: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

25 = 72 slices in the reconstructed image stack per channel. Setting the Crop in z to Start slice value to 900 and the End slice value to 1,900, your reconstructed image will have (1,900 - 900) / 25 = 40 slices, which will reduce image size and, importantly, the computational time.

Data Output The output folder will contain the following files:

• Log file with all the input parameters • Reconstructed image of channel 1 (ch1) • Reconstructed image of channel 2 (ch2) • Localization lists for non-paired localizations (filter_out) • Intensity space plot (Intensity space) • Localization lists for pairs (pairs_out)

The reconstructed dual-color image can be easily obtained by merging the ch1/ch2 in ImageJ. They have the same dimensions and are perfectly registered.

Page 15: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Hardware requirements and memory management

Hardware requirements SDmixer runs only on 64 bit machines, we recommend at least 8 GB (better 16 GB) of RAM for optimal performance.

Memory management A 50x50x1.7 µm field of view recorded for SD-dSTORM that is reconstructed with Super-Resolution Pixel Size of 10 nm (in x/y) z Super-Resolution Pixel Size of 20 nm (in z) results in an 5000x5000x85 16 bit integer (4 Byte) array that consumes around 8 GB of space. This implicates that 64 bit indexing is required and therefore SDmixer is designed to run on 64 bit machines. To prevent memory failure in the case when not enough RAM is available to store the whole image, temporary files are used to store computational results that do not fit into the memory. However the performance is drastically reduced when the RAM is full as the read write access to the hard disk drive poses a bottleneck. In this case we recommend using the Crop in z option or to run a preliminary reconstruction with larger Super-Resolution Pixel Size and reconstruct the most promising candidates with a higher precision.

Large TIFF files The old TIFF standard only allows 32 bit indexing and therefore poses a file size limit of approximately 4 GB. Despite the fact that the current TIFF specification (as implemented i.e. in libtiff5) allows 64 bit indexing and therefore much larger files, it is not widely implemented. We chose therefore 32 bit TIFF files for the output format to guarantee maximal compatibility with other image processing software (i.e. ImageJ). In case the uncompressed output file exceeds 4 GB, which may happen for large 3D datasets, the output image is split into multiple files.

Page 16: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Expert Settings (Custom input files)

XML header for non-rapidSTORM localization data input The XML header should be written in shorthand notation, without line breaks and contain ‘#’ at the beginning. The XML fields and their order are used to identify each column. In the example file provided below, x, y and z coordinates are expected in the columns 1 - 3, the frame number in column 4 and the intensity value in column 5. Further columns are ignored. The characters identified by SDmixer are highlighted in bold. SDmixer extracts the dimensions of the data set from this information (3D in this example). All values are expected to be floating values in standard decimal or scientific notation in nanometer units except for the frame number and intensity values which are dimensionless. The user-defined image size (XML attributes min/max) for each dimension in the header is essential for the overlay of the reconstructed dual-channel images. If no image size is specified, the output images are defined by the occurring localizations in the localization file, resulting in non-matching image sizes for each channel.

Page 17: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Example header. Line breaks were added to the header for clarity and should be removed forcing the header into the first row. Only bold entries are processed by SDmixer. Every “field identifier” tag represents a column in the following data. # <localizations insequence="true" repetitions="variable"> <field identifier="Position-0-0" unit="nanometer" min="0 m" max="5.0183e-005 m" /> <field identifier="Position-1-0" unit="nanometer" min="0 m" max="4.4405e-005 m" /> <field identifier="Position-2-0" unit="nanometer" min="6.5e-007 m" max="2.35e-006 m" /> <field identifier="ImageNumber-0-0" syntax="integer" min="0 fr" max="19999 fr" /> <field identifier="Amplitude-0-0" semantic="emission strength" unit="A/D count" /> <field identifier="TwoKernelImprovement-0-0" unit="dimensionless" /> <field identifier="FitResidues-0-0" unit="dimensionless" /> <field identifier="LocalBackground-0-0" unit="A/D count" /> </localizations> ... 4438.2700 24751.4000 1491.2500 0 229601.000 0.000 52292800.000 1335.120 43364.2000 43654.2000 1463.7600 0 135609.000 0.000 27816100.000 1386.430 4382.1300 2482.8300 1522.6300 0 129169.000 0.000 19526400.000 993.952 6402.7200 34450.0000 1313.8600 0 107182.000 0.000 97863000.000 1658.580 38344.9000 23713.0000 1507.0500 0 103618.000 0.000 65757200.000 1308.810 27816.7000 39333.9000 1071.1400 0 128710.000 0.000 52802500.000 1819.120 10937.7000 23221.3000 1524.7400 0 95555.200 0.722 164297000.000 1438.520 28502.2000 31439.1000 1319.8100 0 96039.100 0.000 103432000.000 1637.250 In this example using a x/y output pixel size of 10 nm would reconstruct an image with the size of 5,018 x 4,441 px2. Localizations outside the specified range (min/max) are not included in the final image, however, these data are still included in the computations within the PairFinder and MultiColorFilter procedures.

Page 18: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Supplement

Non-linear histogram equalization To enhance contrast in images reconstructed from single molecule localizations the following algorithm can be used. In brief a weighted probability density function (PDF) 𝑃𝑤𝑤 is computed from the PDF 𝑃 of the image histogram 𝐻 using two user defined constants. The threshold value 𝑃𝑢 = 1 and the correction coefficient ℎ = 0.9 . The correction coefficient is a real number between 0 and 1. Lower values of the correction coefficient lead to less correction, larger values to more non-linear correction of the histogram. The threshold value (a real number between 0 and 1) allows to define a cutoff value for the maximum intensity value displayed. A threshold value of 1 allows the full 16 bit range, which is the best option for most applications. When 𝑃𝑤𝑤 is applied to the image the image histogram is spread to the full range of 16-bit according to:

𝑃𝑤𝑤 = 𝑃𝑢 �𝑃 −𝑚𝑚𝑛(𝑃)

𝑚𝑚𝑚(𝑃) −𝑚𝑚𝑛(𝑃)�ℎ

The PDF is summed up into the cumulative distribution function (CDF) 𝐶 either linearly:

𝐶 = �𝑛

𝑖=0

𝑃𝑤𝑤(𝑚)

By taking the square root of 𝑃𝑤𝑤 the soft mode slightly reduces the disturbing effects of contrast enhancement by applying a modified CDF to the image (in analogy to the feature for contrast enhancement in ImageJ):

𝐶 = �𝑛

𝑖=0

�𝑃𝑤𝑤(𝑚)

Finally the output image is remapped to 16-bit, where 𝐼𝑤𝑤(𝑣) is the intensity value of the output image at the location 𝑣. 𝑁 is the total number of pixels.

𝐼𝑤𝑤(𝑣) = 𝑟𝑟𝑟𝑛𝑟 �𝐶(𝐼(𝑣)) ∗ (216 − 1)

𝑁 �

Page 19: sdmixer 2 manual - iopscience.iop.org€¦ · Introduction Spectral demixing (SD) offers multicolor single molecule localization microscopy (SMLM) with low crosstalk and without registration

Quick guide to test performance of SDmixer using sample data The data to run the SDmixer test using sample data is found at: https://github.com/gtadeus/sdmixer2/ The provided files are the following: FILE CONTENT manual_SDmixer.pdf Manual test_data.txt Sample data to test SDmixer test_settings.txt Matching settings to be loaded for testing sample data filter1.png Filter channel 1 filter2.png Filter channel 2 test_settings_session.png Screenshot test setting of session tab test_settings_pairfinder.png Screenshot test setting of pairfinder tab test_settings_multicolorfilter.png Screenshot test setting of multicolorfilter tab test_settings_reconstruction.png Screenshot test setting of reconstruction tab Simply right click on the files, save link/files as, and run SDmixer. The settings are loaded via File/load settings. Have fun SDmixing ! The SDmixer Team