C3D.matrixround_ifintegersMethod
matrixround_ifintegers(x)

Return a matrix where each column has been rounded to integers if > 98% of the column are already integers.

Analog samples are supposed to be stored as integers (regardless of storage format); but this is not always the case. Due to floating-point inaccuracies, the processed (to be in real/physical units) data may not transform exactly back to an integer. This function assumes that these cases are rare (<2% of samples) when analog data is (correctly) stored as integers, but that otherwise, the signal must be pre-scaled and therefore non-integer.

C3D.readc3dMethod
readc3d(fn)

Read the C3D file at fn.

Keyword arguments

  • strip_prefixes::Bool = false: Remove subject prefixes from labels in the point dictionary
  • missingpoints::Bool = true: Sets invalid points to missing
  • handle_duplicate_parameters::Symbol = :keeplast: How to handle multiple parameters in a group with the same name. Options are:
    • :drop: The first parameter with the duplicated name is used and the rest are dropped.
    • :keeplast: The last parameter with the duplicated name is kept.
    • :append_position: All duplicate parameters are kept and their position in the C3D file is appended to their name.
  • paramsonly::Bool = false: Only reads the header and parameters
  • validateparams::Bool = true: Validates parameters against C3D requirements
C3D.roundapproxMethod

round approximately (integer) numbers, or leave as is (to force an error when attempting to convert)

C3D.split_filter!Method

requires a::Vector{Parameter} sorted by gid; returns views

C3D.writec3dMethod
writec3d(filename::String, f::C3DFile)
writec3d(io::IO, f::C3DFile)

Write a .c3d file to disk at filename.

This function will add or append the write date/time and C3D.jl version to the MANUFACTURER:EDITED parameter.

C3D.writetrcMethod
writetrc(filename, f; <keyword arguments>)

Write the C3DFile f to a .trc format at filename.

Keyword arguments

  • delim::Char='\t': The text delimiter to use
  • strip_prefixes::Bool=true: Strip marker label prefixes if they exist
  • subject::String="": The subject (among multiple subjects) in the C3DFile to write
  • prefixes::Vector{String}=[subject]: Marker label prefixes to strip if strip_prefixes == true
  • remove_unlabeled_markers::Bool=true: Remove markers with empty labels, labels matching r"(\*\d+|M\d\d\d)"
  • lab_orientation::Matrix=Matrix(I, (3,3)): Rotation to apply to markers before writing
  • precision::Int=6: Number of decimal places to print
  • virtual_markers::Dict{String,Matrix}: (Optional) Virtual markers (calculated with markers from f) to write to the .trc file