diff --git a/applications/mne_scan/plugins/ftbuffer/ftbuffertypes.h b/applications/mne_scan/plugins/ftbuffer/ftbuffertypes.h index 69af925eb35..5e0ae4a0379 100644 --- a/applications/mne_scan/plugins/ftbuffer/ftbuffertypes.h +++ b/applications/mne_scan/plugins/ftbuffer/ftbuffertypes.h @@ -74,7 +74,8 @@ typedef struct { qint32 nevents; } samples_events_t; -enum class HeaderChunk : int{ +enum class HeaderChunkType : int{ + FT_CHUNK_CHANNEL_NAMES = 1, FT_CHUNK_NEUROMAG_HEADER = 8, FT_CHUNK_NEUROMAG_ISOTRAK = 9, FT_CHUNK_NEUROMAG_HPIRESULT = 10 diff --git a/applications/mne_scan/plugins/ftbuffer/ftbuffproducer.cpp b/applications/mne_scan/plugins/ftbuffer/ftbuffproducer.cpp index aac33cbab65..452b841390b 100644 --- a/applications/mne_scan/plugins/ftbuffer/ftbuffproducer.cpp +++ b/applications/mne_scan/plugins/ftbuffer/ftbuffproducer.cpp @@ -81,7 +81,7 @@ void FtBuffProducer::runMainLoop() QThread::usleep(50000); } - while(!m_pFtConnector->getHeader()) { + while(!m_pFtConnector->getFixedHeader()) { QThread::usleep(50000); } @@ -127,7 +127,7 @@ void FtBuffProducer::connectToBuffer(QString addr, //Try to get info from buffer first, then resort to file if(m_pFtConnector->connect()) { - auto metadata = m_pFtConnector->parseBufferHeaders(); + auto metadata = m_pFtConnector->parseBufferHeader(); if (m_pFtBuffer->setupRTMSA(metadata)){ emit connecStatus(true); return; diff --git a/applications/mne_scan/plugins/ftbuffer/ftconnector.cpp b/applications/mne_scan/plugins/ftbuffer/ftconnector.cpp index 50eaf63a54c..90e68b54789 100644 --- a/applications/mne_scan/plugins/ftbuffer/ftconnector.cpp +++ b/applications/mne_scan/plugins/ftbuffer/ftconnector.cpp @@ -44,6 +44,7 @@ #include #include +#include //============================================================================================================= // EIGEN INCLUDES @@ -69,7 +70,7 @@ FtConnector::FtConnector() , m_iExtendedHeaderSize(0) , m_iPort(1972) , m_bNewData(false) -, m_fSampleFreq(0) +, m_fSamplingFreq(0) , m_sAddress("127.0.0.1") , m_pSocket(Q_NULLPTR) { @@ -119,7 +120,7 @@ bool FtConnector::connect() //============================================================================================================= -bool FtConnector::getHeader() +bool FtConnector::getFixedHeader() { qInfo() << "[FtConnector::getHeader] Attempting to get header..."; @@ -140,7 +141,7 @@ bool FtConnector::getHeader() //Parse return message from buffer QBuffer msgBuffer; - prepBuffer(msgBuffer, sizeof (messagedef_t)); + copyResponse(msgBuffer, sizeof (messagedef_t)); int bufsize = parseMessageDef(msgBuffer); if (bufsize == 0) { @@ -155,7 +156,7 @@ bool FtConnector::getHeader() //Parse header info from buffer QBuffer hdrBuffer; - prepBuffer(hdrBuffer, sizeof (headerdef_t)); // if implementing header chunks: change from sizeof (headerdef) to bufsize + copyResponse(hdrBuffer, sizeof (headerdef_t)); // if implementing header chunks: change from sizeof (headerdef) to bufsize parseHeaderDef(hdrBuffer); return true; @@ -205,11 +206,11 @@ bool FtConnector::parseHeaderDef(QBuffer &readBuffer) //Save paramerters m_iNumChannels = headerdef.nchans; - m_fSampleFreq = headerdef.fsample; + m_fSamplingFreq = headerdef.fsample; m_iNumNewSamples = headerdef.nsamples; m_iDataType = headerdef.data_type; m_iExtendedHeaderSize = headerdef.bufsize; - m_iMinSampleRead = static_cast(m_fSampleFreq/2); + m_iMinSampleRead = static_cast(m_fSamplingFreq/2); qInfo() << "[FtConnector::parseHeaderDef] Got header parameters."; @@ -287,7 +288,7 @@ bool FtConnector::getData() //Parse return message from buffer QBuffer msgBuffer; - prepBuffer(msgBuffer, sizeof (messagedef_t)); + copyResponse(msgBuffer, sizeof (messagedef_t)); int bufsize = parseMessageDef(msgBuffer); //Waiting for response. @@ -297,12 +298,12 @@ bool FtConnector::getData() //Parse return data def from buffer QBuffer datadefBuffer; - prepBuffer(datadefBuffer, sizeof (datadef_t)); + copyResponse(datadefBuffer, sizeof (datadef_t)); bufsize = parseDataDef(datadefBuffer); //Parse actual data from buffer QBuffer datasampBuffer; - prepBuffer(datasampBuffer, bufsize); + copyResponse(datasampBuffer, bufsize); parseData(datasampBuffer, bufsize); //update sample tracking @@ -334,8 +335,8 @@ bool FtConnector::setPort(const int &iPort) //============================================================================================================= -void FtConnector::prepBuffer(QBuffer &buffer, - int numBytes) +void FtConnector::copyResponse(QBuffer &buffer, + int numBytes) { buffer.open(QIODevice::ReadWrite); buffer.write(m_pSocket->read(numBytes)); @@ -395,7 +396,7 @@ void FtConnector::echoStatus() qInfo() << "| Socket: " << m_pSocket->state(); qInfo() << "| Address: " << m_sAddress << ":" << m_iPort; qInfo() << "| Channels: " << m_iNumChannels; - qInfo() << "| Frequency: " << m_fSampleFreq; + qInfo() << "| Frequency: " << m_fSamplingFreq; qInfo() << "| Samples read:" << m_iNumSamples; qInfo() << "| New samples: " << m_iNumNewSamples; qInfo() << "|================================"; @@ -430,7 +431,7 @@ int FtConnector::totalBuffSamples() //Parse return message from buffer QBuffer msgBuffer; - prepBuffer(msgBuffer, sizeof (messagedef_t)); + copyResponse(msgBuffer, sizeof (messagedef_t)); parseMessageDef(msgBuffer); //Waiting for response. @@ -441,7 +442,7 @@ int FtConnector::totalBuffSamples() qint32 iNumSamp; QBuffer sampeventsBuffer; - prepBuffer(sampeventsBuffer, sizeof(samples_events_t)); + copyResponse(sampeventsBuffer, sizeof(samples_events_t)); char cSamps[sizeof(iNumSamp)]; sampeventsBuffer.read(cSamps, sizeof(iNumSamp)); @@ -468,19 +469,6 @@ bool FtConnector::parseData(QBuffer &datasampBuffer, QByteArray dataArray = datasampBuffer.readAll(); float* fdata = reinterpret_cast (dataArray.data()); -//TODO: Implement receiving other types of data -// switch (m_iDataType) { -// case DATATYPE_FLOAT32: -// auto data = reinterpret_cast(dataArray.data(), bufsize); -// qDebug() << "*** Would you look at that, we're all the way here ***"; -// qDebug() << "Data sample:"; - -// for (int i = 0; i < 10 ; i++) { -// qDebug() << data[i]; -// } -// break; -// } - //format data into eigen matrix to pass up Eigen::MatrixXf matData; matData.resize(m_iNumChannels, m_iMsgSamples); @@ -542,24 +530,22 @@ QString FtConnector::getAddr() //============================================================================================================= -MetaData FtConnector::parseBufferHeaders() +MetaData FtConnector::parseBufferHeader() { qInfo() << "[FtConnector::parseNeuromagHeader] Attempting to get extended header..."; MetaData metadata; - QBuffer chunkBuffer; - getHeader(); - prepBuffer(chunkBuffer, m_iExtendedHeaderSize); + getFixedHeader(); - std::cout << "Parsing extended header\n"; + qInfo() << "[FtConnector::parseNeuromagHeader] Parsing extended header\n"; + QBuffer allChunksBuffer; + copyResponse(allChunksBuffer, m_iExtendedHeaderSize); FtHeaderParser parser; - metadata = parser.parseHeader(chunkBuffer); + metadata = parser.parseExtendedHeader(allChunksBuffer); - if (!metadata.bFiffInfo){ - metadata.setFiffinfo(infoFromSimpleHeader()); - } + checkForMissingMetadataFields(metadata); return metadata; } @@ -587,11 +573,14 @@ BufferInfo FtConnector::getBufferInfo() //============================================================================================================= -FIFFLIB::FiffInfo FtConnector::infoFromSimpleHeader() +FIFFLIB::FiffInfo FtConnector::infoFromSimpleHeader() const { FIFFLIB::FiffInfo defaultInfo; - defaultInfo.sfreq = m_fSampleFreq; + defaultInfo.meas_date[0] = static_cast(QDateTime::currentDateTime().toSecsSinceEpoch()); + defaultInfo.meas_date[1] = 0; + + defaultInfo.sfreq = m_fSamplingFreq; defaultInfo.nchan = m_iNumChannels; defaultInfo.chs.clear(); @@ -612,3 +601,43 @@ FIFFLIB::FiffInfo FtConnector::infoFromSimpleHeader() return defaultInfo; } + +//============================================================================================================= + +void FtConnector::checkForMissingMetadataFields(MetaData& data) const +{ + if (!data.bFiffInfo){ + data.setFiffinfo(infoFromSimpleHeader()); + } else { + if ( data.info.meas_date[0] == -1 ) + { + data.info.meas_date[0] = static_cast(QDateTime::currentDateTime().toSecsSinceEpoch()); + data.info.meas_date[1] = 0; + } + + if ( data.info.sfreq <= 0 ) + { + data.info.sfreq = m_fSamplingFreq; + } + if ( data.info.nchan == -1 ) + { + data.info.nchan = m_iNumChannels; + data.info.chs.clear(); + for (int chani = 0; chani< m_iNumChannels; chani++) + { + FIFFLIB::FiffChInfo channel; + + channel.ch_name = "Ch. " + QString::number(chani); + channel.kind = FIFFV_MEG_CH; + channel.unit = FIFF_UNIT_T; + channel.unit_mul = FIFF_UNITM_NONE; + channel.chpos.coil_type = FIFFV_COIL_NONE; + + data.info.chs.append(channel); + + data.info.ch_names.append("Ch. " + QString::number(chani)); + + } + } + } +} diff --git a/applications/mne_scan/plugins/ftbuffer/ftconnector.h b/applications/mne_scan/plugins/ftbuffer/ftconnector.h index d6f0c38671f..949feb667c9 100644 --- a/applications/mne_scan/plugins/ftbuffer/ftconnector.h +++ b/applications/mne_scan/plugins/ftbuffer/ftconnector.h @@ -129,7 +129,7 @@ class FtConnector : public QObject * * @return true if successful, false if unsuccessful. */ - bool getHeader(); + bool getFixedHeader(); //========================================================================================================= /** @@ -209,7 +209,7 @@ class FtConnector : public QObject * * @return returns the FiffInfo from the parsed fif file from the neuromag header chunk. */ - MetaData parseBufferHeaders(); + MetaData parseBufferHeader(); //========================================================================================================= /** @@ -293,8 +293,8 @@ class FtConnector : public QObject * @param[out] buffer QBuffer to which daa will be written. * @param[in] numBytes How many bytes to read from socket. */ - void prepBuffer(QBuffer &buffer, - int numBytes); + void copyResponse(QBuffer &buffer, + int numBytes); //========================================================================================================= /** @@ -310,7 +310,16 @@ class FtConnector : public QObject * * @return FiffInfo object based on filedtrip header */ - FIFFLIB::FiffInfo infoFromSimpleHeader(); + FIFFLIB::FiffInfo infoFromSimpleHeader() const; + + //========================================================================================================= + /** + * Checks for empty or invalid important fields in the parsed metadata and attempts to fill them. + * + * @param[in] data FiffInfo structure with information parsed from the FTBuffer headers. + * + */ + void checkForMissingMetadataFields(MetaData& data) const; int m_iMinSampleRead; /**< Number of samples that need to be added t obuffer before we try to read. */ int m_iNumSamples; /**< Number of samples we've read from the buffer. */ @@ -323,7 +332,7 @@ class FtConnector : public QObject bool m_bNewData; /**< Indicate whether we've received new data. */ - float m_fSampleFreq; /**< Sampling frequency of data in the buffer. */ + float m_fSamplingFreq; /**< Sampling frequency of data in the buffer. */ QString m_sAddress; /**< Address where the ft buffer is found. */ diff --git a/applications/mne_scan/plugins/ftbuffer/ftheaderparser.cpp b/applications/mne_scan/plugins/ftbuffer/ftheaderparser.cpp index df02ec47fdf..2866037c788 100644 --- a/applications/mne_scan/plugins/ftbuffer/ftheaderparser.cpp +++ b/applications/mne_scan/plugins/ftbuffer/ftheaderparser.cpp @@ -38,6 +38,8 @@ //============================================================================================================= #include "ftheaderparser.h" +#include "fiff/fiff_ch_info.h" +#include "fiff/fiff_constants.h" //============================================================================================================= // QT INCLUDES @@ -49,25 +51,75 @@ // USED NAMESPACES //============================================================================================================= +using namespace FTBUFFERPLUGIN; using FTBUFFERPLUGIN::FtHeaderParser; using FTBUFFERPLUGIN::MetaData; //============================================================================================================= // DEFINE FREE FUNCTIONS //============================================================================================================= +namespace { -void FTBUFFERPLUGIN::parseNeuromagHeader(MetaData& data, QBuffer& neuromagBuffer) +//============================================================================================================= +/** + * Return a list of names for each channel from the input buffer. + * @param [in] buffer Buffer from where to extract the channel names spearated by '\0' characters. + * @return A list with each channel's label name. + */ +QStringList extractChannelNamesFromBuffer(QBuffer& buffer) { - qint32_be iIntToChar; - char cCharFromInt[sizeof (qint32)]; + QString singleStringAllNames(buffer.buffer().replace('\0','\n')); + QStringList channelNames(singleStringAllNames.split('\n')); + channelNames.removeAll(channelNames[channelNames.size()-1]); + return channelNames; +} +//============================================================================================================= +/** + * Parses header chunk FT_CHUNK_CHANNEL_NAMES = 1 + * + * @param[in, out] data MetaData object that gets updated with measurment info from header + * @param[in] neuromagBuffer Buffer containing the data portion of the neuromag header chunk + */ +void parseChannelNamesHeader( MetaData& data, QBuffer& channelNamesBuffer) +{ + QStringList channelNames(extractChannelNamesFromBuffer(channelNamesBuffer)); + +// qInfo() << channelNames; + FIFFLIB::FiffInfo info; + + info.nchan = static_cast(channelNames.size()); + + QList chanList; + for ( auto& name : channelNames) + { + FIFFLIB::FiffChInfo chanInfo; + chanInfo.ch_name = name; + chanInfo.kind = FIFFV_MEG_CH; + chanInfo.unit = FIFF_UNIT_T; + chanInfo.unit_mul = FIFF_UNITM_NONE; + chanList.append(chanInfo); + } + info.chs = chanList; + info.ch_names = channelNames; + + data.setFiffinfo(info); +} + +//============================================================================================================= +/** + * Parses header chunk FT_CHUNK_NEUROMAG_HEADER = 8 + * + * @param[in, out] data MetaData object that gets updated with measurment info from header + * @param[in] neuromagBuffer Buffer containing the data portion of the neuromag header chunk + */ +void parseNeuromagHeader(MetaData& data, QBuffer& neuromagBuffer) +{ //Pad buffer because the fiff file we receive is missing an end tag - iIntToChar = -1; + char cCharFromInt[sizeof (qint32)]; + qint32_be iIntToChar(-1); memcpy(cCharFromInt, &iIntToChar, sizeof(qint32)); - neuromagBuffer.write(cCharFromInt); - neuromagBuffer.write(cCharFromInt); - neuromagBuffer.write(cCharFromInt); - neuromagBuffer.write(cCharFromInt); + neuromagBuffer.write(cCharFromInt, sizeof(quint32)); neuromagBuffer.reset(); @@ -84,8 +136,13 @@ void FTBUFFERPLUGIN::parseNeuromagHeader(MetaData& data, QBuffer& neuromagBuffer } //============================================================================================================= - -void FTBUFFERPLUGIN::parseIsotrakHeader(MetaData& data, QBuffer& isotrakBuffer) +/** + * Parses headr chunk FT_CHUNK_NEUROMAG_ISOTRAK = 9 + * + * @param[in, out] data MetaData object that gets updated with measurment info from header + * @param [in] isotrakBuffer Buffer containing the data portion of the isotrak header chunk + */ +void parseIsotrakHeader(MetaData& data, QBuffer& isotrakBuffer) { isotrakBuffer.reset(); @@ -100,6 +157,8 @@ void FTBUFFERPLUGIN::parseIsotrakHeader(MetaData& data, QBuffer& isotrakBuffer) } } +} //namespace + //============================================================================================================= // DEFINE MEMBER METHODS //============================================================================================================= @@ -111,7 +170,7 @@ FtHeaderParser::FtHeaderParser() //============================================================================================================= -MetaData FtHeaderParser::parseHeader(QBuffer &buffer) +MetaData FtHeaderParser::parseExtendedHeader(QBuffer &buffer) { MetaData data; while(!buffer.atEnd()){ @@ -125,52 +184,42 @@ MetaData FtHeaderParser::parseHeader(QBuffer &buffer) void FtHeaderParser::registerMembers() { - functionMap[HeaderChunk::FT_CHUNK_NEUROMAG_HEADER] = parseNeuromagHeader; - functionMap[HeaderChunk::FT_CHUNK_NEUROMAG_ISOTRAK] = parseIsotrakHeader; + chunkParsersMap[HeaderChunkType::FT_CHUNK_CHANNEL_NAMES] = parseChannelNamesHeader; + chunkParsersMap[HeaderChunkType::FT_CHUNK_NEUROMAG_HEADER] = parseNeuromagHeader; + chunkParsersMap[HeaderChunkType::FT_CHUNK_NEUROMAG_ISOTRAK] = parseIsotrakHeader; } //============================================================================================================= void FtHeaderParser::processChunk(MetaData& data , QBuffer& buffer) { - auto chunkType = getChunkType(buffer); - auto function = functionMap.find(chunkType); + FtHeaderParser::Chunk chunk = getChunk(buffer); - QBuffer headerChunk; - getSingleHeaderChunk(buffer, headerChunk); + auto chunkParser = chunkParsersMap.find(chunk.type); - if (function != functionMap.end()){ - function->second(data, headerChunk); + if (chunkParser != chunkParsersMap.end()) { + chunkParser->second(data, *chunk.data); } } //============================================================================================================= -void FtHeaderParser::getSingleHeaderChunk(QBuffer &source, QBuffer &dest) +FtHeaderParser::Chunk FtHeaderParser::getChunk(QBuffer &buffer) { - qint32 iSize; - char cSize[sizeof(qint32)]; + FtHeaderParser::Chunk outChunk; - //read size of chunk - source.read(cSize, sizeof(qint32)); - std::memcpy(&iSize, cSize, sizeof(qint32)); + char cType[sizeof(quint32)]; + buffer.read(cType, sizeof(quint32)); + std::memcpy(&outChunk.type, cType, sizeof(quint32)); - //Read relevant chunk info - dest.open(QIODevice::ReadWrite); - dest.write(source.read(iSize)); -} + char cSize[sizeof(quint32)]; + buffer.read(cSize, sizeof(quint32)); + std::memcpy(&outChunk.size, cSize, sizeof(quint32)); -//============================================================================================================= + outChunk.data = QSharedPointer(new QBuffer); -HeaderChunk FtHeaderParser::getChunkType(QBuffer &buffer) -{ - qint32 iType; - char cType[sizeof(qint32)]; - - buffer.read(cType, sizeof(qint32)); - std::memcpy(&iType, cType, sizeof(qint32)); + outChunk.data->open(QIODevice::ReadWrite); + outChunk.data->write(buffer.read(outChunk.size)); - std::cout << "Read header of type" << iType << "\n"; - return static_cast(iType); + return outChunk; } - diff --git a/applications/mne_scan/plugins/ftbuffer/ftheaderparser.h b/applications/mne_scan/plugins/ftbuffer/ftheaderparser.h index 6838f3ef6db..0063233477a 100644 --- a/applications/mne_scan/plugins/ftbuffer/ftheaderparser.h +++ b/applications/mne_scan/plugins/ftbuffer/ftheaderparser.h @@ -87,28 +87,6 @@ struct FTBUFFER_EXPORT MetaData{ bFiffDigitizerData = true;}; }; -//============================================================================================================= -// DEFINE FREE FUNCTIONS -//============================================================================================================= - -//============================================================================================================= -/** - * Parses header chunk FT_CHUNK_NEUROMAG_HEADER = 8 - * - * @param[in, out] data MetaData object that gets updated with measurment info from header - * @param[in] neuromagBuffer Buffer containing the data portion of the neuromag header chunk - */ -FTBUFFER_EXPORT void parseNeuromagHeader(MetaData& data, QBuffer& neuromagBuffer); - -//============================================================================================================= -/** - * Parses headr chunk FT_CHUNK_NEUROMAG_ISOTRAK = 9 - * - * @param[in, out] data MetaData object that gets updated with measurment info from header - * @param [in] isotrakBuffer Buffer containing the data portion of the isotrak header chunk - */ -FTBUFFER_EXPORT void parseIsotrakHeader(MetaData& data, QBuffer& isotrakBuffer); - //============================================================================================================= /** * This class parses the extended header chunks of a fieldtrip buffer and returns measurement metadata. @@ -135,9 +113,17 @@ class FTBUFFER_EXPORT FtHeaderParser{ * * @return Returns MetaData object containing buffer/measurement metadata. */ - MetaData parseHeader(QBuffer& buffer); + MetaData parseExtendedHeader(QBuffer& buffer); private: + class Chunk + { + public: + HeaderChunkType type; + quint32 size; + QSharedPointer data; + }; + //========================================================================================================= /** * Initialize the function map with entreis for the chunk headers we care about. @@ -155,24 +141,15 @@ class FTBUFFER_EXPORT FtHeaderParser{ //========================================================================================================= /** - * Retreives just the data portion of the extended header chunk and places it in a new buffer. - * - * @param[in] source Buffer with all etended header chunks. Buffer needs to be at size of a chunk. - * @param[in, out] dest Destination buffer where chunk will be copied. - */ - void getSingleHeaderChunk(QBuffer& source, QBuffer& dest); - - //========================================================================================================= - /** - * Returns type of chunk next up in the buffer. + * Returns a populated chunk read from the input buffer. * * @param[in] buffer Buffer of all extended header chunks. Buffer needs to be at start of a chunk. * * @return Returns enum of the cooresponding header chuk type. */ - HeaderChunk getChunkType(QBuffer& buffer); + Chunk getChunk(QBuffer& buffer); - std::unordered_map> functionMap; /**< Map of functions to parse header chunks. */ + std::unordered_map> chunkParsersMap; /**< Map of functions to parse header chunks. */ }; }//namespace diff --git a/libraries/fiff/c/fiff_coord_trans_old.cpp b/libraries/fiff/c/fiff_coord_trans_old.cpp index ecdcac40030..34d6da9d9be 100644 --- a/libraries/fiff/c/fiff_coord_trans_old.cpp +++ b/libraries/fiff/c/fiff_coord_trans_old.cpp @@ -232,7 +232,6 @@ void mne_matt_mat_mult2_20 (float **m1,float **m2,float **result, #else int j,k,p; float sum; - int one = 1; for (j = 0; j < d1; j++) for (k = 0; k < d3; k++) { diff --git a/libraries/fiff/fiff_ch_info.cpp b/libraries/fiff/fiff_ch_info.cpp index 5a8b7a89a87..7ecf9013552 100644 --- a/libraries/fiff/fiff_ch_info.cpp +++ b/libraries/fiff/fiff_ch_info.cpp @@ -56,10 +56,10 @@ FiffChInfo::FiffChInfo() , kind(0) , range(1.0f) , cal(1.0f) -, coord_frame(FIFFV_COORD_UNKNOWN) , unit(0) , unit_mul(0) , ch_name(QString("")) +, coord_frame(FIFFV_COORD_UNKNOWN) { coil_trans.setIdentity(); } @@ -73,12 +73,12 @@ FiffChInfo::FiffChInfo(const FiffChInfo &p_FiffChInfo) , range(p_FiffChInfo.range) , cal(p_FiffChInfo.cal) , chpos(p_FiffChInfo.chpos) -, coil_trans(p_FiffChInfo.coil_trans) -, eeg_loc(p_FiffChInfo.eeg_loc) -, coord_frame(p_FiffChInfo.coord_frame) , unit(p_FiffChInfo.unit) , unit_mul(p_FiffChInfo.unit_mul) , ch_name(p_FiffChInfo.ch_name) +, coil_trans(p_FiffChInfo.coil_trans) +, eeg_loc(p_FiffChInfo.eeg_loc) +, coord_frame(p_FiffChInfo.coord_frame) { } diff --git a/libraries/fiff/fiff_constants.h b/libraries/fiff/fiff_constants.h index 0d0aafdfb89..80334982b16 100644 --- a/libraries/fiff/fiff_constants.h +++ b/libraries/fiff/fiff_constants.h @@ -198,6 +198,7 @@ namespace FIFFLIB #define FIFFV_COIL_KRISS_GRAD 9001 /**< KRISS gradiometer. */ #define FIFFV_COIL_COMPUMEDICS_ADULT_GRAD 9101 /**< Compumedics adult gradiometer. */ #define FIFFV_COIL_COMPUMEDICS_PEDIATRIC_GRAD 9102 /**< Compumedics pediatric gradiometer. */ +#define FIFFV_COIL_FIELDLINE_OPM 10001 /**< Fieldliine OPM magnetometer. */ #define FIFFM_IS_VV_COIL(c) ((c)/1000 == 3) diff --git a/libraries/fiff/fiff_id.cpp b/libraries/fiff/fiff_id.cpp index 64da470505c..7cf400de5d8 100644 --- a/libraries/fiff/fiff_id.cpp +++ b/libraries/fiff/fiff_id.cpp @@ -65,23 +65,6 @@ FiffId::FiffId() //============================================================================================================= -FiffId::FiffId(const FiffId& p_FiffId) -: version(p_FiffId.version) -{ - machid[0] = p_FiffId.machid[0]; - machid[1] = p_FiffId.machid[1]; - time.secs = p_FiffId.time.secs; - time.usecs = p_FiffId.time.usecs; -} - -//============================================================================================================= - -FiffId::~FiffId() -{ -} - -//============================================================================================================= - FiffId FiffId::new_file_id() { FiffId id; diff --git a/libraries/fiff/fiff_id.h b/libraries/fiff/fiff_id.h index cbd83073703..661d11c4e28 100644 --- a/libraries/fiff/fiff_id.h +++ b/libraries/fiff/fiff_id.h @@ -79,17 +79,9 @@ class FIFFSHARED_EXPORT FiffId { //========================================================================================================= /** - * Copy constructor. - * - * @param[in] p_FiffId Universially unique identifier which should be copied. - */ - FiffId(const FiffId& p_FiffId); - - //========================================================================================================= - /** - * Destroys the universially unique identifier. + * Destructor. */ - ~FiffId(); + ~FiffId() = default; //========================================================================================================= /** @@ -152,20 +144,6 @@ class FIFFSHARED_EXPORT FiffId { fiff_int_t version; /**< File version. */ fiff_int_t machid[2]; /**< Unique machine ID. */ fiffTimeRec time; /**< Time of the ID creation. */ - -// ### OLD STRUCT ### -///** -//* A file ID. -//* -//* These universially unique identifiers are also -//* used to identify blocks within fthe files. -//*/ -//typedef struct _fiffIdRec { -// fiff_int_t version; /**< File version. */ -// fiff_int_t machid[2]; /**< Unique machine ID. */ -// fiffTimeRec time; /**< Time of the ID creation. */ -//} fiffIdRec,*fiffId; /**< This is the file identifier. */ -//typedef fiffIdRec fiff_id_t; }; //=============================================================================================================