Releases: neuroinformatics-unit/movement
v0.7.1
✨ Highlight ✨ netCDF is the file format 🗃️ of choice for saving movement
datasets 💾
Saving to netCDF is the recommended way to preserve the complete state of your analysis, including all variables, coordinates, and attributes. Below is an example of how you may integrate netCDF into you movement-powered workflows:
from movement.io import load_poses
from movement.filtering import rolling_filter
from movement.kinematics import compute_speed
ds = load_poses.from_file(
"path/to/my_data.h5", source_software="DeepLabCut", fps=30
)
# Apply a rolling median filter to smooth the position data
ds["position_smooth"] = rolling_filter(
ds["position"], window=5, statistic="median"
)
# Compute speed based on the smoothed position data
ds["speed"] = compute_speed(ds["position_smooth"])
# Save the dataset to a netCDF file
# This includes the original position and confidence data,
# the smoothed position, and the computed speed
ds.to_netcdf("my_data_processed.nc")
To later load the dataset back from disk:
import xarray as xr
ds = xr.open_dataset("my_data_processed.nc")
Miscellaneous
- Completely remove deprecated median_filter function by @niksirbi in #611
- Add log_to_attrs decorator to scale function by @niksirbi in #604
Warning
The deprecated movement.filtering.median_filter()
function has been completely removed. Use movement.filtering.median_filter()
instead, with statistic="median"
.
Housekeeping
- Change path to match GIN repo current status by @sfmig in #603
- Add note for Apple silicon users with macOS <=13 by @niksirbi in #605
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #607
- chore: run codespell throughout fixing a typo by @yarikoptic in #608
- Remove announcement banner for Open Software Week by @niksirbi in #610
- Remove "easily" from some longer examples by @adamltyson in #612
New Contributors
- @yarikoptic made their first contribution in #608
Full Changelog: v0.7.0...v0.7.1
v0.7.0
🎉 Highlight: support for the NWB file format 🧠
movement
poses datasets can now be loaded from and saved to NeuroData Without Borders (NWB) files. The pose tracks are formatted according to the ndx-pose extension.
This was a global team effort started long ago by @edeno, continued by me, and finally wrapped up by @lochhh.
Many thanks go to @luiztauffer for providing advice and crash-testing.
Example usage:
import pynwb
import xarray as xr
from movement.io import load_poses, save_poses
# Load pose tracks from open NWBFile objects:
with pynwb.NWBHDF5IO("path/to/file.nwb", mode="r") as io:
nwb_file = io.read()
ds = load_poses.from_nwb_file(nwb_file)
# Or, directly load pose tracks from NWB files on disk.
# Here merge data from 2 files into a multi-individual dataset:
ds_singles = [load_poses.from_nwb_file(f) for f in ["id1.nwb", "id2.nwb"]]
ds_multi = xr.merge(ds_singles)
# Create NWBFile objects for each individual and save them to disk
nwb_files = save_poses.to_nwb_file(ds)
for file in nwb_files:
with NWBHDF5IO(f"{file.identifier}.nwb", "w") as io:
io.write(file)
As always, let us know if you encounter any hurdles with this.
What's Changed
- Fix remaining napari future warning by @sfmig in #594
- Temporarily suppress napari warnings by @lochhh in #592
- Replace numpy legacy random generation by @lochhh in #597
- Update the contributing guide by @niksirbi in #598
- Refactor
reports.py
by @lochhh in #557 - Ignore SWC URL in linkcheck by @lochhh in #601
- Add I/O support for the ndx-pose NWB extension: take 2 by @niksirbi in #360
Full Changelog: v0.6.1...v0.7.0
v0.6.1
What's Changed
Small updates to documentation
- Add Mahi7828 as contributor and change str to locate section by @sfmig in #576
- Clarify x,y data in VIA-tracks by @sfmig in #577
- Add announcement banner for open software week by @niksirbi in #578
- Added a sub-gallery for "Advanced" examples by @niksirbi in #582
- Add ShigrafS to github contributors by @niksirbi in #587
- Contributors-Readme-Action: Update contributors list by @github-actions in #589
- Update animovement website URL by @lochhh in #588
Internal refactoring of the kinematics module
Note
The interface for using all kinematics functions remains unchanged
Full Changelog: v0.6.0...v0.6.1
v0.6.0
What's Changed
Highlight: ✨ See into the past and future ✨
@sfmig has worked hard to visualise point trajectories as "tracks" in napari
.
In effect, this means that in our GUI you can now display each point's past ("tail") and future ("head").
Read more about it the updated guide.
- Add tracks to napari visualisation by @sfmig in #476
- Update GUI docs with tracks details by @sfmig in #547
Documentation
- Update upgrading instructions by @sfmig in #551
- Add people section and support for automatic contributors list update by @lochhh in #554
- Contributors-Readme-Action: Update contributors list by @github-actions in #559
- Removed warning about package being in early development by @niksirbi in #560
Bug fixes
- Fix
_warn_about_nan_proportion
bugs by @lochhh in #541 - Fix: frame slider to show max n of frames across all loaded files by @sfmig in #503
- Fix: update frame slider after deletion of layers by @sfmig in #504
- Ensure derived data variables have correct name by @Ishaan0132 in #523
- Fix for bboxes dataset loading by @sfmig in #561
- Fix duplicate reference when closing and reopening napari widget by @sfmig in #575
Housekeeping
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #545
- Speed up test data caching in CI by @niksirbi in #566
- Bump pyvista/setup-headless-display-action from 3 to 4 by @dependabot in #568
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #572
- Restrict napari version to >=0.6.0 by @niksirbi in #570
New Contributors
- @github-actions made their first contribution in #559
Full Changelog: v0.5.1...v0.6.0
v0.5.1
Note
This release changes the way we do logging in movement
, which fixes a bug (certain warnings were not showing up on the console) and impacts developers. We encourage contributors to the consult the "Logging" section of the updated contributing guide.
What's Changed
- Small fixes to the ROI distances and angles example by @niksirbi in #521
- Fix Runtime Warning raised by ROI plot test by @harsh-bhanushali-05 in #534
- Add focus areas for 2025 to the roadmaps page by @niksirbi in #535
- Replace
logging
withloguru
by @lochhh in #467
New Contributors
- @harsh-bhanushali-05 made their first contribution in #534
Full Changelog: v0.5.0...v0.5.1
v0.5.0
Highlight
Our Regions of Interest (RoI) classes now have a .plot
method for conveniently showing the RoI with matplotlib
.
@willGraham01 has showcased this and other cool RoI features—like computing distances and angles relative to RoIs—in a new comprehensive example.
What's Changed
.plot
method for RoIs by @willGraham01 in #447- Ensure dataset attributes are not set to None by @Ishaan0132 in #493
- Example for Boundary Angle Calculations by @willGraham01 in #440
Full Changelog: v0.4.0...v0.5.0
v0.4.0
What's Changed
@sfmig has added the ability to load tracked bounding boxes in our GUI, and has also improved the GUI user experience by matching the colour of the text labels to the colour of the displayed points.
- Data points text labels in napari by @sfmig in #466
- Extend napari plugin to bboxes' centroids by @sfmig in #434
A small fix to the docs:
- Correct confidence_array shape in from_numpy example docstring by @Ishaan0132 in #492
Full Changelog: v0.3.0...v0.4.0
v0.3.0
What's Changed
@willGraham01 and @stellaprins have summarised their work on spatial navigation features introduced during Jan-Feb 2025 in a blogpost.
- Blog Post for Jan-Feb features by @willGraham01 in #444
With the help of @angkul07 we've added a general rolling_filter
function, which can be used to apply a rolling median, mean, max, or min filters. The more specific median_filter
function is being deprecated and will be removed in a future release.
New Contributors
Full Changelog: v0.2.0...v0.3.0
v0.2.0
New feature
- Condition arrays: compute region occupancy by @willGraham01 in #421
Bug fix
Full Changelog: v0.1.0...v0.1.1
v0.1.0
The graphical user interface (GUI) is here!
This is the first release including our napari plugin, which we'll gradually develop into a fully fledged GUI for movement
. We have been working on a minimal version of this plugin for a while and are happy to share it with the world with this release.
Read this guide on how to use it.
- Minimal viable version of the
movement
plugin fornapari
. by @niksirbi in #450 - Fix: remove NaN points before passing to points layer by @sfmig in #465
Regions of interest and spatial navigation
This chunk of work was spearheaded by @willGraham01 and includes many goodies for analysing tracking data in relation to user-defined regions of interest. Stay tuned for more to come in the next releases.
- Introduce decorator for broadcasting 1D methods by @willGraham01 in #397
- add point_is_inside to BaseRegionOfInterest by @stellaprins in #413
- Fix
compute_signed_angle_2d
using 2D boolean indexing by @willGraham01 in #432 - Add functionality for computing ego- and allocentric angles to RoIs by @willGraham01 in #416
- Remove toggles for signed angle computations by @willGraham01 in #445
Quick plots
Mostly thanks to @stellaprins, movement
now includes a plots
submodule, currently offering two functions for quickly visualising trajectories and occupancy heatmaps.
- Plotting wrappers: Head Trajectory by @stellaprins in #394
- Plotting Wrappers: Occupancy Histogram by @willGraham01 in #403
- Use
plot_trajectory
in broadcasting example by @willGraham01 in #414 - Sp/417 bug fix plot trajectory by @stellaprins in #425
- Rename plot_trajectory --> plot_centroid_trajectory by @sfmig in #474
New and overhauled examples
Many of our examples were updated in this release, but we'd like to draw special attention to the ones on pupil tracking and head direction. Our more advanced users may appreciate the new example on broadcasting functions along data dimensions.
- Eye movement example by @stellaprins in #429
- Reframe polar coordinates example around head direction by @niksirbi in #426
- Introduce decorator for broadcasting 1D methods by @willGraham01 in #397
Housekeeping
As usual, it takes lots of work to keep the lights on. We'd like to draw particular attention to two changes that may impact users:
- We've updated the supported Python versions to 3.11 - 3.13
- The
print_report
parameter now defaults toFalse
for all functions in themovement.filtering
module.
- Tiny fix in docstrings for
configure_logging
by @sfmig in #411 - replace xarray median and mean with numpy by @Kasra-Shirvanian in #419
- Clarify error raised by ValidHDF5 by @niksirbi in #424
- Update Python versions to adhere to SPEC 0 by @adamltyson in #442
- Remove Intel Macs from CI workflow by @niksirbi in #449
- Add
make
docs note for PowerShell users by @lochhh in #430 - Use raw string for regex by @lochhh in #452
- Set print_report to False by default in filtering functions by @Ishaan0132 in #456
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #460
- Update test_and_deploy.yml to remove
nodefaults
conda channel by @sfmig in #462
New Contributors
- @Kasra-Shirvanian made their first contribution in #419
- @Ishaan0132 made their first contribution in #456
Full Changelog: v0.0.23...v0.1.0