Outputs#
dirconn-bids BIDS_DIR OUTPUT_DIR participant writes a BIDS derivatives dataset to
OUTPUT_DIR/dirconn (layout version 1, 0003 — Derivatives layout of the participant pipeline) and keeps its
intermediate files in the work directory (--work-dir, default OUTPUT_DIR/work).
The tree#
OUTPUT_DIR/
dirconn/
dataset_description.json
dirconn.toml configuration of the first run
sub-01.html report of subject 01
logs/
CITATION.html, .md, .tex, .bib methods text of the dataset
run-20261117T094834-12184/ one directory per run
dirconn.log
progress.jsonl
crash-<task key>.txt one per failed task
crash-report-<subject>.txt one per report that failed
provenance.json
environment-lock.txt
dirconn.toml effective configuration of this run
sub-01/
figures/
sub-01_desc-summary_overview.json subject-level reportlets
sub-01_desc-summary_errors.json
eeg/
sub-01_task-rest_run-1_desc-gc_conn.nc
sub-01_task-rest_run-1_desc-gc_conn.json
sub-01_task-rest_run-1_desc-gc_edges.tsv
sub-01_task-rest_run-1_desc-trgc_conn.nc controls.time_reversal = true
sub-01_task-rest_run-1_desc-trgc_conn.json
sub-01_task-rest_run-1_desc-trgc_edges.tsv
figures/
sub-01_task-rest_run-1_diagnostics.json
sub-01_task-rest_run-1_desc-gc_matrix-alpha.json reportlets of the report
sub-01_task-rest_run-1_desc-gc_matrix-alpha.svg (a figure, when it has one)
sub-02/
ses-01/ only when the input has a session
eeg/
...
work/
prepared-<hash>.npz prepared-series cache
prepared-<hash>.json
File names carry the entities of the input recording in the order sub ses task run, then
desc-<method> (the name in estimation.methods, or trgc for the time-reversal control),
then the suffix. The data type directory is that of the input.
Dataset files#
dataset_description.json and dirconn.toml are written by the first run, when they do not exist
yet, and are never rewritten. The description has Name "dirconn derivatives",
BIDSVersion "1.9.0", DatasetType "derivative", one GeneratedBy entry (Name
"dirconn", Version, CodeURL and, inside the Docker image, Container with Type,
Tag and Revision) and "Dirconn": {"DerivativesVersion": "1"}, which marks the dataset as a
connectivity output, so it is never taken for an input. dirconn.toml is the configuration that
later runs are checked against (see Command line); it can be passed back with --config.
One result#
Each method gives three files per recording.
_conn.ncThe full result, a
Connectivityin NetCDF4 with the axessource,target,freqandtimeand its whole provenance (method, parameters, assumption checks, data history). It is the source of truth; read it withdirconn.Connectivity.from_netcdf().values[i, j]is the influence of nodeion nodej. Excluded frequencies (estimation.exclude_freqs) are NaN._conn.jsonThe sidecar, readable without dirconn:
Field
Meaning
MeasureMethod name recorded in the provenance.
DirectedWhether
values[i, j]andvalues[j, i]differ in general.EstimatorThe
descentity.ParametersThe estimator’s parameters, as recorded in the provenance.
NodeLabelsNode names, in the order of both axes.
NodeKindsKind of each node, in the order of
NodeLabels:corticalordirectfor region-level inputs,sensorfor sensor-level ones.BandsBand name to
[low, high]in Hz; empty for a method without frequency resolution.SamplingFrequencySampling rate in Hz of the prepared series the result was estimated on (after
prepare.resample_hz).DescriptionThe orientation of the matrix, in words.
SourcesInput files, relative to
BIDS_DIR(absolute when outside it).StatisticsOne entry per test:
Band("broadband"for a method without bands),Test("surrogate","analytic"or"builtin"),Generator(name, the null hypothesisnullandparams, for example the block size),NSurrogates,SeedandObservedHistory, the data history of the observed value (with the block counts for block shuffling). The analytic test gives a single"broadband"entry withGenerator{"name": "analytic"}andNSurrogatesandSeednull. The built-in test ofpcmciandtegives a single"broadband"entry withGenerator{"name": "builtin", "source": ...}. Empty whenstatistics.test = "none"or when the result was not tested (StatisticsNote). No arrays are stored here.StatisticsNotePresent when a test was configured but the result was not tested, with the reason: a time-resolved result on a continuous record, where block shuffling has no time points of the result.
ValueIsMagnitudePresent for complex-valued measures: the edge table holds magnitudes.
TaskKeyKey of the task that wrote the result; a later run skips the task when it matches.
DirconnVersion,DerivativesVersionVersion of dirconn that wrote the file, and of the layout (
"1")._edges.tsvWritten when
output.long_tableis on: one row per ordered pair of distinct nodes and band, tab-separated, with the columnssourceNode the influence comes from.
targetNode it goes to.
bandBand name;
broadbandfor a method without frequency resolution.valueThe band value (magnitude for complex measures).
pRaw p-value of the band’s test.
p_adjCorrected p-value (
statistics.correction).significantTruewhenp_adj < statistics.alpha, elseFalse.The test columns are
n/awithout a test (statistics.test = "none", and always fordesc-trgc).dirconn.io.derivatives.read_edges()reads the table withn/aas NaN. A time-resolved result (adtf,tpdc,wdtf) has one row per pair, band and time point, with atimecolumn (seconds) afterband; its correction runs over pairs and time points together. On a continuous record with block shuffling (the default) it is not tested and its test columns aren/a(StatisticsNotein the sidecar): block shuffling fits the observed value on 5 s blocks, whose time points are not those of the result. Should a test with another shape reach the writer, its columns stayn/atoo;PValueShapein the sidecar’sStatisticsshows the shape the test had. A frequency-resolved result without bands gives a table with the header only; the NetCDF file has the values.The three files are written in the order
_conn.nc,_edges.tsv,_conn.json. The sidecar is written last and atomically: itsTaskKeymarks the result as complete, so a task that stopped before it is run again.
The controls of a recording#
The controls task of every recording writes
figures/<recording>_diagnostics.json:valid_fraction(share of valid samples after preparation),n_trials,n_times,sfreq,channel_std(standard deviation of each channel over its valid samples,nullfor a channel without any),spectral(the spectral dynamic range per channel and band,nullwhencontrols.spectral_range_checkis off),checks(the assumption checks drawn from it, withname,status,detailandvalue) andtask_key;with
controls.time_reversal, thedesc-trgcresult (time-reversed Granger causality, no tests), written after the diagnostics.
The report and the methods text#
sub-XX.htmlThe report of subject
XX(The participant report), written after every participant run and by--reports-only. One self-contained file; it is built from the other files of the dataset and can be deleted and rebuilt.<recording>_desc-<desc>_<name>.jsonand.svgOne reportlet, a figure or a table of the report, in the recording’s
figuresdirectory (descis a method name orprep,diagortrgc). The subject-level reportlets (desc-summary:overviewanderrors) are insub-XX/figureswith the labelsub-XX. The JSON hasname,section,desc,title,caption,status(pass,warn,failorinfo),table(rows, ornull) anddata; the SVG is the figure. They are replaced whenever the report is built.logs/CITATION.html,.md,.tex,.bibThe methods paragraphs for a manuscript and their references, in four formats: what the pipeline did (the configuration, the selected model orders, the parameters dirconn filled in, the tests and controls). They cover every subject of the dataset and are replaced by every run and by
--reports-onlyand--boilerplate-only.crash-report-<subject>.txt,crash-report-citation.txtThe traceback of a report or of the methods text that could not be written, in the run directory (
logs/run-<time>-<pid>/), or inlogs/reports-<time>-<pid>/for--reports-onlyand--boilerplate-only. They exist only when something failed.
The run directory#
Every run creates logs/run-<start time>-<pid>/, the start time in UTC as YYYYmmddTHHMMSS,
with -2, -3, … appended when a run of the same process started in the same second. Runs
never share files, so jobs writing to the same output directory do not overwrite each other’s logs.
dirconn.logThe log of the run at debug level (stderr shows what
-vasks for). Messages emitted inside worker processes (--nprocsabove 1) do not reach this file; the task outcomes are logged by the main process.progress.jsonlOne JSON object per task, appended when the task ends:
key,label(<recording>:<method>or<recording>:controls),status(done,skippedorfailed),seconds,crash(the crash file name, ornull) andfinished(UTC time).crash-<key>.txtFor each failed task: its label, its payload and the traceback.
provenance.jsonWritten when the run ends, with the keys
Key
Content
commandThe command line, as a list.
started,finishedStart and end in ISO 8601, UTC.
hostname,platform,pythonThe machine, the operating system and the Python version.
versionsVersions of Python, dirconn and the installed scientific packages it records.
imagetagandrevisionof the Docker image (fromDIRCONN_IMAGE_TAGandDIRCONN_BUILD_REVISION); outside it{"tag": null, "revision": null}.gitCommit of the dirconn source tree for a source install, otherwise
null.inputsOne entry per recording:
label,files(absolute paths with/: the data file and its data companions such as.eegand.vmrk, then the.jsonsidecar,channels.tsvandevents.tsvwhen present) andsha256, one digest over all of them in that order (each file’s name and length, then its bytes).config_hash,analysis_hashHashes of the configuration (see Pipeline configuration).
resourcesnprocs,omp_nthreads,mem_mbandwork_dir.tasksCounts
done,skippedandfailed.environment-lock.txtThe installed Python distributions as sorted
name==versionlines; inside the Docker image a copy of the image’s/opt/environment-lock.txt.dirconn.tomlThe effective configuration of this run (
--configwith the--setoverrides applied), which may differ from the dataset’s in itsoutputandexecutionsections.
The work directory#
prepared-<hash>.npz and its .json sidecar hold a prepared record (data, masks, channels,
history), shared by the tasks of the recording within and across runs. The hash covers the input
files, the prepare section, input.node_kinds, the dirconn version and the events file, and an
unreadable entry is recomputed. Nothing in the dataset refers to the work directory; it can be
deleted.