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

[FIX] Clarify continuous recording metadata fields #167

Merged
merged 5 commits into from
May 7, 2019

Conversation

effigies
Copy link
Collaborator

@effigies effigies commented Mar 6, 2019

This change brings the formatting of metadata associated with continuous recording files (_physio.tsv, _stim.tsv) in line with that of other metadata, namely in a tabular format with requirement level and units, hopefully making it easier to find with a quick glance.

Also, these files may no longer have start times purely in relation to volumetric time series like BOLD. Do we need to update the language so these can be used in relation to EEG/MEG/iEEG? Or do those modalities use different formats for physio data?

chrisgorgo
chrisgorgo previously approved these changes Mar 6, 2019
@emdupre
Copy link
Collaborator

emdupre commented Mar 7, 2019

This LGTM, but I'm not sure on your question about non-MRI modalities... Pinging @jasmainak, @choldgraf, @dorahermes for opinions !

@jasmainak
Copy link
Collaborator

I'm seeing this part of the spec for the first time :) I think @sappelhoff may have better opinions

In MEG, audio stimuli and such are often stored as MISC channel in the same file. So it figures in the _channels.tsv with the channel type and sampling frequency set appropriately.

| Field name | Definition |
| :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SamplingFrequency | REQUIRED. Sampling frequency in Hz of all columns in the file. |
| StartTime | REQUIRED. Start time in seconds in relation to the start of acquisition of the first volume in the corresponding imaging file (negative values are allowed). |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like it only applies to MRI data

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree- what about "Start time in seconds in relation to the first data sample in the corresponding neural dataset (negative values are allowed)"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming "start of acquisition of the first volume" is an attempt to precisely define the onset of the first data sample. What about: "Start time in seconds in relation to the start of acquisition of the first data sample in the corresponding neural dataset (negative values are allowed)."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I'm noticing that this appears in func/. Is that going to cause problems with MEG/EEG/iEEG? Or would this be similar to a simultaneous fMRI/EEG?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by

I'm noticing that this appears in func/

?

+1 on changing to: "Start time in seconds in relation to the start of acquisition of the first data sample in the corresponding neural dataset (negative values are allowed)." as @effigies suggests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sappelhoff I mean that on line 7, we specify that these files occur in the func/ subdirectory. Should this be expanded to include other directory names?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, yes it could be made more general, for example with a <modality> placeholder? The text below would have to be adjusted so that the <matches> placeholder does not only refer to MRI data 👍

| SamplingFrequency | REQUIRED. Sampling frequency in Hz of all columns in the file. |
| StartTime | REQUIRED. Start time in seconds in relation to the start of acquisition of the first volume in the corresponding imaging file (negative values are allowed). |
| Columns | REQUIRED. Names of columns in file. |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is probably good to add units as optional

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was moving to add this, but we should probably consider how to make this as conformant as possible with https://bids-specification.readthedocs.io/en/stable/02-common-principles.html#tabular-files.

For example, we could then allow the same metadata for each column (LongName, Description, Levels, Units, TermURL). So something like:

{
  "SamplingFrequency": 10,
  "StartTime": 0.0,
  "Columns": ["cardiac"],
  "cardiac": {
    "LongName": "continuous pulse measurement",
    "Units": "mV",
    "TermURL": "..."
  }
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, looks like a good reuse of existing structure

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreeing to two already proposed but not yet implemented changes and having one open question (see review comments)

| Field name | Definition |
| :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SamplingFrequency | REQUIRED. Sampling frequency in Hz of all columns in the file. |
| StartTime | REQUIRED. Start time in seconds in relation to the start of acquisition of the first volume in the corresponding imaging file (negative values are allowed). |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by

I'm noticing that this appears in func/

?

+1 on changing to: "Start time in seconds in relation to the start of acquisition of the first data sample in the corresponding neural dataset (negative values are allowed)." as @effigies suggests

| SamplingFrequency | REQUIRED. Sampling frequency in Hz of all columns in the file. |
| StartTime | REQUIRED. Start time in seconds in relation to the start of acquisition of the first volume in the corresponding imaging file (negative values are allowed). |
| Columns | REQUIRED. Names of columns in file. |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

@effigies
Copy link
Collaborator Author

I think GitHub got confused and decided that there were merge conflicts where there weren't. I merged master and now the conversations are detached from the source.

@sappelhoff Sorry for the back-and-forth, but I want to push off the EEG/MEG/iEEG fixes for another PR, as I think it applies to Task events and Physiological and other continuous recordings, and deserves close attention from the EEG/MEG/iEEG crowd. They are more likely to notice duplications from their sections that can be cleaned up, or contradictions that need to be resolved. I think it would be pushing too much on this PR which is mostly just a language clarification.

I'm happy to include discussion of units and related metadata, but it is changing the structure of the file, so I'm going to rope in @tyarkoni as the PyBIDS implementor-in-chief to see if there are issues we hadn't considered.

I believe what I've proposed in #167 (comment) is consistent with the derivative Time series metadata. It would be nice to get a second opinion on that.

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and fine to have the EEG/MEN/iEEG changes in another PR.

…inuous-recordings.md

Co-Authored-By: effigies <effigies@gmail.com>
Copy link
Collaborator

@emdupre emdupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM ! Thanks, @effigies !

@sappelhoff sappelhoff merged commit e32a4a9 into bids-standard:master May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants