C3D.findduplicates
— Methodloosely based on countmap (addcounts_dict!) from StatsBase
C3D.matrixround_ifintegers
— Methodmatrixround_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.readc3d
— Methodreadc3d(fn)
Read the C3D file at fn
.
Keyword arguments
strip_prefixes::Bool = false
: Remove subject prefixes from labels in thepoint
dictionarymissingpoints::Bool = true
: Sets invalid points tomissing
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 parametersvalidateparams::Bool = true
: Validates parameters against C3D requirements
C3D.roundapprox
— Methodround approximately (integer) numbers, or leave as is (to force an error when attempting to convert)
C3D.split_filter!
— Methodrequires a::Vector{Parameter} sorted by gid; returns views
C3D.writec3d
— Methodwritec3d(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.writetrc
— Methodwritetrc(filename, f; <keyword arguments>)
Write the C3DFile f
to a .trc format at filename
.
Keyword arguments
delim::Char='\t'
: The text delimiter to usestrip_prefixes::Bool=true
: Strip marker label prefixes if they existsubject::String=""
: The subject (among multiple subjects) in the C3DFile to writeprefixes::Vector{String}=[subject]
: Marker label prefixes to strip ifstrip_prefixes == true
remove_unlabeled_markers::Bool=true
: Remove markers with empty labels, labels matchingr"(\*\d+|M\d\d\d)"
lab_orientation::Matrix=Matrix(I, (3,3))
: Rotation to apply to markers before writingprecision::Int=6
: Number of decimal places to printvirtual_markers::Dict{String,Matrix}
: (Optional) Virtual markers (calculated with markers fromf
) to write to the .trc file