Shuffle ids

Analysis › Process · version 2

Write an integer column with its ids in a random order, so that

What it does

Writes a copy of an integer attribute with its ids in a random order, for colouring by. A clusterer numbers its clusters one after the other – Find clusters by size – and coloured by cluster_id neighbouring clusters often come out in neighbouring colours of the colour table (LUT, look-up table), so two touching clusters look like one. Coloured by the shuffled attribute, they are far apart on the LUT.

It takes any whole-number attribute, not only clusters: an ROI's number (roi_id), a MINFLUX trace (tid), a track, the frame. The attribute itself is left as it is – results and regions are kept by its ids – and the shuffled ids go into a new one, <column>_shuffled; colour the layer by that in the Render tab.

How it works

1. The ids. The distinct ids in the attribute, 0 included. An id of -1 means "in none" – DBSCAN's noise, a localization in no ROI – and is kept.

2. A random order. The ids are permuted: each id is replaced by another of the same ids, each used once. The shuffled attribute has the same values as the attribute, so a colour range set for one suits the other.

3. The new attribute, with the rule that a merged blink keeps its largest value, as cluster_id has.

Clusters coloured by their id, numbered by size, and by the shuffled id: neighbours that shared a colour are told apart.

Parameters

settingdefaultwhat it does
attribute
column
-An integer attribute: cluster_id, roi_id, tid, frame, ...
new attribute
name
–Empty: the attribute's name with _shuffled.
seed (more)
seed
autoAuto: a new order each run; a number gives the same order again.

Leave it on auto for a new order each run, and run again when two neighbours still came out alike. The seed used is in the history, so a picture can be made again with the same colours.

Output

The table with the new attribute, and a line saying how many ids were shuffled and with which seed.

Differences from SMAP

Based on SMAP's ShuffelClusterIndex (Ries 2020), which also writes a new attribute (<field>_rnd). The main changes:

References