Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

@article{10.1083/jcb.202207048,
author = {Gagliardi, Paolo Armando and Grädel, Benjamin and Jacques, Marc-Antoine and Hinderling, Lucien and Ender, Pascal and Cohen, Andrew R. and Kastberger, Gerald and Pertz, Olivier and Dobrzyński, Maciej},
title = "{Automatic detection of spatio-temporal signaling patterns in cell collectives}",
journal = {Journal of Cell Biology},
volume = {222},
number = {10},
pages = {e202207048},
year = {2023},
month = {07},
issn = {0021-9525},
doi = {10.1083/jcb.202207048},
url = {https://doi.org/10.1083/jcb.202207048},
}@article{arcos-tutorial-2024,
author = {Dobrzyński, Maciej and Grädel, Benjamin and Gagliardi, Paolo Armando and Pertz, Olivier},
title = {Quantification of collective signalling in time-lapse microscopy images},
journal = {Methods in Microscopy},
volume = {1},
number = {1},
pages = {19--30},
year = {2024},
month = {06},
issn = {2942-3899},
doi = {doi:10.1515/mim-2024-0003},
url = {https://doi.org/10.1515/mim-2024-0003},
}

This section outlines an example pipeline written in python to get from images of epithelial cells to quantification with ARCOS and visualization with napari.





import os
import skimage
import numpy
import errno
from stardist.models import StarDist2D
from csbdeep.utils import normalize
from skimage.measure import regionprops, regionprops_table
from skimage.util import map_array
import pandas as pd
import trackpydef create_folders(path: str, folder: list):
for i in folder:
folder_to_make = os.path.join(path, i)
try:
os.makedirs(folder_to_make)
print(f'folder "{i}" created')
except OSError as e:
print(f'folder "{i}" alrady exists')
if e.errno != errno.EEXIST:
raise
def remap_segmentation(df: pd.DataFrame, segmentation: list, timepoint_column: str = 'timepoint', label_column: str = 'label', measure_column: str = 'ERK') -> list:
tracked_numpy = df[[timepoint_column, label_column, measure_column]].sort_values(timepoint_column).to_numpy()
grouped_numpy = numpy.split(tracked_numpy,numpy.unique(tracked_numpy[:,0], return_index = True)[1][1:])
ratio_remapped = []
for img, grp in zip(segmentation, grouped_numpy):
img_copy = map_array(img, grp[:,1], grp[:, 2])
ratio_remapped.append(img_copy)
return ratio_remappedPATH = 'example_data' # where is you data located
FOLDER = 'mdck_ekar' # subfolder of PATH where images are stored
OUT_DATA = 'data' # subfolder of PATH where csv is stored
OUT_LABELS = 'stardist' # subfolder of PATH where stardist segmentation is stored
FILENAME = 'C3-041_Ori.tif'
full_path = os.path.join(PATH, FOLDER)
orig_images_path = os.path.join(PATH, FOLDER)
out_path_csv = os.path.join(PATH, OUT_DATA)
create_folders(PATH, [OUT_DATA, OUT_LABELS]) model = StarDist2D.from_pretrained('2D_versatile_fluo') # standard stardist model for 2d segmentation
image_data = skimage.io.imread(os.path.join(orig_images_path, FILENAME)) out_path_stardist = os.path.join(PATH, OUT_LABELS, 'stardist.tif')
segmentation = []
df = []
for t, tp_data in enumerate(image_data):
print(f'analysing timepoint {t}')
labels, _ = model.predict_instances(normalize(tp_data))
labels = skimage.segmentation.clear_border(labels)
dic = regionprops_table(labels, tp_data, properties=['label', 'centroid', 'intensity_mean', 'area'])
dic['timepoint'] = numpy.repeat(t, len(dic['label']))
df.append(pd.DataFrame(dic))
skimage.segmentation.clear_border(labels)
segmentation.append(labels)
# optionally save segmentation
skimage.io.imsave(out_path_stardist, numpy.stack(segmentation))df_full = pd.concat(df)
df_full = df_full.rename(columns={"centroid-1": "x", "centroid-0": "y", 'intensity_mean': 'ERK'})
df_full = df_full.sort_values(['timepoint'])
df_tracked = trackpy.link_df(df_full, search_range = 10, memory = 2, t_column = 'timepoint')
df_tracked = df_tracked.reset_index(drop=True).rename(columns={'particle': "track_id"})
df_tracked.to_csv(out_path_csv+'\\tracked_data_fret.csv')from arcos4py import ARCOS
from arcos4py.tools import filterCollev
from arcos4py.plotting import NoodlePlotts = ARCOS(df_tracked, ["x", "y"], 'timepoint','track_id', 'ERK')
ts.interpolate_measurements()
ts.bin_measurements(biasMet='none', binThr=0.28)
df_arcos = ts.trackCollev(eps=40, minClsz=5)filterer = filterCollev(df_arcos, 'timepoint', 'clTrackID', 'track_id')
ts_filtered = filterer.filter(25, 10)NoodlePlot(ts_filtered, 'clTrackID', 'track_id', 'timepoint', 'x', 'y').plot('x')from napari import Viewer
TAB20 = [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#ffbb78",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5",
"#8c564b",
"#c49c94",
"#e377c2",
"#f7b6d2",
"#7f7f7f",
"#c7c7c7",
"#bcbd22",
"#dbdb8d",
"#17becf",
"#9edae5",
]np_data = df_tracked[['track_id', 'timepoint', 'y', 'x']].to_numpy()
colors = numpy.take(numpy.array(TAB20), ts_filtered['clTrackID'].unique(), mode="wrap")
df_w_colors = pd.merge(ts_filtered, pd.DataFrame(data={'colors': colors, 'clTrackID': ts_filtered['clTrackID'].unique()}))
points_data = df_w_colors[['timepoint', 'y', 'x']].to_numpy()
colors_data = df_w_colors['colors'].to_numpy('str')ratio_remapped = remap_segmentation(df_tracked, segmentation)
ratio_remapped = numpy.stack(ratio_remapped)viewer = Viewer()
viewer.add_image(image_data, name='ERK Ratio image', colormap='inferno')
viewer.add_image(ratio_remapped, colormap='viridis')
viewer.add_labels(numpy.stack(segmentation), name='segmentation', visible=False)
viewer.add_tracks(np_data, name='cell tracks')
viewer.add_points(points_data, face_color=colors_data, name='collective events')pip install arcos-guipip install git+https://github.com/bgraedel/arcos-gui.gitconda install arcos4pygit clone https://github.com/bgraedel/arcos4pycurl -OJL https://github.com/bgraedel/arcos4py/tarball/master