An epifluorescence microscope design for naturalistic behavior and cellular activity in freely moving Caenorhabditis elegans.
The 2 matches · 1 of them tie a paragraph to a whole file, not to 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
- [2] § Methods › Calcium imaging in RIA axonal compartments ↔ RIA/5Midline_Skeletonize.py, lines 158–198 · score 0.57 · Head angle, 0–1, vectors, skeletonized, midline, smoothed
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: 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 Publishing Group},
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 Publishing Group
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 Publishing Group",
"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.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
- [4] doi:10.1364/boe.605322 [code]
- Generalized plaque digitization framework for multi-dimensional mesoscopic images.Journal: Biomedical optics expressIn common: imageio, tifffile, OpenCV, 9 other tools
- [5] doi: [code]
- Real-time closed-loop feedback system for mouse mesoscale cortical signal and movement controlJournal: eLifeIn common: imageio, tifffile, OpenCV, 8 other tools, 1 reference
- [6] doi:10.7554/elife.109717 [code]
- Retrosplenial cortex enables context-dependent goal-directed sensorimotor transformation.Journal: eLifeIn common: imageio, tifffile, OpenCV, 8 other tools, 1 reference
- [7] doi:10.1038/s41598-026-57519-w [code]
- Automated segmentation of neurons and spinal cord structures in immunofluorescence images using SpineDL.Journal: Scientific reportsIn common: imageio, tifffile, OpenCV, 8 other tools, histology / microscopy
- [8] doi:10.1016/j.xcrm.2026.102766 [code]
- A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.Journal: Cell reports. MedicineIn common: imageio, tifffile, OpenCV, 8 other tools, cellular / molecular
- [9] doi:10.1038/s41467-026-73373-w [code]
- Mapping neuro-vascular unit communications reveals distinct angiogenic programs across developing mouse brain regions.Journal: Nature communicationsIn common: imageio, tifffile, OpenCV, 8 other tools
- [10] doi:10.1038/s41467-026-73045-9 [code]
- Aberration-aware 3D localization microscopy via self-supervised neural-physics learning.Journal: Nature communicationsIn common: imageio, tifffile, OpenCV, 7 other tools, histology / microscopy, cellular / molecular
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:47a40bf5c01d97ea…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
