All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog (+ the Migration Guide and Scientific Changes section), and this project adheres to Semantic Versioning.
For more information see the Github Releases Page of this project.
The package updates in 2.5.0 broke some things. These are now fixed.
- For the parameter errors, the order of the output parameters has changed slightly, as they are now sorted to avoid future breaking changes, based on changes in the sor policy in pandas
- The matches for the stride matching are now sorted to avoid future breaking changes, based on changes in the sor policy in scipy sparse arrays
- The
PCAAlignment
is now more robust by enforcing a direction of the first principal component. The method also has a new attributenormalized_pca_components_
that hold the components after this adjustment. This change might result in different results for the PCA step of the alignment. However, in combination with the forward direction alignment, the results should be identical to the previous version.
Looser version constrains
- Fixed a bug in the filtered rampp event detection. Replaced gyr_ml to gyr_ml_filtered so that we look for the gradient on the filtered signal. (#66)
- All orientation and trajectory methods now have a new parameter
rotated_data_
that provides the input data rotated to the world frame based on the calculated orientation. (#64) - The Spatial Parameter Calculation now also calculates the "Range of Motion" (i.e. the angle change of the sensor in the sagittal plane) (#54)
- Fixed a bug that when using
merge_interval
with empty input of shape (0, 2), the output was not empty. (#61) - Fixed a bug that an error was raised when importing from the TrajectoryReconstruction module without gaitmap_mad installed (#63)
- Changed resampling function in inverse feature transform of HMM.
Resampling of state sequence is now also possible if the
target_sample_rate
is not a multiple of the HMM sampling rate, e.g.target_sample_rate=200
,sample_rate=52.1
(#62) - Dropped Python 3.8 support! (#64)
- Example data is now automatically downloaded if it is not already present. (#49)
- Spatial parameter calculation now works when no strides are detected for a sensor. (#48)
- Fixed bug in HMM when uneven sequnece length were provided. In newer numpy versions this requires an explicit cast to an object array.
- Fixed edecase where the output of the stride event method had the events in the wrong order for some strides.
The reason for that is that a valid segmented stridelist does not always result in a valid min_vel_event list for
algorithms that are allowed to search outside the segmented stride region (e.g.
HerzerEventDetection
). We now check for consistency again after the stride list conversion.
Gaitmap is now available as official PyPi package!!!
- New Algorithm:
MadgwickRtsKalman
. This is a slightly modified implementation of theRtsKalman
algorithm. Instead of naive gyro integration it uses theMadgwick
algorithm to estimate the orientation. (#15) - Certain ZUPT detectors now return the
min_vel_index_
andmin_vel_value_
as additional attributes. These values represent the index in the input data with the lowest velocity and the corresponding velocity value (according to the internal metric of the repective ZUPT detector). (#16) - New example explaining more advanced usage of the
RtsKalman
algorithm. (#17) - The
find_extrema_in_radius
and thesnap_to_min
utility functions gained the ability to define asymetric search windows around the search indices. (#21) - Temporal and Spatial Parameter calculation have new options to work with ic-stride lists and with partial input information
- A new method
calculate_parameter_errors
(old version is renamed tocalculate_aggregated_parameter_errors
) is added that allows to calculate just the errors (i.e. relative error, absolute error, etc.) for a given list of parameters. If you want to have the aggregated parameter errors (i.e. mean absolute error, mean relative error, etc.) use thecalculate_aggregated_parameter_errors
method.
- We now require Pandas >2.0 as we are using the new pandas dtypes. It could be that this will require you to perform some sxplicit type conversion in your code.
- The Zupt Detector example is updated to use newer tpcp features (#17)
- The column order of the Spatial Parameter Calculation output has been changed
- The function
calculate_parameter_errors
is renamed tocalculate_aggregated_parameter_errors
function is now more general and can be used with parameter lists that don't represent strides. For this the unique-id column (i.e. original stride index) is can be explicitly set and all wording is changed to be more general. (#24) - Fixed a bug that the calculation of the ICC in
calculate_parameter_errors
/calculate_aggregated_parameter_errors
was not working correctly, when the stride ids where duplicated across sensors.
- HIGHLIGHT: Finally reworked the HMM branch, added tests and documentation and adapted the API to fit the rest of the gaitmap and tpcp ecosystem better. (#3). On the way, there were also some bugs fixed and internal computations were optimized. If you were using the HMM branch before, read through the HMM examples again before updating! All the classes and methods have new names and import paths. Further, you will likely not get exactly the same results. However, when using the pretrained model, changes should be minimal. If you were training your own model, it might be that you get different results, as you might have been effected by a bug in the training code when using "labeled" training with the composite model (for details: #4). This is fixed now! So please retrain your models.
- A new version of the
RamppEventDetection
is added.FilteredRamppEventDetection
adds a lowpass filter before the detection of the IC to remove potential high-freq artifacts. - New higher level transformers that allow for complex combinations and chaining of transformers.
Most of them make use of the new
tpcp
composite Algorithm feature that allows to easily get and set complicated nested parameters. New transformers include:ChainedTransformer
,ParallelTransformer
(#2) - New implementation of a Filter class and a
ButterworthFilter
implementation on top of the transformer API. (#2) - Added a new
flip_dataset
function that can be used instead ofrotate_dataset
, when you only need to perform 90/180 degree rotations. It is much faster thanrotate_dataset
, as it just flips the axis labels and multiplies values by -1. (#10) - New Zupt detecor methods:
AredZuptDetectors
andShoeZuptDetectors
. The ARED detector is a special case of the existingNormZuptDetector
(using specifically the mean of the gyr norm) and the SHOE detector uses a combination of acc and gyr data. (#11) - All Zupt detectors have a new parameter
window_overlap_samples
that can be used as alternative towindow_overlap
to specify the window overlap in samples independent of the sampling rate. (#11) - Added new example to show how the Zupt Detector can be tuned to improve the performance of the trajectory estimation kalman filter. (#11)
- It is now possible to only detect a subset of the supported events of an event detection method using the
detect_only
parameter. (#12) - The function
calculate_parameter_errors
now also outputs the number of strides used for matching per parameter. (#13) - The function
calculate_parameter_errors
returns way more parameters. All basic statistics are now calculated for the error, relative error, absolute error and the relative absolute error. Ifpingouin
is installed, we also calculte the ICC. (#13) - A new utility method to intersect stride lists by a region of interest list. (#14)
- A new ZuptDetector method
StrideEventZuptDetector
that simply returns the min_vel events of an already provided event list as ZUPTs. This is enabled by the newstride_event_list
parameter of thedetect
method of all ZuptDetector methods (see Changes) (#14) - A new ZuptDetector method
ComboZuptDetector
that allows to combine the output of multiple ZuptDetector methods using either logical "or" or "and". (#14) - The
PerSampleZuptDetectorMixin
andRegionZuptDetectorMixin
are now public API to simplify the implementation of custom ZUPT detectors. (#14)
- When using
memory
with any of Dtw methods, we will not cache the peak detection step anymore. It does not really speed up things and just leads to dozents of cache writes/reads as the chance of a cache match is really low. - The
zupts_
result ofRtsKalmanFilter
is not a pandas dataframe withstart
andend
columns instead of a np.ndarray. The content remains the same. - The
sampling_rate_hz
parameter of thedetect
method of theEventDetection
algorithms is now keyword only. (#12) - For the function
calculate_parameter_errors
the naming of ground truth was changed to reference and input to predicted. This change requires updating the function call in your code. (#13) - For all trajectory/pos/ori methods, the
sampling_rate_hz
parameter is now keyword only. This might require some user facing code changes. (#14) - Trajectory/pos/ori and ZUPT methods can now get an optional parameter called
stride_event_list
as parameter for the detect method. So far, only the RTS Kalman Filter is using this parameter to forward it to the ZUPT method. Both wrapper (Stride-level and Region) are both aware of this parameter and pass them correctly down to the respective methods. (#14) - The util method
start_end_array_to_bool_array
now assumes that the end index of all regions is inclusive. This enables roundtrip conversion with thebool_array_to_start_end_array
method and is in line with the definitions used for strides, ROIs, and ZUPTs in gaitmap. Further, the method now supports to output arrays that are shorter than the largest input index. Before, this resulted in an error. Both changes might require some user facing code changes, if this function is used. However, as it was not used internally, it is likely that no one was using it anyway. (#14)
- The
find_zupts
method of theRtsKalmanFilter
and all deprecated arguments are now fully removed in favor of the dedicated ZUPT algorithms. The parameters where deprecated since version 1.5
- There are a bunch of small changes that are not backwards compatible.
The most important is likely the change to make the
sampling_rate_hz
parameter (and other) keyword only in many methods. This means, you need to use the parameter name when calling these methods. For example, if you useddetect(data, 100)
before, you now need to usedetect(data, sampling_rate_hz=100)
.
Fixed issues with namedtuple inheritance in Python 3.9.
Fixed some dependencies and internal links that where broken after the move to Github.
This release is the first release on Github! For this release we also had to modify the code history with a nasty rebase to remove some sensitive files from the history. This means, the old commit hashes listed in the pull request are not valid anymore. To avoid confusion and signal this change, this is a new major version.
- This release splits gaitmap into two separate packages: gaitmap and gaitmap_mad. To use all algorithms as before, you need to explicitly install both packages. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/182)
- For most algorithms, direct import via the full module path is now discouraged.
Instead, import it via the parent module.
The individual algorithm files now have a leading
_
to mark them as private. Note, some algorithm files do not exist at all anymore at the old path, as they are moved togaitmap_mad
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/182)
- This release removes Python 3.7 support!
- Data Transforms are added as a new algorithm class.
These are simple algorithms that can take a single sensor data as input and provide a
transformed_data_
output. Transforms can be used for normalisations or feature transforms. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/148) - A new helper function
gaitmap.utils.array_handling.iterate_region_data
is added. It allows to iterate over the data of multiple strides or ROIs cut from a dataset. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/149) - A new helper (
gaitmap.utils.datatype_helper.to_dict_multi_sensor_data
) to convert DataFrame based MultiSensor data to Dict-based MultiSensor data is added. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/149) - A new example (
stride_segmentation/barth_dtw_custom_template.py
) is added, which explains how to create custom dtw-templates from data. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/149)
- All Algorithm classes now build on
tpcp.Algorithm
. This is a major change and might result in some unexpected incompatibilities with older code. The core functionality of tpcp should still work as expected. If you were using any of the base classes and algorithm helpers, check if they are still available in gaitmap. If not, there is likely a replacement in tpcp. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/173) - The way DTW - templates are generated has been changed completely.
Generation is now handled via BaseClasses instead of helper functions.
These baseclasses follow the "optimizable" interface introduced in
tpcp
. Further, all templates now use the new data transforms instead of a fixed scaling factor. In combination, it should be much easier to create new templates and use more complex data normalisations. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/149) - Spatial gait parameters can be calculated, even if some gait parameters are missing.
- We removed the entire
gaitmap.future
package. This was marked experimental anyway. All functionality has been moved into thetpcp
package. For most methods and functions, it should be enough to just change the import statement. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/173) - We removed
create_dtw_template
andcreate_interpolated_dtw_template
as ways to create templates. Instead, you should now useDtwTemplate
andInterpolatedDtwTemplate
classes directly. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/149) - tslearn is dropped as dependency. Instead we have vendored the set of functions we need. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/181)
- Python 3.7 support is dropped. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/181)
- If you were creating custom templates, you should now use the
DtwTemplate
andInterpolatedDtwTemplate
classes. Check the new example (stride_segmentation/barth_dtw_custom_template
) for more information, on how to use these new classes. - If you were using scaling factors for DtwTemplates you should now use the new transformers in
tpcp.data_transforms
instead. To replace a fixed scaling factor, useFixedScaler(scale=500)
. However, in many cases you might be better off using one of the Trainable scalars to automatically learn the scaling factors from the template. - If you worked with the raw data of the
BarthDtwTemplate
, be aware that the stored data is now unscaled (i.e. multiplied by 500 compared to the old version).
- We fixed a bug with the sign of the TC and IC angle. They were flipped for real sensor data. Now they correctly follow the conventions Kanzler2015 This is a breaking change and your angle results will be different! (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/180)
- A new submodule for ZUPT-Detection Algorithms and a first implementation in form of the
NormZuptDetector
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/167) - New sub module in preprocessing for sensor alignment functions (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/161)
- New algorithm
PcaAlignment
for sensor heading alignment using 2D PCA to align sensor frame to medio-lateral plane (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/161) - New position method
PieceWiseLinearDedriftedIntegration
using piece wise linear dedrifted integration utilizing zupt updates. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/166) - A new algorithm (
ForwardDirectionSignAlignment
) to detect the walking direction to automatically align the sensor attachment orientation. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/171) - An example that explains how to automatically align a sensor to the gaitmap coordinate system, when it was attached in an arbitrary orientation. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/171)
- The
HerzerEventDetection
- Algorithm, specifically designed to work with stair gait. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/158)
- Cloning is now more robust and falls back to deep cloning objects that are not algorithms. This prevents issues when mutable objects (other than nested algorithms) are used in parameters (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/170)
- We now handle mutable defaults to prevent strange edge cases! Read more about it in the
project_structure
guide under the development-guide tab in the Documentation. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/168) - The constrained DTW only tracks a single counter now. By using the positive and the negative value range, we can save 1/3 of the overall RAM. This should improve performance. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/155)
RtsKalman.find_zupts
now gets passed the entire data before any unit conversions. Before it only got the gyro data already converted in rad/s. This change should make it easier to overwrite the ZUPT detection with custom methods. This is a breaking change! See the migration guide for more details. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/159)- The Zupt-Detection of
RtsKalman
is now handled via dependency injection. Instead of specifying a list of parameters for the Zupt detection you can simply pass a instance of a Zupt detector. (seegaitmap.zupt_detection
). The old parameters a deprecated. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/169) - The
memory
option forRtsKalman
was removed. This is a breaking change! (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/159)
- The parameters
"zupt_threshold_dps", "zupt_window_length_s", "zupt_window_overlap_s"
forRtsKalman
are now deprecated. Instead, a Zupt-Detector instance should be used. When converting from the current parameters to the newNormZuptDetector
class, note that the overlap is now specified as a fraction of the window length and not in seconds! (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/159)
- The
memory
option forRtsKalman
was removed. This is a breaking change! (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/159)
- Bugfix for
gaitmap.gait_detection.ullrich_gait_sequence_detection
: Now proper handling of cases where margin should be added but no gait sequences were detected (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/157)
- We removed the orientation update feature of the
RtsKalman
class. This feature was off by default. Unless you explicitly enabled it, you should be fine. In case you used the feature, remove all references to the respective keywords. - The call signature and the units of the gyro data passed
RtsKalman.find_zupts
has changed. In case you where using custom subclasses ofRtsKalman
to implement custom zupt methods, you need to update your zupt methods for the new input structure. However, due to the new changes to ZuptDetectors, it is likely that you do not need a custom subclass anymore, but can simply pass a instance of a ZuptDetector to the Kalman class - The
memory
option forRtsKalman
was removed, as it was not particularly useful. In case you need caching we recommend implementing it externally.
- The "ori_update" feature of the Kalman filter was removed again. The feature was experimental anyway, but in turns out the implementation was actually wrong. The RTSKalman filter tracks the change in error state open-loop. This means errors are not applied during ZUPT-measurements, but simply added up and corrected at the very end. This works well for position and velocity, but the equations for orientation assume, that the orientation error remains small enough so that a linearization and separation of the angle error on the different axis is possible. When the filter is run open loop, it is very likely that the orientation error will quickly reach ranges, where this doesn't hold anymore. We concluded that the used method to track the orientation error (and hence, correct it directly) is not suitable for open-loop Kalmanfilter designs. It is unlikely that the feature will be added again in the future. However, prior versions can be used as reference to implement a closed loop Kalmanfilter with direct observations of the orientation error. This is a breaking change! See the Migration section for more details, if you used this feature before. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/159)
With 1.4. we finally realize the longterm goal to make the comparison of algorithms easy and unify code across dataset
and algorithms.
The highlights of this release are the new experimental Dataset
and Pipeline
classes and first-class support for
trainable algorithms.
- New module for experimental features. Things implemented there might be changed or deleted without deprecation (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/122)
- New dataset class that will serve as the base class for all future datasets in
gaitmap.future
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/122, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/132) - New example on how to create custom datasets with the new dataset-class (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/132)
- The new gaitmap logo is now shown everywhere :) (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/129)
- New parameter
zero_division
added to all methods ingaitmap.evaluation_utils.scores
allowing for setting the return value in case of a zero_division happening. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/134) - A new interpolation method
gaitmap.utils.array_handling.multi_array_interpolation
to interpolate multiple 2D arrays at once to the same length. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/138) - Baseclasses to build custom pipelines are added (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/128)
- A GridSearch optimizer (similar to GridSearchCV in sklearn, but without the CV part) with a respective example is added. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/128)
- A generic wrapper for algorithms and pipelines that can be optimized/trained with respective example. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/128)
- Added a warning about providing multiple methods when using any trajectory wrapper class to prevent user error. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/142)
- Added a new
safe_run
method to pipelines that should be used over the normalrun
method.safe_run
performance multiple checks to catch potential implementation errors in user created pipelines. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/144) - New parameter
enforce_consistency
added togaitmap.event_detection.RamppEventDetection
to make event detection postprocessing optional. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/136) - A GridSearchCV optimizer (similar to GridSearchCV in sklearn) with respective example is added. This version is specifically implemented for gaitmap and has some fancy ways of performance optimization. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/139)
- A cross-validation function is added to evaluate optimizable pipelines of any kind. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/139)
gaitmap.gait_detection.ullrich_gait_sequence_detection.UllrichGaitSequenceDetection
now has the option to add a margin that will be symmetrically added around the detected gait sequences. This should help to included intervals before and after steady state gait, that can be missed by the algorithm. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/152)
- Changed the output format of
gaitmap.evaluation_utils.scores.precision_recall_f1_score
so it will be easier to use with the pipelines and optimizer. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/133) - Made parameters for
gaitmap.evaluation_utils
keyword only to avoid input confusion. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/135) - Improved the performance of dtw template interpolation by a factor of 15-30 (depending on the interpolation type). (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/138)
- File based dtw templates do not implicitly cache the template data anymore.
This means calling
get_data
on the template does not change the object anymore, which is desirable in the context of caching. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/143)
gaitmap.utils.array_handling.interpolate1d
was removed as it is not needed anymore internally. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/138)
- After internal updates of scipy>=1.6 we now manually handle empty orientation inputs in
gaitmap.parameters.spatial_parameters._calc_turning_angle
andgaitmap.parameters.spatial_parameters._compute_sole_angle_course
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/153, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/154)
- If you used
gaitmap.evaluation_utils.scores.precision_recall_f1_score
, the output is now a dictionary instead of a tuple. Migration should be straight forward. - Some parameters are now keyword only. In case you get an unexpected error, telling you that "an algorithm only receives n positional arguments, but you provided n+1", double-check the call signature.
- New evaluation function to compare the output of temporal or spatial parameter calculation with ground truth. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/105)
- New function for merging intervals that are overlapping and that are within a specific distance from each other in
utils.array_handling
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/120) - Some algorithms now support caching intermediate results with
joblib
. There is also a new example explaining caching in more detail. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/126 (mostly reverted), https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/127) - Experimental support for ZUPT based orientation updates in the
RtsKalman
filter. This approach is not fully validated and should be used with care. If the feature is turned on, a runtime warning will indicate that as well. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/113) RtsKalman
has a new resultszupts_
that can be used to check which zero-velocity region were used by the filer. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/113)- A new guide on how to evaluate (gait)parameters using parameter optimization and cross validation. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/124)
evaluation_utils.stride_segmentation._match_label_lists
now works for n-D and should be faster for large stride length. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/110)- Internal refactoring of how the algorithms combine the results of the single sensors to the final output. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/116)
- Starting from this release the name "sensor data" instead of "dataset" is used to refer to data from multiple sensors within one recording. The term "dataset" will be used in the future to describe entire sets of multiple recordings potentially including multiple participants and further information besides raw IMU data. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/117)
- Internal refactoring that should improve typing.
mypy
now only returns a couple of issues that are not easily fixable or actualmypy
bugs. They will be resolved step by step in the future. mypy checking can be done using the new commanddodo type_check
and developer should try to not introduce further typing issues. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/118) The refactoring also required some small user facing changes:- The
regions_of_interest
parameter ofRoiStrideSegmentation.segment
is now keyword only to be compatible with theStrideSegmentation
base class.
- The
- The
UllrichGaitSequenceDetection
now returns a dict also in the case of merged gait sequences. The gait sequences stored for all sensor are set equal. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/121) gait_detection.ullrich_gait_sequence_detection
now usesutils.array_handling.merge_intervals
and should therefore be able to merge sequences faster. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/120)- The
regions_of_interest
parameter ofRoiStrideSegmentation.segment
is now keyword only to be compatible with theStrideSegmentation
base class. RtsKalman.covariance
now has the shape(len(data), 9 * 9)
instead of(len(data) * 9, 9)
which should make it easier to plot.
gait_detection.ullrich_gait_sequence_detection._gait_sequences_to_boolean_single
has been made redundant byutils.array_handling.merge_intervals
and was therefore removed. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/120)- Removed old serialization format for DTW templates that was deprecated a couple of releases ago. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/issues/127)
- In
stride_segmentation.roi_stride_segmentation
the assignment of the offset corrected strides to thecombined_stride_list
was fixed. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/114) - Added a note to BarthDTW to clarify the calculation of the distance matrix.
- Changed the Chebyshev distance function in
evaluation_utils.stride_segmentation._match_label_lists
to a general one that can use n-D input. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/115) - Fixed bug in
utils.static_moment_detection.find_static_samples
where extremely short sequences, which would only fit a single window, would fail. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/109)
- Due to the renaming of dataset to sensordata, a couple of names and import path are changed:
- All imports from
gaitmap.utils.dataset_helper
should be changed togaitmap.utils.datatype_helper
SingleSensorDataset
,MultiSensorDataset
andDataset
are now called,SingleSensorData
,MultiSensorData
andSensorData
, respectively.- The functions
is_single_sensor_dataset
,is_multi_sensor_dataset
,is_dataset
, andget_multi_sensor_dataset_names
are renamed tois_single_sensor_data
,is_multi_sensor_data
,is_sensor_data
, andget_multi_sensor_names
.
- All imports from
- An Error-State-Kalman-Filter with rts smoothing (
RtsKalman
) was added that can be used to estimate orientation and position over longer regions by detecting its own ZUPTs. This can (should) be used in combination withRegionLevelTrajectory
. - A
RegionLevelTrajectory
class that calculates trajectories for entire ROIs/gait sequences. Otherwise the interface is very similar toStrideLevelTrajectory
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/87, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/98, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/85) - Added a new example for
RegionLevelTrajectory
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/87) - Support for trajectory methods that can calculate orientation and position in one go is added for
StrideLevelTrajectory
(https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/87) - Implemented local warping constraints for DTW. This should help in cases were only parts of a sequence are matched
instead of the entire sequence.
These constraints are available for
BaseDTW
andBarthDTW
, but are off by default. A new classConstrainedBarthDTW
was added, that has the constraints on by default. - Added support for
MultiSensorStrideLists
for all evaluation functions inevaluation_utils.stride_segmentation
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/91) - Global validation errors for region of interest list (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/88)
- Global validation errors for orientation/position/velocity lists (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/88, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/95)
- New evaluation functions to compare the results of event detection methods with ground truth (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/92)
- Added the functionality to merge gait sequences from individual sensors in
UllrichGaitSequenceDetection
(https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/93)
- The initial orientation for the Stride and Region Level trajectory now uses the correct number of samples as input.
This might change the output of the integration method slightly!
However, it also allows to pass 0 for
align_window_length
and hence, just use the first sample of the integration region to estimate the initial orientation. (mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/98) - It is now ensured that in all in gaitmap where a start and an end sample is provided, the end sample is
exclusive.
Meaning if the respective region should be extracted from a dataarray, you can simply do
data[start:end]
. All functions that used different assumptions are changed. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/97~, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/103) - The default check for orientation/position/velocity lists now only expects a "sample" column and not a "sample" and a
"s_id" column by default.
The
s_id
parameter was removed and replaced with a more generic{position, velocity, orientation}_list_type
parameter than can be used to check for either stride or region based lists. See the migration guide for more information. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/88) - Internal restructuring of the evaluation utils module. In case you used direct imports of the functions from the submodule, you need to update these. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/92)
- Fixed possible
ZeroDivisionError
when usingevaluation_utils.scores
. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/104)
- In case your algorithm uses
is_{single,multi}_sensor_{position, velocity, orientation}_list
all usages must be updated to include{position, velocity, orientation}_list_type="stride"
to restore the default behaviour before the update. If you were using the function withs_id=False
, you can update to{position, velocity, orientation}_list_type=None
to get the same behaviour.
- All Dtw based methods now produce outputs that follow our index guidelines. This means that they correctly produce matches, which end index is exclusive. In some cases this might change existing results by adding 1 to the end index. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/103)
- The initial orientation in the StrideLevelTrajectory now has a window with exactly the number of samples specified (instead of one less due to Python indexing). This will lead to very small changes in the calculated trajectory. (mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/98)
- Proper support for gait sequences and regions of interest in the stride segmentation
(https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/64,
https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/71,
https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/75).
Note that support was first implemented in the segmentation algorithms directly and then reworked and moved into the
RoiStrideSegmentation
wrapper class. - "Max. lateral excursion" and "max. sensor lift" are now implemented as two new spatial parameters. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/79)
- The
align_heading_of_sensors
method has now an option to run an additional smoothing filter that can avoid misalignments in certain cases. VelocityList
is now a separate dtype representing integrated velocity values (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/77)UllrichGaitSequenceDetection
now has its own example in the Sphinx Gallery (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/83)- Added a new module
gaitmap.utils.signal_processing
for general filtering and processing purposes (mainly for moving some functions fromUllrichGaitSequenceDetection
(https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/83)
The new evaluation_utils
module https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/issues/117
A new module was started that will contain helper functions to evaluate the results of gait analysis pipelines. This is the first version and we already added:
- A set of function to compare stride lists based on start and end values (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/66)
- A set of common metrics (recall, precision, f1) that can be calculated for segmentation results (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/66)
https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/issues/72, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/issues/16
To make developing new algorithms easier and error messages easier to understand for users,
we modified the data-object validation helper to raise proper descriptive error messages.
The data-object helpers now have an optional argument (raise_exception=True
) to trigger the new error-messages.
- Proper validation for the dataset objects. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/80)
- A new
is_dataset
method to validate either single or multi-sensor datasets. This should be used in functions that should work with both inputs. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/80) - Proper validation for the stride list objects. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/86)
- A new
is_stride_list
method to validate either single or multi-sensor stride lists. This should be used in functions that should work with both inputs. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/86) - A custom error class
ValidationError
used for all validation related errors. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/80)
All existing algorithms are updated to use these new validation methods. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/80, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/84, https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/86)
The remaining datatypes will get updated validation functions in a future release.
- To get or load the data of a DtwTemplate you now need to call
get_data
on the method instead of just using thedata
property (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/73) This is done to conform with the basic class structure needed for proper serialization. - Changed function name
_butter_lowpass_filter
ingaitmap.gait_detection.UllrichGaitSequenceDetection
tobutter_lowpass_filter_1d
(https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/83) - Moved
butter_lowpass_filter_1d
androw_wise_autocorrelation
fromgaitmap.gait_detection .UllrichGaitSequenceDetection
to the new modulegaitmap.utils.signal_processing
(https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/83)
- The format in which DataFrame Attributes are stored in json has been changed. The old format can still be loaded, but this will be removed in future versions. Related to https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/72. See the migration guide for actions to take.
- Fixed a bug in the madgwick algorithms that might have caused some incorrect results in earlier version (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/70)
- Fixed issue that templates that were stored in json do not preserve order when loaded again (see more info in migration guide) (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/72)
- Fixed an issue that
rotate_dataset_series
performed an unexpected inplace modification of the data. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/78) - Fixed a bug that would break the
UllrichGaitSequenceDetection
in case of no active signal windows (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/commit/95736e8d2676f98d4c43ea0bfa3dbf3566542f71) - Fixed a bug that would break the
UllrichGaitSequenceDetection
in case the input signal was just as long as the window size. (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/commit/d516a40520f86bfd39ddcdd813b5c18312785085) - Adapted scaling factors for the usage of accelerometer data in the
UllrichGaitSequenceDetection
to work with values given in m/s^2 (in contrast to g as done in the publication / the usage with mGL-algorithms-py) (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/83) - Fixed install link in project README
- The format in which DataFrame Attributes are stored in json has been changed and the old format will be fully removed in the future. If you have DtwTemplates stored as json, load them (you will get a warning) once. Double check that the ordering of the template data is correct. If it is not, sort it correctly and then save the object again. This should fix all issues going forward.
- To get or load the data of a DtwTemplate, you now need to use
template.get_data()
instead oftemplate.data
. Simply replacing the old with the new option should fix all issues. - For custom algorithms using the gaitmap format, you should migrate to the new datatype validation functions! See "Added" section for more details.
A small bug fix release that fixes some issues with the new template creation function.
- The stride interpolation template creation function now works correctly if the index of the individual strides is different (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/68).
- Templates that use datafraes to store the template data can now be serialized (https://mad-srv.informatik.uni-erlangen.de/MadLab/GaitAnalysis/gaitmap/-/merge_requests/69)
This is the first official release of gaitmap (Wuhu!). Therefore, we do not have a proper changelog for this release.
- All the things :)