Package: ngmt
NGMTWelcome to the NeuroGeriatricMotionToolbox (NGMT). We are a Python based toolbox for processing motion data.The toolbox is currently under development and is not yet ready for use.The toolbox is aimed at a wide variety of motion researchers who want to use open souce software to process their data.
We have implemented a wide variety of functions to process motion data, such as:Gait sequence detection (GSD)Inital contact detection (ICD)More to follow ...The idea is that various motion data can be loaded into our dedicated dataclasses which rely on principles from theMotion-BIDSstandard.Data classesData classes: conceptual frameworkMotion data is recorded with many different systems and modalities, each with their own proprietary data format. NGMT deals with this by organizing both data and metadata in aBIDS-like format. The BIDS format suggests thatmotion recording datafrom a single tracking system is organized in a single*_tracksys-<label>_motion.tsvfile.[!NOTE]A tracking system is defined as a group of motion channels that share hardware properties (the recording device) and software properties (the recording duration and number of samples).In NGMT, data from a single tracking system is therefore loaded into a singlepandas.DataFrame. The column headers of thispandas.DataFramerefer to the channels, and the correspondingchannels informationis likewise available as apandas.DataFrame.Similarly, if anyeventsare available for the given recording, these are loaded into a singlepandas.DataFramefor each tracking system as well.Data classes: in practiceThese concepts are translated into a NGMT dataclass for each recording:NGMTRecording:classDiagram
   class NGMTRecording {
      data: dict[str, pd.DataFrame]
      channels: dict[str, pd.DataFrame]
      info: None | dict[str, Any] = None
      events: None | dict[str, pd.DataFrame] = None
      events_info: None | dict[str, Any] = None
   }A recording consists of the motion data from one or more tracking systems, where each tracking system may consist motion data from one or more tracked points. Therefore, the motion data (NGMTRecording.data) are organized as a dictionary where the dictionary keys refer to the tracking systems, and the corresponding values the actual (raw) data as apandas.DataFrame. The description of data channels (NGMTRecording.channels) is availabe as a dictionary with the same keys, and the values contain the channels description.>>>fromngmt.datasetsimportmobilised>>>file_name="/mnt/neurogeriatrics_data/Mobilise-D/rawdata/sub-3011/Free-living/data.mat">>>recording=mobilised.load_recording(file_name,tracking_systems=["SU","SU_INDIP"],tracked_points=["LowerBack"])>>>recording.data{'SU':LowerBack_ACCEL_x...LowerBack_BARO_n/a00.967784...1011.62810010.969667...1011.628400............9930220.970579...1012.0787039930230.960542...1002.580321[993024rowsx10columns],'SU_INDIP':LowerBack_ACCEL_x...LowerBack_MAGN_z00.967986...-5.90283310.963671...9.501037............9930220.951656...-17.9879839930230.955107...-18.050600[993024rowsx9columns]}>>>recording.channels{'SU':nametypecomponenttracked_pointunitssampling_frequency0LowerBack_ACCEL_xAccxLowerBackg100.01LowerBack_ACCEL_yAccyLowerBackg100.02LowerBack_ACCEL_zAcczLowerBackg100.03LowerBack_ANGVEL_xGyrxLowerBackdeg/s100.04LowerBack_ANGVEL_yGyryLowerBackdeg/s100.05LowerBack_ANGVEL_zGyrzLowerBackdeg/s100.06LowerBack_MAGN_xMagxLowerBackµT100.07LowerBack_MAGN_yMagyLowerBackµT100.08LowerBack_MAGN_zMagzLowerBackµT100.09LowerBack_BARO_n/aBarn/aLowerBackhPa100.0,'SU_INDIP':nametypecomponenttracked_pointunitssampling_frequency0LowerBack_ACCEL_xAccxLowerBackg100.01LowerBack_ACCEL_yAccyLowerBackg100.02LowerBack_ACCEL_zAcczLowerBackg100.03LowerBack_ANGVEL_xGyrxLowerBackdeg/s100.04LowerBack_ANGVEL_yGyryLowerBackdeg/s100.05LowerBack_ANGVEL_zGyrzLowerBackdeg/s100.06LowerBack_MAGN_xMagxLowerBackµT100.07LowerBack_MAGN_yMagyLowerBackµT100.08LowerBack_MAGN_zMagzLowerBackµT100.0}[!NOTE]In the examples you find atutorial (the basics of NGMT)that explains the basics of the dataclass and how to work with them.DocumentationThe full documentation can be foundhere.InstallationThe toolbox has been released onpypiand can be installed via pip:pipinstallngmtIt requires Python 3.10 or higher.AuthorsMasoud Abedinifar,Julius Welzel,Walter Maetzler,Clint Hansen&Robbin Romijnders