Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Extend date time information to include optional UTC syntax, warn about FIF requirements #546

Merged
merged 10 commits into from
Aug 8, 2020
26 changes: 21 additions & 5 deletions src/02-common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ pairs. JSON files MUST be in UTF-8 encoding. Extensive documentation of the
format can be found here: [http://json.org/](http://json.org/). Several editors
have built-in support for JSON syntax highlighting that aids manual creation of
such files. An online editor for JSON with built-in validation is available at:
[http://jsoneditoronline.org](http://jsoneditoronline.org).
[http://jsoneditoronline.org](http://jsoneditoronline.org).
It is RECOMMENDED that keys in a JSON file are written in [CamelCase](https://en.wikipedia.org/wiki/Camel_case)
with the first letter in upper case (e.g., `SamplingFrequency`, not
`samplingFrequency`). Note however, when a JSON file is used as an accompanying
Expand Down Expand Up @@ -542,14 +542,25 @@ Describing dates and timestamps:
- Date time information MUST be expressed in the following format
`YYYY-MM-DDThh:mm:ss[.000000]` (year, month, day, hour (24h), minute,
second, and optionally fractional second).
This is equivalent to the RFC3339 "date-time" format, time zone is always
assumed as local time).
This is almost equivalent to the [RFC3339](https://tools.ietf.org/html/rfc3339)
"date-time" format, with the exception that in BIDS, time zone is always
assumed as local time.
The RFC3339 `Z` syntax to indicate UTC or the RFC3339 "offset" syntax are not
supported.
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved
No specific precision is required for fractional seconds, but the precision
SHOULD be consistent across the dataset.
For example `2009-06-15T13:45:30`
For example `2009-06-15T13:45:30`.

- Time stamp information MUST be expressed in the following format:
`13:45:30[.000000]`
`hh:mm:ss[.000000]`
For example `13:45:30`.

- Note that depending on local REB/IRB ethics board policy, Date time information
does not need to be fully detailed.
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved
For example, it is permissible to set the time to `00:00:00` if reporting the
exact recording time is undesirable.
However, for privacy protection reasons, it it generally RECOMMENDED to shift
dates, as described below.
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved

- Dates can be shifted by a random number of days for privacy protection
reasons.
Expand All @@ -559,6 +570,11 @@ Describing dates and timestamps:
within each subject to maintain the interval information.
For example: `1867-06-15T13:45:30`

- WARNING: The Neuromag/Elekta/MEGIN file format for MEG (`.fif`) does *not*
support recording dates earlier than `1902` roughly.
See [MEG-file-formats](./99-appendices/06-meg-file-formats.md#recording-dates-in-fif-files)
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved
for more information.

- Age SHOULD be given as the number of years since birth at the time of
scanning (or first scan in case of multi session datasets). Using higher
accuracy (weeks) should in general be avoided due to privacy protection,
Expand Down
8 changes: 2 additions & 6 deletions src/04-modality-specific-files/02-magnetoencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,8 @@ Example:
```

Note that the date and time information SHOULD be stored in the Study key file
(`scans.tsv`), see [Scans file](../03-modality-agnostic-files.md#scans-file). As
it is indicated there, date time information MUST be expressed in the following
format `YYYY-MM-DDThh:mm:ss`
([ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format). For
example: 2009-06-15T13:45:30. It does not need to be fully detailed, depending
on local REB/IRB ethics board policy.
(`scans.tsv`), see [Scans file](../03-modality-agnostic-files.md#scans-file).
Date time information MUST be expressed as indicated in [Units](../02-common-principles.md#units)

## Channels description (`*_channels.tsv`)

Expand Down
8 changes: 2 additions & 6 deletions src/04-modality-specific-files/03-electroencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,8 @@ Example:
```

Note that the date and time information SHOULD be stored in the Study key file
([`scans.tsv`](../03-modality-agnostic-files.md#scans-file)). As it is
indicated there, date time information MUST be expressed in the following
format `YYYY-MM-DDThh:mm:ss`
([ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format). For
example: 2009-06-15T13:45:30. It does not need to be fully detailed, depending
on local REB/IRB ethics board policy.
([`scans.tsv`](../03-modality-agnostic-files.md#scans-file)).
Date time information MUST be expressed as indicated in [Units](../02-common-principles.md#units)

## Channels description (`*_channels.tsv`)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,8 @@ Example:
```

Note that the date and time information SHOULD be stored in the Study key file
([`scans.tsv`](../03-modality-agnostic-files.md#scans-file)). As it is indicated
there, date time information MUST be expressed in the following format
`YYYY-MM-DDThh:mm:ss`
([ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format). For
example: 2009-06-15T13:45:30. It does not need to be fully detailed, depending
on local REB/IRB ethics board policy.
([`scans.tsv`](../03-modality-agnostic-files.md#scans-file)).
Date time information MUST be expressed as indicated in [Units](../02-common-principles.md#units)

## Channels description (`*_channels.tsv`)

Expand Down Expand Up @@ -339,7 +335,7 @@ For example:
The order of the required columns in the `*_electrodes.tsv` file MUST be as
listed below.

MUST be present:
MUST be present:

| Column name | Definition |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
10 changes: 10 additions & 0 deletions src/99-appendices/06-meg-file-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ More information can be found under the following links:
- [Neuromag/Elekta/MEGIN data organization](http://www.fieldtriptoolbox.org/getting_started/neuromag)
- [BabyMEG](http://www.fieldtriptoolbox.org/getting_started/babysquid)

### recording dates in `.fif` files

It is important to note that recording dates in `.fif` files are represented
as `int32` format seconds since (or before) [*the Epoch*](https://en.wikipedia.org/wiki/Unix_time)
(`1970-01-01T00:00:00.000000` UTC).
Integers in `int32` format can encode values from -2,147,483,647 to +2,147,483,647.
Due to this representation, the Neuromag/Elekta/MEGIN file format for MEG (`.fif`) does *not*
support recording dates earlier than `1901-12-13T08:45:53.000000` UTC or later than
`2038-01-19T03:14:07.000000` UTC.

## BTi/4D neuroimaging

Each experimental run on a 4D neuroimaging/BTi system results in a folder
Expand Down