pyCGM2.Tools#

btkTools functions#

GetAnalogNames(acq)

Retrieves analog signal names from a BTK acquisition.

GetMarkerNames(acq)

Retrieves marker names from a BTK acquisition.

_getSectionFromMd(md)

Retrieves a list of child sections from metadata.

applyOnValidFrames(acq, validFrames)

Sets all points to zero if the frame is not valid.

applyRotation(acq, markers, ...)

Applies a rotation to the specified markers in the acquisition based on the global frame orientation.

applyTranslators(acq, translators)

Renames markers based on the provided translators.

applyValidFramesOnOutput(acq, validFrames)

Sets model outputs to zero if not a valid frame.

automaticKineticDetection(dataPath, filenames)

Automatically detects and processes acquisitions with kinetic data.

btkAnalogToKtkTimeseries(acq)

Converts all BTK analog data from a BTK acquisition to a Kinetics Toolkit timeseries.

btkPointToKtkTimeseries(acq[, type])

Converts BTK points of a specified type from a BTK acquisition to a Kinetics Toolkit timeseries.

buildTrials(dataPath, filenames)

Constructs BTK acquisitions from a list of filenames located in a specified directory.

calculateAngleFrom3points(acq, pt1, pt2, pt3)

Calculates the angle formed by three points at each frame in a BTK acquisition.

changeSubjectName(acq, subjectName)

Changes the subject name in the acquisition's metadata.

checkForcePlateExist(acq)

Checks if force plates exist in the acquisition.

checkGap(acq, markerList[, frameBounds])

Checks for gaps in marker data within the specified frame bounds.

checkMarkers(acq, markerList)

Checks the presence of specified markers in the acquisition.

checkMetadata(acq, firstLevel, secondLevel)

Checks the existence of specified metadata.

checkMultipleSubject(acq)

Checks if multiple subjects are detected in the acquisition.

cleanAcq(acq)

Cleans a BTK acquisition by removing points with zero values across all frames.

clearEvents(acq, labels)

Removes events based on their labels.

clearPoints(acq, pointlabelList)

Removes specified points from the acquisition.

constructMarker(acq, label, markers[, ...])

Constructs a new marker from existing markers using a specified numpy method.

constructPhantom(acq, label[, desc])

Constructs a phantom marker (marker with zero values).

createPhantoms(acq, markerLabels)

Constructs phantom markers for a list of specified labels.

deleteContextEvents(acq, context)

Removes events with a specified context (e.g., Left, Right, General).

findMarkerGap(acq)

Identifies markers with detected gaps in an acquisition.

findValidFrames(acq, markerLabels)

Finds valid frames to process based on marker data.

getAllParamAnalysis(acq)

Retrieves all analysis parameters from the BTK acquisition.

getForcePlateWrench(acq[, fpIndex])

Retrieves the ground reaction wrenches for force plates in the acquisition.

getFrameBoundaries(acq, markerLabels)

Gets frame boundaries from a list of markers.

getLabelsFromScalar(acq[, description])

Retrieves labels of scalar points from a BTK acquisition based on their description.

getNumberOfForcePlate(acq)

Returns the number of force plates in the acquisition.

getNumberOfModelOutputs(acq)

Returns the count of different types of model outputs in the acquisition.

getParamAnalysis(btkAcq, name, context, subject)

Retrieves a specific analysis parameter from the BTK acquisition.

getScalar(acq, label)

Retrieves a scalar point from a BTK acquisition by its label.

getStartEndEvents(acq, context[, ...])

Retrieves the frame numbers of start and end events based on their context and labels.

getValidFrames(acq, markerLabels[, frameBounds])

Gets valid frames of markers within the specified frame boundaries.

getVisibleMarkersAtFrame(acq, markers, index)

Returns markers that are visible at a specific frame.

hasChild(md, mdLabel)

Checks if the specified metadata child exists.

isAnalogExist(acq, label)

Checks if an analog label exists in the acquisition.

isEventExist(acq, label, context)

Checks if an event with the specified label and context exists in the acquisition.

isGap(acq, markerLabel)

Checks if there is a gap (missing data) in the specified marker.

isKineticFlag(acq)

Checks if kinetic data (force plate events) are present in the acquisition.

isPhantom(acq, label)

Checks if a point is a phantom (i.e., zero point).

isPointExist(acq, label[, ignorePhantom])

Checks if a point (marker or model output) exists in the acquisition.

isPointsExist(acq, labels[, ignorePhantom])

Checks if a list of points exist in the acquisition.

keepAndDeleteOtherPoints(acq, pointToKeep)

Removes all points from the acquisition except the specified ones.

markerUnitConverter(acq, unitOffset)

Applies an offset to convert marker units.

markersToArray(acq[, markers])

Converts marker position data from a BTK acquisition to a numpy array.

modifyEventSubject(acq, newSubjectlabel)

Updates the subject name for all events in the acquisition.

modifySubject(acq, newSubjectlabel)

Updates the subject name in the acquisition's metadata.

renameEvent(acq, label, context, newlabel, ...)

Renames an existing event in a BTK acquisition.

smartAppendAnalog(acq, label, values[, desc])

Appends or updates an analog output in the acquisition.

smartAppendParamAnalysis(acq, name, ...[, ...])

Appends a new analysis parameter to the BTK acquisition.

smartAppendPoint(acq, label, values[, ...])

Appends or updates a point in the acquisition.

smartCreateEvent(acq, label, context, frame)

Creates a new event in the BTK acquisition.

smartGetEvents(acq, label, context)

Retrieves events from the acquisition based on label and context.

smartGetMetadata(acq, firstLevel, secondLevel)

Retrieves metadata information based on specified levels.

smartReader(filename[, translators])

Read a C3D file using BTK, with optional marker translation.

smartSetMetadata(acq, firstLevel, ...)

Sets a value in the acquisition's metadata.

smartWriter(acq, filename[, extension])

Write a BTK acquisition instance to a C3D or other specified format.

sortedEvents(acq)

Sorts the events in the acquisition based on their time of occurrence.

opensim tools functions#

export_CgmToMot(acq, datapath, filename, ...)

Exports CGM kinematics outputs to a .mot file in OpenSim format.

footReactionMotFile(acq, filename, ...[, mfpa])

Creates a .mot file for foot reaction forces from a BTK acquisition.

mot2pointValues(motFilename, labels[, ...])

Extracts point values from an OpenSim MOT file.

smartGetValues(DATA_PATH, filename, label)

Extracts values from an OpenSim Storage file based on a specific label.

sto2pointValues(storageObject, label, R_LAB_OSIM)

Extracts point values from an OpenSim Storage object and transforms them to the lab referential.

transformMarker_ToOsimReferencial(acq, axis, ...)

Transforms marker coordinates in a BTK acquisition from the lab referential to the OpenSim referential.