An epifluorescence microscope design for naturalistic behavior and cellular activity in freely moving Caenorhabditis elegans.
2 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 2 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
- [1] § Methods › Calcium imaging in RIA axonal compartments ↔ RIA/7Convert_polar.py, the whole file · a weak match · score 0.72 · polar coordinates, Head angle, atan2, bins, phase, Derivatives · block
oscr:b:Q4WA2Z7Q3H05F-A· Report a mismatch - [2] § Methods › Calcium imaging in RIA axonal compartments ↔ RIA/5Midline_Skeletonize.py, lines 158 to 198 · score 0.57 · Head angle, 0–1, vectors, skeletonized, midline, smoothed · block
oscr:b:M12G6BHZCVXKR-E· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 129 lines · 4.1 KB · no license · 1 match
- import pandas as pd
- import numpy as np
- import matplotlib.pyplot as plt
- from pathlib import Path
- def convert_to_polar_binned(csv_path, output_path=None):
- """
- Convert head angle data to polar coordinates and bin into 10-degree sections
- Args:
- csv_path: Path to input CSV file with head_angle column
- output_path: Path to save the output CSV file (optional)
- Returns:
- DataFrame with the converted data
- """
- # Load the data
- df = pd.read_csv(csv_path)
- # Calculate derivative of head_angle (dhead/dt)
- head_angle = df['head_angle'].values
- dhead_dt = np.gradient(head_angle)
- # Calculate polar angle from (head_angle, dhead_dt) using atan2
- # atan2(y, x) - head_angle is x, dhead_dt is y
- theta = np.arctan2(dhead_dt, head_angle)
- # Ensure angles are in [0, 2*pi]
- theta = (theta + 2*np.pi) % (2*np.pi)
- # Convert to degrees for binning
- theta_deg = theta * 180/np.pi
- # Create bins from 0 to 360 degrees with 10-degree width
- bin_size = 10
- bin_edges = np.arange(0, 361, bin_size)
- bin_centers = bin_edges[:-1] + bin_size/2
- # Find which bin each angle belongs to
- bin_indices = np.searchsorted(bin_edges, theta_deg, side='right') - 1
- # Handle edge case where theta_deg is exactly 360 degrees
- bin_indices[bin_indices == len(bin_edges)-1] = 0
- # Get the binned angle (center of the bin)
- binned_theta_deg = bin_centers[bin_indices]
- binned_theta_rad = binned_theta_deg * np.pi/180
- # Calculate x,y coordinates on the unit circle for the binned angles
- polar_x = np.cos(binned_theta_rad)
- polar_y = np.sin(binned_theta_rad)
- # Create a dataframe with the results
- result_df = pd.DataFrame({
- 'frame': np.arange(len(head_angle)),
- 'head_angle': head_angle,
- 'dhead_dt': dhead_dt,
- 'theta_rad': theta,
- 'theta_deg': theta_deg,
- 'bin_index': bin_indices,
- 'binned_theta_deg': binned_theta_deg,
- 'binned_theta_rad': binned_theta_rad,
- 'polar_x': polar_x,
- 'polar_y': polar_y
- })
- # Plot the data
- plt.figure(figsize=(15, 10))
- # Plot the original head angle
- plt.subplot(2, 2, 1)
- plt.plot(result_df['frame'], result_df['head_angle'])
- plt.title('Original Head Angle')
- plt.xlabel('Frame')
- plt.ylabel('Angle')
- plt.grid(True)
- # Plot phase space (head_angle vs dhead_dt)
- plt.subplot(2, 2, 2)
- plt.scatter(result_df['head_angle'], result_df['dhead_dt'],
- c=result_df['frame'], cmap='viridis', alpha=0.7)
- plt.colorbar(label='Frame')
- plt.title('Phase Space: Head Angle vs. dHead/dt')
- plt.xlabel('Head Angle')
- plt.ylabel('dHead/dt')
- plt.grid(True)
- # Plot points on the unit circle
- plt.subplot(2, 2, 3)
- # Draw unit circle
- theta_circle = np.linspace(0, 2*np.pi, 100)
- plt.plot(np.cos(theta_circle), np.sin(theta_circle), 'k--', alpha=0.3)
- # Plot binned points
- sc = plt.scatter(result_df['polar_x'], result_df['polar_y'],
- c=result_df['frame'], cmap='viridis', alpha=0.7)
- plt.colorbar(sc, label='Frame')
- plt.title('Binned Polar Coordinates on Unit Circle')
- plt.xlabel('X')
- plt.ylabel('Y')
- plt.axis('equal')
- plt.grid(True)
- # Plot binned angles over time
- plt.subplot(2, 2, 4)
- plt.scatter(result_df['frame'], result_df['binned_theta_deg'],
- c=result_df['frame'], cmap='viridis', alpha=0.7)
- plt.title('Binned Polar Angles')
- plt.xlabel('Frame')
- plt.ylabel('Angle (degrees)')
- plt.grid(True)
- plt.ylim(0, 360)
- plt.tight_layout()
- plt.show()
- # Save to a new CSV file
- if output_path:
- result_df.to_csv(output_path, index=False)
- print(f"Data saved to {output_path}")
- return result_df
- if __name__ == "__main__":
- # Replace with actual path to your input CSV file
- input_path = "angles/1_angle_smooth.csv" # Update this with your file path
- output_path = "angles/1_polar.csv"
- result_df = convert_to_polar_binned(input_path, output_path)
7Convert_polar.py at commit 39a954a, no license · at the source
Overview
- Integrated Program in Neuroscience, McGill University,Montreal, QC Canada
- Department of Biology, McGill University,Montreal, QC Canada
- Independent Researcher, Immenreich, Lindau, Germany
Abstract
Understanding the neural basis of behavior requires imaging cellular activity in freely moving animals, which typically demands expensive, restrictive microscopy setups. To overcome these barriers, we developed Wormspy, a cost-effective, open-source epifluorescence microscopy system for high-magnification imaging and tracking of Caenorhabditis elegans. Wormspy enables the simultaneous recording of neuronal activity and behavioral dynamics without needing the animal to be restrained. We demonstrate its utility in imaging body wall muscles, sensory neurons, and subcellular calcium events within interneuron axons. Our platform reproduces known mutant phenotypes and uncovers, to the best of our knowledge, previously inaccessible sensorimotor correlations. We show that Wormspy provides a robust, modular framework that lowers technical barriers to high-resolution neural imaging, enabling flexible experimental designs for dissecting behavior in freely moving organisms.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.
Zenodo 19477903
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
19 files
- ASH/
ASH_Segmentation.py , Python, 193 lines - ASH/
CSV_formatting.py , Python, 19 lines - ASH/
Convert TIF to Stack.py , Python, 44 lines - ASH/
PickletoCSV.py , Python, 30 lines - ASH/
Plotting.py , Python, 41 lines - ASH/
TMAC_analysis.py , Python, 51 lines - ASH/
TQ5856/ , Python, 72 linesActivityTraces/ Align_timeseries.py - ASH/
TQ5856/ , Python, 135 linesActivityTraces/ SummaryPlot.py - AWC/
Segmentation.py , Python, 193 lines - AWC/
WormsPy_dataproc.ipynb , Jupyter, 264 lines - Muscle/
myo3gcamp.py , Python, 198 lines - RIA/
1ConvertTIFFtoStack.py , Python, 60 lines - RIA/
2TIFF to JPG.py , Python, 212 lines - RIA/
3AutoCrop.py , Python, 908 lines - RIA/
4RIAMaskGen.py , Python, 1,465 lines - RIA/
5Midline_Skeletonize.py , Python, 349 lines - RIA/
6smooth.py , Python, 64 lines - RIA/
7Convert_polar.py , Python, 129 lines - README.md, Text, 2 lines
Hendricks-Worm-Lab/WormsPy_paper_analysis
39a954adc94ac157adb4aa95d4dcefbc9e20ddc2, 19 April 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
19 files
- ASH/
ASH_Segmentation.py , Python, 193 lines - ASH/
CSV_formatting.py , Python, 19 lines - ASH/
Convert TIF to Stack.py , Python, 44 lines - ASH/
PickletoCSV.py , Python, 30 lines - ASH/
Plotting.py , Python, 41 lines - ASH/
TMAC_analysis.py , Python, 51 lines - ASH/
TQ5856/ , Python, 72 linesActivityTraces/ Align_timeseries.py - ASH/
TQ5856/ , Python, 135 linesActivityTraces/ SummaryPlot.py - AWC/
Segmentation.py , Python, 193 lines - AWC/
WormsPy_dataproc.ipynb , Jupyter, 264 lines - Muscle/
myo3gcamp.py , Python, 198 lines - RIA/
1ConvertTIFFtoStack.py , Python, 60 lines - RIA/
2TIFF to JPG.py , Python, 212 lines - RIA/
3AutoCrop.py , Python, 908 lines - RIA/
4RIAMaskGen.py , Python, 1,465 lines - RIA/
5Midline_Skeletonize.py , Python, 349 lines, 1 match - RIA/
6smooth.py , Python, 64 lines - RIA/
7Convert_polar.py , Python, 129 lines, 1 match - README.md, Text, 22 lines
sebzdead.github.io/wormspy
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
Zenodo 19477899
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
3 files
- ASH_threshold_analysis.p
y , Python, 109 lines - myo3gcamp_gifout.py, Python, 209 lines
- tifstacker.py, Python, 38 lines
Zenodo 19477902
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
19 files
- ASH/
ASH_Segmentation.py , Python, 193 lines - ASH/
CSV_formatting.py , Python, 19 lines - ASH/
Convert TIF to Stack.py , Python, 44 lines - ASH/
PickletoCSV.py , Python, 30 lines - ASH/
Plotting.py , Python, 41 lines - ASH/
TMAC_analysis.py , Python, 51 lines - ASH/
TQ5856/ , Python, 72 linesActivityTraces/ Align_timeseries.py - ASH/
TQ5856/ , Python, 135 linesActivityTraces/ SummaryPlot.py - AWC/
Segmentation.py , Python, 193 lines - AWC/
WormsPy_dataproc.ipynb , Jupyter, 264 lines - Muscle/
myo3gcamp.py , Python, 198 lines - RIA/
1ConvertTIFFtoStack.py , Python, 60 lines - RIA/
2TIFF to JPG.py , Python, 212 lines - RIA/
3AutoCrop.py , Python, 908 lines - RIA/
4RIAMaskGen.py , Python, 1,465 lines - RIA/
5Midline_Skeletonize.py , Python, 349 lines - RIA/
6smooth.py , Python, 64 lines - RIA/
7Convert_polar.py , Python, 129 lines - README.md, Text, 2 lines
hendricks-worm-lab/gcamp_analysis
72361f7742283e511379ec4b830727dc83a42c6a, 1 March 2024Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
3 files
- ASH_threshold_analysis.p
y , Python, 109 lines - myo3gcamp_gifout.py, Python, 209 lines
- tifstacker.py, Python, 38 lines
Code availability
https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 6 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 60 scripts, each with its path and the digest of its content;
- 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
The data generated in this study are accessible at 10.5281/
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 2 keywords, 9 MeSH terms, 2 funders, 37 references.
Cite
This paper
Wittekindt, S. N., Owens, H., Guisnet, A., Wittekindt, L., & Hendricks, M. (2026). An epifluorescence microscope design for naturalistic behavior and cellular activity in freely moving Caenorhabditis elegans. Nature communications, 17(1), 4411. https://
BibTeX
@article{wittekindt2026e
author = {Wittekindt, Sebastian N. and Owens, Hannah and Guisnet, Aurélie and Wittekindt, Lennard and Hendricks, Michael},
title = {{An epifluorescence microscope design for naturalistic behavior and cellular activity in freely moving Caenorhabditis elegans}},
journal = {Nature communications},
year = {2026},
month = may,
volume = {17},
number = {1},
pages = {4411},
publisher = {Nature Portfolio},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42156741},
pmcid = {PMC13187321}
}
RIS
TY - JOUR
AU - Wittekindt, Sebastian N.
AU - Owens, Hannah
AU - Guisnet, Aurélie
AU - Wittekindt, Lennard
AU - Hendricks, Michael
TI - An epifluorescence microscope design for naturalistic behavior and cellular activity in freely moving Caenorhabditis elegans
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 4411
SN - 2041-1723
PB - Nature Portfolio
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "An epifluorescence microscope design for naturalistic behavior and cellular activity in freely moving Caenorhabditis elegans",
"container-title": "Nature communications",
"author": [
{
"family": "Wittekindt",
"given": "Sebastian N."
},
{
"family": "Owens",
"given": "Hannah"
},
{
"family": "Guisnet",
"given": "Aurélie"
},
{
"family": "Wittekindt",
"given": "Lennard"
},
{
"family": "Hendricks",
"given": "Michael"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "4411",
"DOI": "10.1038/
"PMID": "42156741",
"PMCID": "PMC13187321",
"ISSN": "2041-1723",
"publisher": "Nature Portfolio",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
19
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s41467-026-72710-3 [code]
- A modular multi-color fluorescence microscope for simultaneous tracking of cellular activity and behavior.Journal: Nature communicationsIn common: tifffile, OpenCV, scikit-image, 5 other tools, C. elegans, histology / microscopy, 12 references
- [2] doi:10.1371/journal.pcbi.1013441 [code]
- Large vision model framework for automated C. elegans analysis: From static morphometry to dynamic neural activity.Journal: PLoS computational biologyIn common: tifffile, OpenCV, scikit-image, 7 other tools, C. elegans, 3 references, 2 authors
- [3] doi:10.1016/j.crmeth.2024.100964 [code]
- Unifying community whole-brain imaging datasets enables robust neuron identification and reveals determinants of neuron position in C. elegans.Journal: Cell reports methodsIn common: tifffile, OpenCV, scikit-image, 8 other tools, C. elegans, 2 references
- [4] doi:10.7554/elife.108159 [code]
- Deep neural networks to register and annotate cells in moving and deforming nervous systems.Journal: eLifeIn common: tifffile, OpenCV, scikit-image, 6 other tools, C. elegans, 3 references
- [5] doi:10.1038/s41593-026-02257-5 [code]
- Neural sequences underlying directed turning in Caenorhabditis elegans.Journal: Nature neuroscienceIn common: tifffile, h5py, Pillow, 6 other tools, C. elegans, 3 references
- [6] doi:10.7554/elife.74434 [code]
- Principles for coding associative memories in a compact neural network.Journal: eLifeIn common: seaborn, pandas, SciPy, 2 other tools, C. elegans, cellular / molecular, 6 references
- [7] doi:10.1371/journal.pcbi.1012075 [code]
- Versatile multiple object tracking in sparse 2D/
3D videos via deformable image registration. Journal: PLoS computational biologyIn common: OpenCV, scikit-image, h5py, 5 other tools, C. elegans, 4 references - [8] doi:10.1038/s41586-023-06683-4 [code]
- Neural signal propagation atlas of Caenorhabditis elegans.Journal: NatureIn common: OpenCV, seaborn, pandas, 3 other tools, C. elegans, 5 references
- [9] doi:10.1038/s41467-022-32886-w [code]
- Fast, efficient, and accurate neuro-imaging denoising via supervised deep learning.Journal: Nature communicationsIn common: tifffile, OpenCV, scikit-image, 6 other tools, C. elegans, 2 references
- [10] doi:10.1002/advs.202411191 [code]
- Structural Diversity of Mitochondria in the Neuromuscular System across Development Revealed by 3D Electron Microscopy.Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)In common: tifffile, h5py, Pillow, 6 other tools, C. elegans, histology / microscopy, cellular / molecular, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 6 repositories of the authors' code, each at its verified commit and with its license, 60 scripts, and 2 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:440319718f7b522d…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41467-026-72709-w)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-72709-w.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-72709-w
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-72709-w"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-72709-w.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
- Hendricks-Worm-Lab/WormsPy_paper_analysis: README.md on GitHub
- hendricks-worm-lab/gcamp_analysis on GitHub (add a README there)
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
