Skip to content

Enable loading netCDF files in the napari widget #666

@niksirbi

Description

@niksirbi

The problem

Our napari loader widget can currently load files from the supported third-party formats, but not from netCDF files—our recommended format for natively saving movement datasets.

In practice, this means that if users load data from DeepLabCut, SLEAP, etc., clean it with movement, and then save the processed dataset to a netCDF file (as we recommend), they have no straightforward way to explore the data in napari. This is a gap we should address.

Possible solution

  • Add netCDF (or rather movement) as an option in the "source software" dropdown selector.
  • On "Load", attempt to open the file with xarray.open_dataset(), looking for variables named position, confidence, and shape. At minimum, position should be required, with informative errors raised if it is not found.
  • Load position and confidence as we currently do for pose datasets, i.e. into Points and Tracks layers. If a shape variable is present, also load it as a Shapes layer for bounding boxes.

This approach assumes the standard naming convention (position, confidence, shape) used in movement datasets. However, users may have saved data under different names (e.g. position_filtered or something unrelated). A more general solution would be to allow users to manually map variables in the netCDF file to the expected ones, but that could be implemented separately after we have a minimal working version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIGraphical User InterfaceenhancementNew optional feature

    Type

    No type

    Projects

    Status

    🤔 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions