IBT-FMI / COSplay

Contrast Optimized Stimulation player
http://cosplay.readthedocs.io/en/latest
GNU General Public License v3.0
2 stars 3 forks source link

JSON stimulation sequence format #1

Closed TheChymera closed 7 years ago

TheChymera commented 7 years ago

If we decide to go with a high-level syntax, we really need to think about the issues/constraints it may cause in the long run.

Why do you feel there is a need to specify the number of events explicitly?

TheChymera commented 7 years ago

In any case we need a further parameter for the pulse duration.

In out current standard optogenetic stimulation, for instance, we stimulate at 20Hz, but the pulse width is 5ms, meaning that the laser is on for 10% of the event duration, as opposed to 50%.

TheChymera commented 7 years ago

@faymanns regarding the unit in our JSON format, I think it's best to express everything in seconds, and keep it TR-agnostic. Expressing times in TRs can be very confusing for TR different than 1s, and both expressing times in TR or ms is inconsistent with using Hz for the frequency.

faymanns commented 7 years ago

I change the time from ms to s. 5ba0bcaededa5cc36fda0e4bc1d47518298340f1

TheChymera commented 7 years ago

Could you please persistently track an example stimulation file with your code?

Also, I have been thinking about this, and since our current JSON format has the same subkeys for all keys, maybe a 2d datastructure would be more readable (and smaller in file size).

It may also help us attain better compatibility with BIDS (one of the more modern and widely-used standards), as they recommend a 2d structure with columns similar to our keys to track events during fMRI.

faymanns commented 7 years ago

Micropython doesn't have a csv module yet, but I can look into writing one. Alternatively, we could use json on the pyboard, but store tsv on the host. A major draw back of this approach would be, that you have to convert tsv to json if you want to do drag and drop.

faymanns commented 7 years ago

We agreed on using the BIDS format on both, the host and the pyboard.