{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example Workflow with spatialproteomics and spatialdata\n", "Welcome to spatialproteomics, the toolbox to analyze highly multiplexed fluorescence image data!\n", "\n", "During the processing of such data, you will generate different data structures, which all share some common dimensions. For example, the multiplexed imaging data (channels, x, y) share spatial dimensions with their corresponding segmentation masks (x, y). Similarly, the instance labels in a segmentation mask can be viewed as a dimension that aligns with the expression matrix (cells, channels) quantifying protein expression for each cell. Therefore, a desirable data structure for multiplexed imaging data should keep such shared dimensions consistent, ensuring that changes to one component automatically update the others to maintain consistency. For example, when subsetting a region of an image, the segmentation mask should be subset accordingly, and the expression matrix should only retain cells within this region.\n", "\n", "To enable all of this, the core functionality in `spatialproteomics` is based on `xarray`. The image below illustrates these concepts.\n", "\n", "
\n",
" \n",
"
\n", " | id | \n", "region | \n", "area | \n", "
---|---|---|---|
Cell_1 | \n", "1 | \n", "segmentation | \n", "54.0 | \n", "
Cell_2 | \n", "2 | \n", "segmentation | \n", "33.0 | \n", "
Cell_3 | \n", "3 | \n", "segmentation | \n", "64.0 | \n", "
Cell_4 | \n", "4 | \n", "segmentation | \n", "67.0 | \n", "
Cell_5 | \n", "5 | \n", "segmentation | \n", "23.0 | \n", "
\n", " | id | \n", "region | \n", "area | \n", "celltype | \n", "
---|---|---|---|---|
Cell_1 | \n", "1 | \n", "segmentation | \n", "101.0 | \n", "T_tox | \n", "
Cell_2 | \n", "2 | \n", "segmentation | \n", "48.0 | \n", "T_tox | \n", "
Cell_3 | \n", "3 | \n", "segmentation | \n", "99.0 | \n", "T_tox | \n", "
Cell_4 | \n", "4 | \n", "segmentation | \n", "108.0 | \n", "T_h | \n", "
Cell_5 | \n", "5 | \n", "segmentation | \n", "42.0 | \n", "T_h | \n", "