Пример #1
0
String RecordNode::generateHeader(Channel* ch)
{

    String header = "header.format = 'Open Ephys Data Format'; \n";

    header += "header.version = 0.2;";
    header += "header.header_bytes = ";
    header += String(HEADER_SIZE);
    header += ";\n";

    if (ch->isEventChannel)
    {
        header += "header.description = 'each record contains one 64-bit timestamp, one 16-bit sample position, one uint8 event type, one uint8 processor ID, one uint8 event ID, one uint8 event channel, and one uint16 recordingNumber'; \n";

    }
    else
    {
        header += "header.description = 'each record contains one 64-bit timestamp, one 16-bit sample count (N), 1 uint16 recordingNumber, N 16-bit samples, and one 10-byte record marker (0 1 2 3 4 5 6 7 8 255)'; \n";
    }


    header += "header.date_created = '";
    header += generateDateString();
    header += "';\n";

    header += "header.channel = '";
    header += ch->name;
    header += "';\n";

    if (ch->isEventChannel)
    {

        header += "header.channelType = 'Event';\n";
    }
    else
    {
        header += "header.channelType = 'Continuous';\n";
    }

    header += "header.sampleRate = ";
    // all channels need to have the same sample rate under the current scheme
    header += String(channelPointers[0]->sampleRate); 
    header += ";\n";
    header += "header.blockLength = ";
    header += BLOCK_LENGTH;
    header += ";\n";
    header += "header.bufferSize = ";
    header += getAudioComponent()->getBufferSize();
    header += ";\n";
    header += "header.bitVolts = ";
    header += String(ch->bitVolts);
    header += ";\n";

    header = header.paddedRight(' ', HEADER_SIZE);

    //std::cout << header << std::endl;

    return header;

}
Пример #2
0
String OriginalRecording::generateSpikeHeader(SpikeRecordInfo* elec)
{
    String header = "header.format = 'Open Ephys Data Format'; \n";
    header += "header.version = " + String(VERSION_STRING) + "; \n";
    header += "header.header_bytes = ";
    header += String(HEADER_SIZE);
    header += ";\n";

    header += "header.description = 'Each record contains 1 uint8 eventType, 1 uint64 timestamp, 1 uint16 electrodeID, 1 uint16 numChannels (n), 1 uint16 numSamples (m), n*m uint16 samples, n uint16 channelGains, n uint16 thresholds, and 1 uint16 recordingNumber'; \n";

    header += "header.date_created = '";
    header += generateDateString();
    header += "';\n";

    header += "header.electrode = '";
    header += elec->name;
    header += "';\n";

    header += "header.num_channels = ";
    header += elec->numChannels;
    header += ";\n";

    header += "header.sampleRate = ";
    header += String(elec->sampleRate);
    header += ";\n";

    header = header.paddedRight(' ', HEADER_SIZE);

    //std::cout << header << std::endl;

    return header;
}
Пример #3
0
String RecordNode::generateHeader(Channel* ch)
{

    String header = "header.format = 'OPEN EPHYS DATA FORMAT v0.0'; \n";

    header += "header.header_bytes = ";
    header += String(HEADER_SIZE);
    header += ";\n";

    if (ch->isEventChannel)
    {
        header += "header.description = 'each record contains one 64-bit timestamp, one 16-bit sample position, one uint8 event type, one uint8 processor ID, one uint8 event ID, and one uint8 event channel'; \n";

    }
    else
    {
        header += "header.description = 'each record contains one 64-bit timestamp, one 16-bit sample count (N), N 16-bit samples, and one 10-byte record marker (0 0 0 0 0 0 0 0 0 255)'; \n";
    }


    header += "header.date_created = '";
    header += generateDateString();
    header += "';\n";

    header += "header.channel = '";
    header += ch->name;
    header += "';\n";

    if (ch->isEventChannel)
    {

        header += "header.channelType = 'Event';\n";

    }
    else
    {

        header += "header.channelType = 'Continuous';\n";

        header += "header.sampleRate = ";
        header += String(ch->sampleRate);
        header += ";\n";
    }

    header += "header.bitVolts = ";
    header += String(ch->bitVolts);
    header += ";\n";

    header = header.paddedRight(' ', HEADER_SIZE);

    //std::cout << header << std::endl;

    return header;

}