A Python toolkit for analysis of graphomotor data collected via Curious
Project description
Graphomotor Study Toolkit
A Python toolkit for analysis of graphomotor data collected via Curious.
Welcome to graphomotor, a specialized Python library for analyzing graphomotor data collected via Curious. This toolkit provides comprehensive tools for processing, analyzing, and visualizing data from various graphomotor assessment tasks including spiral drawing, trails making, alphabetic writing, digit symbol substitution, and the Rey-Osterrieth Complex Figure Test.
Development Progress
⚠️ This package is under active development. Currently, the focus is on the Spiral task. After finalizing feature extraction, the next steps will involve implementing both preprocessing and visualization for this task. Once these parts are in place, we plan to extend support to other tasks.
| Task | Preprocessing | Feature Extraction | Visualization |
|---|---|---|---|
| Spiral | |||
| Rey-Osterrieth Complex Figure | |||
| Alphabetic Writing | |||
| Digit Symbol Substitution | |||
| Trails Making |
Data Format Requirements
⚠️ This implementation requires data to adhere to a specific format matching the standard output from Curious drawing responses.
When exporting drawing data from Curious, you typically receive the following files:
- report.csv: Contains the participants' actual responses.
- activity_user_journey.csv: Logs the entire journey through the activity, including button actions like "Next", "Skip", "Back", and "Undo", regardless of whether a response was provided.
- drawing-responses-{date}.zip: A ZIP archive with raw drawing response CSV files for each participant (e.g.,
drawing-responses-Mon May 29 2023.zip). - media-responses-{date}.zip: A ZIP archive containing SVG files for the drawing responses (e.g.,
media-responses-Mon May 29 2023.zip). - trails-responses-{date}.zip: A ZIP archive with raw trail making response CSV files (if there are any) for each participant (e.g.,
trails-responses-Mon May 29 2023.zip).
For Spiral tasks, the toolkit uses only the CSV files from the drawing responses ZIP. Support for additional tasks will be added in future releases.
File Naming Convention
Your spiral data files must follow this naming convention:
[5123456]a7f3b2e9-d4c8-f1a6-e5b9-c2d7f8a3e6b4-spiral_trace1_Dom.csv
Where:
- Participant ID: Must be enclosed in brackets
[]and be a 7-digit number starting with5(e.g.,[5123456]) that matches thetarget_secret_idcolumn in the report.csv file. - Activity Submission ID: Must be a 32-character hexadecimal string (e.g.,
18f2-45ea-a1e4-2334e07cc706) that matches theidcolumn in the report.csv file. - Task: Must be one of the following that matches the
itemcolumn in the report.csv file:spiral_trace1_Domthroughspiral_trace5_Dom(dominant hand tracing tasks)spiral_trace1_NonDomthroughspiral_trace5_NonDom(non-dominant hand tracing tasks)spiral_recall1_Domthroughspiral_recall3_Dom(dominant hand recall tasks)spiral_recall1_NonDomthroughspiral_recall3_NonDom(non-dominant hand recall tasks)
Data Format
Your spiral data CSV file must contain the following columns:
line_number, x, y, UTC_Timestamp, seconds, epoch_time_in_seconds_start
This format represents the standard output from Curious drawing responses data dictionary.
Feature Extraction Capabilities
The toolkit extracts clinically relevant metrics from digitized drawing data. Currently implemented features include:
- Temporal Features: Task completion duration.
- Velocity Features: Velocity analysis including linear, radial, and angular velocity components with statistical measures (sum, median, variation, skewness, kurtosis).
- Distance Features: Spatial accuracy measurements using Hausdorff distance metrics with temporal normalizations and segment-specific analysis.
- Drawing Error Features: Area under the curve (AUC) calculations between drawn paths and ideal reference trajectories to quantify spatial accuracy.
Installation
Install the graphomotor package from PyPI:
pip install graphomotor
Or install the latest development version directly from GitHub:
pip install git+https://github.com/childmindresearch/graphomotor
Quick Start
Currently, graphomotor is available as an importable Python library. CLI functionality is planned for future releases.
Extracting Features from Spiral Drawing Data
from graphomotor.core import orchestrator
# Path to your spiral drawing data file
input_file = "path/to/your/spiral_data.csv"
# Directory where extracted features will be saved
output_dir = "path/to/output/directory"
# Run the analysis pipeline
features = orchestrator.run_pipeline(
input_path=input_file,
output_path=output_dir
)
# Features are returned as a dictionary and saved as CSV
print(f"Successfully extracted {len(features)} feature categories")
For detailed configuration options and additional parameters, refer to the run_pipeline documentation.
Note: Currently, only single file processing is supported, with batch processing planned for future releases.
Future Directions
The Graphomotor Study Toolkit is under active development. For more detailed information about upcoming features and development plans, please refer to our GitHub Issues page.
Contributing
We welcome contributions from the community! If you're interested in contributing, please review our Contributing Guidelines for information on how to get started, coding standards, and the pull request process.
References
- Messan, K. S., Kia, S. M., Narayan, V. A., Redmond, S. J., Kogan, A., Hussain, M. A., McKhann, G. M. II, & Vahdat, S. (2022). Assessment of Smartphone-Based Spiral Tracing in Multiple Sclerosis Reveals Intra-Individual Reproducibility as a Major Determinant of the Clinical Utility of the Digital Test. Frontiers in Medical Technology, 3, 714682. https://doi.org/10.3389/fmedt.2021.714682
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graphomotor-0.1.1.tar.gz.
File metadata
- Download URL: graphomotor-0.1.1.tar.gz
- Upload date:
- Size: 190.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e08ecd55b7c64a36d12ed5b8aa6cdadd6f4b421938bbff1c368810881e0526ef
|
|
| MD5 |
8d675b6f73e4b5d6b35e9a90d8520be7
|
|
| BLAKE2b-256 |
3aaaa2a202fbea793643d1db94536fcc6b2414b711d1478e3601f4f2be4d1417
|
Provenance
The following attestation bundles were made for graphomotor-0.1.1.tar.gz:
Publisher:
pypi.yaml on childmindresearch/graphomotor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graphomotor-0.1.1.tar.gz -
Subject digest:
e08ecd55b7c64a36d12ed5b8aa6cdadd6f4b421938bbff1c368810881e0526ef - Sigstore transparency entry: 265389479
- Sigstore integration time:
-
Permalink:
childmindresearch/graphomotor@9911b5a83e5f380a2a0f4fc363731ed928b05742 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/childmindresearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@9911b5a83e5f380a2a0f4fc363731ed928b05742 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file graphomotor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: graphomotor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bad25c8cab366eb00d9b2a1cdd02ef49a36091546a75287c0155e9e48a33eb01
|
|
| MD5 |
d7d58a0eee3b366d88463ddf0d98732f
|
|
| BLAKE2b-256 |
07ff8e3cafe77e9a3ad37e968d098ff85c4a89ee7da022ca630590bad09ce7bf
|
Provenance
The following attestation bundles were made for graphomotor-0.1.1-py3-none-any.whl:
Publisher:
pypi.yaml on childmindresearch/graphomotor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graphomotor-0.1.1-py3-none-any.whl -
Subject digest:
bad25c8cab366eb00d9b2a1cdd02ef49a36091546a75287c0155e9e48a33eb01 - Sigstore transparency entry: 265389482
- Sigstore integration time:
-
Permalink:
childmindresearch/graphomotor@9911b5a83e5f380a2a0f4fc363731ed928b05742 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/childmindresearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@9911b5a83e5f380a2a0f4fc363731ed928b05742 -
Trigger Event:
workflow_run
-
Statement type: