Skip to content
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
0c73676
delete outdatted figure making scripts
edyoshikun Apr 15, 2025
99ed61f
delte unused infection classification scripts
edyoshikun Apr 15, 2025
75b64b8
rename infection classfication README.md
edyoshikun Apr 15, 2025
6a646ee
adding old visualization code
edyoshikun Apr 15, 2025
e7f575b
deleting old evaluation code
edyoshikun Apr 15, 2025
7e661aa
cherry pick commit adding xyz coordinates to xarray
edyoshikun Apr 16, 2025
c5edf90
cherry-pick flexible number of PC components
edyoshikun Apr 16, 2025
3624861
cherry-pick updating distance and ALFI MSF measurments
edyoshikun Apr 16, 2025
e3c8c75
Knowledge distillation between channels (#222)
ziw-liu Apr 17, 2025
71481ec
cherry-pick moving occlusion script to figures
edyoshikun Apr 17, 2025
72b7482
adding demo prototype for dynaclr
edyoshikun May 13, 2025
2efcb4e
cleaning up demo imagenet vs dynaclr
edyoshikun May 13, 2025
ad201a9
abstracting the writing to xarray format so it doesn't dependo on the…
edyoshikun May 13, 2025
1f52dcf
fixing patch size mismatch
edyoshikun May 13, 2025
c2f686b
benchmark_demos
edyoshikun May 13, 2025
240bcd9
making pca compute similar to phate
edyoshikun May 13, 2025
aa48bf5
imagenet lm module
edyoshikun May 13, 2025
cd179c0
update openphenom lm module
edyoshikun May 13, 2025
a73e216
update embedding_writer to accept configurable PHATE,PCA,UMAP
edyoshikun May 13, 2025
975eb5a
add plotting utils for dtw
edyoshikun May 14, 2025
06439c1
update imagenet and openpheno to accept multi channel
edyoshikun May 14, 2025
dcc6da0
readme for demo
edyoshikun May 16, 2025
87904d2
moving examples and simplifying example to load and display
edyoshikun May 17, 2025
963926d
update README.md with instructions to run inference
edyoshikun May 17, 2025
6c58145
missing plotly dash in visual
edyoshikun May 21, 2025
974d058
adding a test case with dash
edyoshikun May 21, 2025
4310c42
format
ziw-liu May 23, 2025
15f837b
fix imports
ziw-liu May 23, 2025
f3ab2c1
removing paths and use the ones relative to download
edyoshikun May 21, 2025
8c20eaa
dynaclr-denv-vs and interactive visualizer update
edyoshikun May 28, 2025
cd6f74d
Merge branch 'main' into dynaclr_v2
ziw-liu May 28, 2025
5dd2874
Add evaluation script for infection classifier models (#241)
ziw-liu May 28, 2025
39adb7a
adding dtw initial simulations
edyoshikun May 28, 2025
253a303
dtw evaluation with other methods
edyoshikun May 28, 2025
e5318d8
add dynaclr_v2 schmeatic
edyoshikun May 28, 2025
3c9edc5
updating the readme with new schematic
edyoshikun May 28, 2025
8cc776b
removing deprecated CTC demos
edyoshikun May 28, 2025
3190518
removing visualizatinon file in favor of the demo
edyoshikun May 28, 2025
5c79d69
moving the old cli scripts for the dynaclr demo to examples
edyoshikun May 29, 2025
1dbc583
Select wells and FOVs for triplet data (#250)
ziw-liu May 30, 2025
eab9819
Tweak VCP tutorials (#251)
ziw-liu May 28, 2025
22c0826
Readme updates (#246)
ziw-liu May 28, 2025
65df54b
Merge branch 'main' into dynaclr_v2
ziw-liu Jun 3, 2025
e71ff90
uploading demo as html file since jupyter cannot render it
edyoshikun Jun 3, 2025
7d0117e
updating demo readmes to point to public
edyoshikun Jun 3, 2025
3cfa350
remove the play pause buttons for the phate demo
edyoshikun Jun 4, 2025
4e0dd73
standardizing viscy hosted models to have the description in the pare…
edyoshikun Jun 4, 2025
d8ca08c
numpy docstring on openphenom and removing torchno grad redundancy
edyoshikun Jun 4, 2025
0daf4c8
replacing go.heatmap to go.image for visualization
edyoshikun Jun 5, 2025
918ff03
reviewed README
mattersoflight Jun 8, 2025
9658fc3
added link to DynaCLR demo
mattersoflight Jun 8, 2025
9a2ec1c
adding script to generate pseudotracks
edyoshikun Jun 9, 2025
3d81e79
adding global paths and todos to pseudo tracks
edyoshikun Jun 9, 2025
72fcba9
Reiterate cell feature vs PC script (#254)
Soorya19Pradeep Jun 9, 2025
e1922b5
Update examples/DynaCLR/setup.sh
edyoshikun Jun 9, 2025
3a5b2ac
adding documentation to the visualization class
edyoshikun Jun 9, 2025
ce64513
visualization app will take z-range as tuple
edyoshikun Jun 10, 2025
78f9fc3
removing the redundant 'reduction' attribute in the embedding_writter…
edyoshikun Jun 10, 2025
70cefe8
remove dynacell metrics config
edyoshikun Jun 10, 2025
62c6e87
replacing prints with assertions
edyoshikun Jun 10, 2025
4c4ad7d
ONNX support for DynaCLR (#258)
edyoshikun Jun 13, 2025
9c1f553
removing the anchor and positive features from the train step
edyoshikun Jun 14, 2025
4722c31
moving transformers to example dependency
edyoshikun Jun 16, 2025
47242a8
logic to save the clusters with a name
edyoshikun Jun 18, 2025
4935c9e
attribute to save the outoput csv file location
edyoshikun Jun 18, 2025
c154e21
fixing the bug that didnt clear the clusters when pressing the button
edyoshikun Jun 18, 2025
b9a69f7
fixing readme links and formatting
edyoshikun Jun 18, 2025
df19bd7
camel to snake
edyoshikun Jun 20, 2025
b0de4e8
add output path to save PC Viewer outputs
edyoshikun Jun 20, 2025
2fba36d
adding default parameters for dataloader settings
edyoshikun Jun 20, 2025
f52b371
removing unecessary set of unique tracks and wrangling the dataframe
edyoshikun Jun 20, 2025
1ce455d
ruff
edyoshikun Jun 20, 2025
41df7a4
Plot teacher accuracy (#260)
ziw-liu Jun 20, 2025
90729ad
removing percent in dataloader slurm convenience function
edyoshikun Jun 20, 2025
db1c9d7
abstracting phate #263
edyoshikun Jun 20, 2025
caf7a06
Merge branch 'main' into dynaclr_v2
ziw-liu Jun 23, 2025
458011c
update format
ziw-liu Jun 23, 2025
6d75432
format tests
ziw-liu Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 9 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Please choose a stable release from PyPI for production use.

## Cytoland (robust virtual staining)

### Online demo [![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-sm-dark.svg)](https://huggingface.co/spaces/compmicro-czb/VirtualStaining)
### Demo [![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-sm-dark.svg)](https://huggingface.co/spaces/compmicro-czb/VirtualStaining)

Try the 2D virtual staining demo of cell nuclei and membrane from label-free images on
[Hugging Face](https://huggingface.co/spaces/compmicro-czb/VirtualStaining).
Expand Down Expand Up @@ -70,7 +70,7 @@ See the full gallery [here](https://github.com/mehta-lab/VisCy/wiki/Gallery).
|:---:|:---:|:---:|
| [![HEK293T](https://github.com/mehta-lab/VisCy/blob/dde3e27482e58a30f7c202e56d89378031180c75/docs/figures/svideo_1.png?raw=true)](https://github.com/mehta-lab/VisCy/assets/67518483/d53a81eb-eb37-44f3-b522-8bd7bddc7755) | [![Neuromast](https://github.com/mehta-lab/VisCy/blob/dde3e27482e58a30f7c202e56d89378031180c75/docs/figures/svideo_3.png?raw=true)](https://github.com/mehta-lab/VisCy/assets/67518483/4cef8333-895c-486c-b260-167debb7fd64) | [![A549](https://github.com/mehta-lab/VisCy/blob/dde3e27482e58a30f7c202e56d89378031180c75/docs/figures/svideo_5.png?raw=true)](https://github.com/mehta-lab/VisCy/assets/67518483/287737dd-6b74-4ce3-8ee5-25fbf8be0018) |

### Reference
### References

The virtual staining models and training protocols are reported in our recent [preprint on robust virtual staining](https://www.biorxiv.org/content/10.1101/2024.05.31.596901).

Expand Down Expand Up @@ -123,43 +123,26 @@ This package evolved from the [TensorFlow version of virtual staining pipeline](

The robust virtual staining models (i.e *VSCyto2D*, *VSCyto3D*, *VSNeuromast*), and fine-tuned models can be found [here](https://github.com/mehta-lab/VisCy/wiki/Library-of-virtual-staining-(VS)-Models)

### Pipeline

A full illustration of the virtual staining pipeline can be found [here](https://github.com/mehta-lab/VisCy/blob/dde3e27482e58a30f7c202e56d89378031180c75/docs/virtual_staining.md).
## DynaCLR (Embedding Cell Dynamics via Contrastive Learning of Representations)

## DynaCLR (Contrastive learning of representations of cell dynamics)
DynaCLR is a self-supervised method for learning robust and temporally-regularized representations of cell and organelle dynamics from time-lapse microscopy using contrastive learning. It supports diverse downstream biological tasks -- including cell state classification with efficient human annotations, knowledge distillation across fluorescence and label-free imaging channels, and alignment of cell state dynamics.

We are currently developing self-supervised representation learning to map cell state dynamics in response to perturbations,
with focus on cell and organelle remodeling due to viral infection.
### Preprint
[DynaCLR on arXiv](https://arxiv.org/abs/2410.11281):

See our recent work on temporally regularized contrastive sampling method
for representation learning on [arXiv](https://arxiv.org/abs/2410.11281).
![DynaCLR schematic](https://github.com/mehta-lab/VisCy/blob/e5318d88e2bb5d404d3bae8d633b8cc07b1fbd61/docs/figures/DynaCLR_schematic_v2.png?raw=true)

<details>
<summary> Pradeep, Imran, Liu et al., 2024 </summary>

<pre><code>
@misc{pradeep_contrastive_2024,
title={Contrastive learning of cell state dynamics in response to perturbations},
author={Soorya Pradeep and Alishba Imran and Ziwen Liu and Taylla Milena Theodoro and Eduardo Hirata-Miyasaki and Ivan Ivanov and Madhura Bhave and Sudip Khadka and Hunter Woosley and Carolina Arias and Shalin B. Mehta},
year={2024},
eprint={2410.11281},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2410.11281},
}
</code></pre>
</details>

### Workflow demo
### Demo
- [DynaCLR demos](examples/DynaCLR/README.md)

- Example test dataset, model checkpoint, and predictions can be found
[here](https://public.czbiohub.org/comp.micro/viscy/DynaCLR_demo/).

- See tutorial on exploration of learned embeddings with napari-iohub
[here](https://github.com/czbiohub-sf/napari-iohub/wiki/View-tracked-cells-and-their-associated-predictions/).

![DynaCLR schematic](https://github.com/mehta-lab/VisCy/blob/9eaab7eca50d684d8a473ad9da089aeab0e8f6a0/docs/figures/dynaCLR_schematic.png?raw=true)

## Installation

Expand Down
45 changes: 45 additions & 0 deletions applications/benchmarking/DynaCLR/ImageNet/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
datamodule:
batch_size: 32
final_yx_patch_size:
- 160
- 160
include_fov_names: null
include_track_ids: null
initial_yx_patch_size:
- 160
- 160
normalizations:
- class_path: viscy.transforms.ScaleIntensityRangePercentilesd
init_args:
b_max: 1.0
b_min: 0.0
keys:
- RFP
lower: 50
upper: 99
num_workers: 60
source_channel:
- RFP
z_range:
- 15
- 45
embedding:
PCA_kwargs:
n_components: 8
PHATE_kwargs:
decay: 40
knn: 5
n_components: 2
n_jobs: -1
random_state: 42
execution:
overwrite: true
save_config: true
show_config: true
model:
channel_reduction_methods:
RFP: max
paths:
data_path: /hpc/projects/intracellular_dashboard/organelle_dynamics/2024_02_04_A549_DENV_ZIKV_timelapse/8-train-test-split/registered_test.zarr
output_path: /home/eduardo.hirata/repos/viscy/applications/benchmarking/DynaCLR/ImageNet/20240204_A549_DENV_ZIKV_sensor_only_imagenet.zarr
tracks_path: /hpc/projects/intracellular_dashboard/organelle_dynamics/2024_02_04_A549_DENV_ZIKV_timelapse/8-train-test-split/track_test.zarr
Loading