Demonstrates how duct and datalad compose to provide structured, reproducible execution of neuroimaging workflows.
python -m venv venv
source venv/bin/activatepip install -r requirements.txtFollow the installation instructions at: https://github.com/datalad/screencaster
Before running a new recording, clean up any previous demo runs:
# Clean up demo environment
cd ~/tmp
chmod -R +w myproject ds000007-mriqc-hoffstaedter 2>/dev/null || true
rm -rf myproject ds000007-mriqc-hoffstaedter
# Clean up screencaster temp directory
rm -rf /tmp/demo
# Clean up previous recording files
cd /home/austin/devel/demos/sfn-2025
rm -f outputs/duct-datalad-demo.cast.{cmds,json,gif}Create the asciinema recording:
SCREENCAST_HOME=/tmp/demo cast2asciinema duct-datalad-demo.cast outputsThis will generate outputs/duct-datalad-demo.cast.json and outputs/duct-datalad-demo.cast.cmds.
Before generating the GIF, commit the recording files so datalad run can track provenance:
git add outputs/duct-datalad-demo.cast.{cmds,cmds.md,json}
git commit -m "Add asciinema recording for duct-datalad demo"View the asciinema recording:
asciinema play outputs/duct-datalad-demo.cast.jsonOr upload to asciinema.org for web viewing.
Convert the recording to an animated GIF:
datalad run -m "Generate GIF from asciinema recording" \
--input outputs/duct-datalad-demo.cast.json \
--output outputs/duct-datalad-demo.gif \
"podman run --rm -v \"\$PWD:/data:Z\" docker.io/kayvan/agg /data/outputs/duct-datalad-demo.cast.json /data/outputs/duct-datalad-demo.gif"Note: Using podman instead of docker avoids creating files owned by root.
This creates outputs/duct-datalad-demo.gif with full provenance tracking. The demo also generates a resource usage plot at outputs/mriqc-resources.png.
For better quality and smaller file size, convert the GIF to MP4 using H.264:
ffmpeg -y -i outputs/duct-datalad-demo.gif -c:v libx264 -crf 18 -vf "scale=690:470" -pix_fmt yuv420p -movflags faststart outputs/duct-datalad-demo.mp4This creates a high-quality MP4 (CRF 18) with readable text, typically ~40% smaller than the GIF.
