phys2bids icon indicating copy to clipboard operation
phys2bids copied to clipboard

Handling of noncontiguous segments in BioPac recordings

Open tsalo opened this issue 3 years ago • 2 comments

Detailed Description

For multi-run workflows (including the one proposed in #219), the existence of noncontiguous segments (i.e., stopping and starting recording without saving to separate files) can present a problem for identifying runs, as there will be missing time in the overall time series that, at least currently, isn't reflected in the BlueprintInput object at all.

Context / Motivation

I originally planned to address this in #219, but couldn't figure out an easy solution. BioPac segment time stamps only have second-level resolution, so stitching them together with empty values during the missing time would introduce 1-2 seconds of potential error. Additionally, the time stamps require a bit of customization in order to do, and still must be triggered manually when a new segment is started.

Possible Implementation

I'm not sure. I see three reasonable options:

  1. Perhaps we could automatically split BioPac physio data, as it's read in, based on segments? That way, users would get multiple BlueprintInput objects based on the separate segments.
    • Any segments with no trigger periods would be dropped, of course.
  2. We could stitch together the segments (assuming they have time stamps) and just accept the 1-2s error.
    • There would still need to be a warning.
  3. Raise a warning. At minimum, users should be aware that there are possible gaps in the time series when there are multiple segments.
    • If the segments start and stop before or after any of the trigger runs, this is less of a problem. It should probably just be considered when figuring out the amount of time before or after the run to retain in the new file(s).
    • Also, the segments could be reflected in the x-axis (time) of any plots with an axis break symbol (--//--).

tsalo avatar Jul 26 '20 15:07 tsalo

@tsalo do you have a file like the one you're describing to see? I thought that when stopping and restarting recordings, AcqKnowledge just stitched together the timeseries as if it was a continuous recording. @sangfrois implementation of multi-runs splits should treat this kind of files without any issue, I don't know if yours would encounter more problems. If that's the case, we can write in the help and in the documentation that it's not possible to use pre-existing BIDS libraries information with such files.

In any case, let's see a file and decide the course of action (maybe it's easier than expected).

smoia avatar Jul 31 '20 09:07 smoia

I have a couple, but they all have identifiable timestamps. I can try to see if I can overwrite the timestamps to make the files shareable.

AcqKnowledge does just stitch the time series together, but this hides the missing time. The segments can be accessed, though, in order to see when those breaks occur, although without timestamps there's no way to know how long those breaks are. At least not as far as I know.

tsalo avatar Jul 31 '20 12:07 tsalo