-
Notifications
You must be signed in to change notification settings - Fork 12
A R-package for 3D Gait data Processing #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aaa34169
wants to merge
4
commits into
cmasuki:master
Choose a base branch
from
aaa34169:dev-rCGM2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2ebc9a5
anonimised methods -[matlab and python]
aaa34169 aacfb5d
readme of anonymising-pyCGM2.py
aaa34169 da08456
add readme to steph changeSubject Name function
aaa34169 7c0a91a
code index update with link to rCGM2 : A R package for visualisation …
aaa34169 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| # Code Index | ||
| A list of the code contributed by our community members. This is either hosted here on the CMAS open-code repository, or externally. | ||
| A list of the code contributed by our community members. This is either hosted here on the CMAS open-code repository, or externally. | ||
| When you add a new entry, make sure you include a link to the code, the required software, and your name, so we know who to thank! :heart::clap: | ||
|
|
||
| - [Gait Profile Score & Movement Analysis Profile](https://github.com/cmasuki/open-code/tree/master/Code/Gait_profile_score) by [Neil Postans](https://github.com/npostans). | ||
| - [Gait Profile Score & Movement Analysis Profile](https://github.com/cmasuki/open-code/tree/master/Code/Gait_profile_score) by [Neil Postans](https://github.com/npostans). | ||
| Needs Python 2.7 (32 bit version) & Vicon Nexus 2.x | ||
| - [Local Dynamic Stability code (Rosensteins Algorithm)](https://github.com/SjoerdBruijn/LocalDynamicStability) by [Sjoerd Bruijn](https://github.com/SjoerdBruijn) Needs Matlab (any version) | ||
| - [Code to read accelerometry data from a mobile phone via Matlab in realtime](https://github.com/SjoerdBruijn/StreamPhoneData) by [Sjoerd Bruijn](https://github.com/SjoerdBruijn) Needs Matlab (any version) | ||
| - [visualisation and statistical processing of 3D gait data with R](https://github.com/pyCGM2/rCGM2) bu [Fabien Leboeuf](https://github.com/pyCGM2/rCGM2) Needs Rstudio | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| function ChangeSubjectName | ||
| % change the name of subject in C3D files associated with models, markers, | ||
| % events | ||
| % vsk file should have the same name of the new name of the subject. | ||
| DefaultName = '\\DEFAULT PATH'; % TO EDIT | ||
| [C3D_filename,C3D_path]=uigetfile({'*.C3D'},'Select C3D file',DefaultName,'MultiSelect','on'); | ||
| nbre_fichier = size(C3D_filename,2); | ||
|
|
||
| f=findstr(C3D_path,'\'); | ||
| def=C3D_path(f(end-2)+1:f(end-1)-1); | ||
| subject = inputdlg('Name of the new subject','Name of the new subject',1,{def}); | ||
| subject=char(subject); | ||
|
|
||
| for t=1:nbre_fichier | ||
| C3D_file=char(C3D_filename(t)); | ||
|
|
||
| if nbre_fichier ==1 | ||
| C3D_file = C3D_filename; | ||
| end | ||
| acq= btkReadAcquisition(char([C3D_path C3D_file])); | ||
| METADATA = btkGetMetaData(acq); | ||
| I1=struct(); | ||
| I3=struct(); | ||
| info1=struct(); | ||
| info3=struct(); | ||
| B={}; | ||
| % change subject name in the metadata | ||
| if isfield(METADATA.children,'SUBJECTS')==1 | ||
| info1=METADATA.children.SUBJECTS.children.NAMES.info; | ||
| I1 = btkMetaDataInfo('Char', {subject}); | ||
| btkAppendMetaData(acq,'SUBJECTS','NAMES',I1); | ||
| info2=METADATA.children.POINT.children.ANGLES.info; | ||
| I2 = btkMetaDataInfo('Char', {subject}); | ||
| btkAppendMetaData(acq,'POINT','ANGLES',I2); | ||
| end | ||
|
|
||
| % change subject name in the events | ||
| n_event=btkGetEventNumber(acq); | ||
| if isempty(n_event)==0 | ||
| if n_event>0 | ||
| for i=1:n_event | ||
| btkSetEventSubject(acq, i, subject); | ||
| end | ||
| end | ||
| end | ||
|
|
||
| % change subject name in analysis | ||
| if isfield(METADATA.children,'ANALYSIS')==1 | ||
| info3=METADATA.children.ANALYSIS.children.SUBJECTS.info; | ||
| if info3.dims(2)>0 | ||
| for i=1:info3.dims(2) | ||
| B{i}=subject; | ||
| end | ||
| I3 = btkMetaDataInfo('Char', B'); | ||
| btkAppendMetaData(acq,'ANALYSIS','SUBJECTS',I3); | ||
| end | ||
| end | ||
|
|
||
| btkWriteAcquisition(acq,(char([C3D_path C3D_file]))); | ||
| disp(['Write - ' char([C3D_path C3D_file])]); | ||
| end | ||
| disp('Change Name finished') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| **DESCRIPTION** | ||
| change subject name of a several c3d files | ||
|
|
||
| **SYNOPSIS** | ||
|
|
||
|
|
||
|
|
||
| **AUTHOR** | ||
|
|
||
| Stephane Armand : HUG - Geneva (SW) | ||
|
|
||
|
|
||
|
|
||
| **REQUIREMENT** | ||
|
|
||
| * BTK ( matlab) 0 | ||
|
|
||
|
|
||
|
|
||
| **CHANGELOG** | ||
|
|
||
| * *[2018-05-07]* proposal to CMASUKI | ||
|
|
||
|
|
||
| **TODO** | ||
|
|
||
|
|
||
|
|
||
| **HOW TO** | ||
|
|
||
| 1. Run the m file | ||
| 2. Select your c3d set i the dialog box |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| import os | ||
| from pyCGM2.Tools import btkTools | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
|
|
||
| c3dFilename = "TO EDIT" | ||
| DATA_PATH = os.getcwd() + "//" | ||
|
|
||
| btkAcq = btkTools.smartReader(DATA_PATH+c3dFilename) | ||
| btkAcqUn = btkTools.changeSubjectName(btkAcq,subjectName) | ||
| btkTools.smartWriter(btkAcqUn, DATA_PATH+c3dFilename[:-4]+"-Anonymised.c3d") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| **DESCRIPTION** | ||
| change name of the subject into the c3d | ||
|
|
||
| (@CarolineORLAUKeele : ready to sell your scripted USB stick on ebay :-) ) | ||
|
|
||
| **SYNOPSIS** | ||
|
|
||
| When you export a c3d, from Vicon Nexus for instance, the name of the subject is defined in different sections of the c3d. | ||
| This function allows to change the subject name everywhere and export a new c3d with *-anonymised" as suffix | ||
|
|
||
|
|
||
|
|
||
| **AUTHOR** | ||
|
|
||
| Fabien Leboeuf : University Salford (UK) | ||
|
|
||
|
|
||
|
|
||
| **REQUIREMENT** | ||
|
|
||
| * this function need installation of [pyCGM2](https://pycgm2.github.io) | ||
| * compatible python2.7 only | ||
|
|
||
|
|
||
| **CHANGELOG** | ||
|
|
||
| * *[2018-05-07]* proposal to CMASUKI | ||
|
|
||
|
|
||
| **TODO** | ||
|
|
||
|
|
||
|
|
||
| **HOW TO** | ||
|
|
||
| 1. place the script "anonymising-pyCGM2.py" into your data folder | ||
| 2. open it with either your python editor pycharmm, spyder or a text editor like notepad | ||
| 3. edit you c3d filename (replace TOEDIT) | ||
| 4 run the python script ( double click on "anonymising-pyCGM2.py") if *python.exe* is associated with *.py file or use the run command of your python IDE) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your name should link to your github profile. (The name of the package should link to the package itself)