PageSourceSearch

https://mne-cpp.github.io/assets/js/d1c06919.0f5e933a.js

js mne-cpp.github.io collected 2026-10-03 09:38:51 UTC 17,463 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkmne_cpp_website=globalThis.webpackChunkmne_cpp_website||[]).push([[12626],{89842(e,n,l){l.r(n),l.d(n,{assets:()=>t,contentTitle:()=>d,default:()=>o,frontMatter:()=>r,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"api/disp/channel-data-model","title":"DISPLIB::ChannelDataModel","description":"Namespace Display Library","source":"@site/docs/api/disp/channel-data-model.mdx","sourceDirName":"api/disp","slug":"/api/disp/channel-data-model","permalink":"/docs/api/disp/channel-data-model","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":13,"frontMatter":{"id":"channel-data-model","title":"DISPLIB::ChannelDataModel","sidebar_label":"ChannelDataModel","sidebar_position":13},"sidebar":"apiSidebar","previous":{"title":"ButterflyView","permalink":"/docs/api/disp/butterfly-view"},"next":{"title":"ChannelDataView","permalink":"/docs/api/disp/channel-data-view"}}');var a=l(74848),i=l(28453);const r={id:"channel-data-model",title:"DISPLIB::ChannelDataModel",sidebar_label:"ChannelDataModel",sidebar_position:13},d="ChannelDataModel",t={},h=[{value:"Inheritance",id:"inheritance",level:3},{value:"Public Methods",id:"public-methods",level:2},{value:"ChannelDataModel(parent)",id:"channeldatamodelparent",level:3},{value:"init(pFiffInfo)",id:"initpfiffinfo",level:3},{value:"setData(data, firstSample)",id:"setdatadata-firstsample",level:3},{value:"appendData(data)",id:"appenddatadata",level:3},{value:"clearData()",id:"cleardata",level:3},{value:"setScaleMap(scaleMap)",id:"setscalemapscalemap",level:3},{value:"setScaleMapFromStrings(scaleMap)",id:"setscalemapfromstringsscalemap",level:3},{value:"setVirtualChannels(virtualChannels)",id:"setvirtualchannelsvirtualchannels",level:3},{value:"setSignalColor(color)",id:"setsignalcolorcolor",level:3},{value:"setMaxStoredSamples(n)",id:"setmaxstoredsamplesn",level:3},{value:"setChannelBad(channelIdx, bad)",id:"setchannelbadchannelidx-bad",level:3},{value:"setRemoveDC(remove)",id:"setremovedcremove",level:3},{value:"removeDC()",id:"removedc",level:3},{value:"setDetrendMode(mode)",id:"setdetrendmodemode",level:3},{value:"detrendMode()",id:"detrendmode",level:3},{value:"channelCount()",id:"channelcount",level:3},{value:"firstSample()",id:"firstsample",level:3},{value:"totalSamples()",id:"totalsamples",level:3},{value:"sfreq()",id:"sfreq",level:3},{value:"channelInfo(channelIdx)",id:"channelinfochannelidx",level:3},{value:"channelRms(channelIdx, firstSample, lastSample)",id:"channelrmschannelidx-firstsample-lastsample",level:3},{value:"decimatedVertices(channelIdx, firstSample, lastSample, pixelWidth, vboFirstSample)",id:"decimatedverticeschannelidx-firstsample-lastsample-pixelwidth-vbofirstsample",level:3},{value:"sampleValueAt(channelIdx, sample)",id:"samplevalueatchannelidx-sample",level:3},{value:"Authors of this file",id:"authors-of-this-file",level:2}];function c(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",mermaid:"mermaid",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"channeldatamodel",children:"ChannelDataModel"})}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Namespace:"})," ",(0,a.jsx)(n.code,{children:"DISPLIB"})," \xa0\xb7\xa0 ",(0,a.jsx)(n.strong,{children:"Library:"})," Display Library"]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.code,{children:"#include <disp/channeldatamodel.h>"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-cpp",children:"class DISPLIB::ChannelDataModel\n"})}),"\n",(0,a.jsx)(n.p,{children:"Circular-buffer Qt model exposing a rolling window of the live FIFF stream as a table."}),"\n",(0,a.jsxs)(n.p,{children:["Keeps a per-channel ",(0,a.jsx)(n.code,{children:"Eigen::MatrixXd"})," ring buffer of the most recent N seconds, tracks bad-channel flags, trigger annotations and the active SSP / compensation / filter operators so the delegate can render the pre-processed signal without touching the raw buffer."]}),"\n",(0,a.jsx)(n.h3,{id:"inheritance",children:"Inheritance"}),"\n",(0,a.jsx)(n.mermaid,{value:"classDiagram\n    QObject <|-- ChannelDataModel"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h2,{id:"public-methods",children:"Public Methods"}),"\n",(0,a.jsx)(n.h3,{id:"channeldatamodelparent",children:"ChannelDataModel(parent)"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"initpfiffinfo",children:"init(pFiffInfo)"}),"\n",(0,a.jsxs)(n.p,{children:["Initialise with channel metadata from a ",(0,a.jsx)(n.a,{href:"/docs/api/fiff/fiff-info",children:"FiffInfo"}),"."]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"pFiffInfo"})," : ",(0,a.jsxs)(n.em,{children:["QSharedPointer<",(0,a.jsx)(n.a,{href:"/docs/api/fiff/fiff-info",children:"FiffInfo"}),">"]}),"\nThe FiffInfo describing the channels."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setdatadata-firstsample",children:"setData(data, firstSample)"}),"\n",(0,a.jsx)(n.p,{children:"Replace all stored data with the provided matrix (channels \xd7 samples)."}),"\n",(0,a.jsxs)(n.p,{children:["The absolute index of the first column is ",(0,a.jsx)(n.code,{children:"firstSample"}),"."]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"data"})," : ",(0,a.jsx)(n.em,{children:"const Eigen::MatrixXd &"}),"\nChannels \xd7 samples matrix (double precision)."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"firstSample"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nAbsolute sample index of column 0."]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"appenddatadata",children:"appendData(data)"}),"\n",(0,a.jsx)(n.p,{children:"Append new samples to the ring buffer."}),"\n",(0,a.jsx)(n.p,{children:"Oldest samples are dropped when the internal 
1capacity (maxStoredSamples) is exceeded."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"data"})," : ",(0,a.jsx)(n.em,{children:"const Eigen::MatrixXd &"}),"\nChannels \xd7 newSamples matrix."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"cleardata",children:"clearData()"}),"\n",(0,a.jsx)(n.p,{children:"Override the per-channel-type amplitude scale."}),"\n",(0,a.jsx)(n.p,{children:"Key = FIFF channel kind constant (e.g. FIFFV_MEG_CH), value = physical amplitude."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"scaleMap"}),"\nMap from FIFF kind to amplitude max. Clear all stored sample data without affecting channel metadata. After this call totalSamples() == 0 and firstSample() == 0. Emits ",(0,a.jsx)(n.code,{children:"dataChanged()"}),"."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setscalemapscalemap",children:"setScaleMap(scaleMap)"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setscalemapfromstringsscalemap",children:"setScaleMapFromStrings(scaleMap)"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setvirtualchannelsvirtualchannels",children:"setVirtualChannels(virtualChannels)"}),"\n",(0,a.jsx)(n.p,{children:"Set extra browser-level virtual channels appended after the FIFF channels."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"virtualChannels"})," : ",(0,a.jsx)(n.em,{children:"const QVector< ChannelDisplayInfo > &"}),"\nDisplay metadata for each appended virtual channel."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setsignalcolorcolor",children:"setSignalColor(color)"}),"\n",(0,a.jsx)(n.p,{children:"Set the signal line colour for all channels."}),"\n",(0,a.jsx)(n.p,{children:"Individual channel colours are derived from this base colour by type."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"color"})," : ",(0,a.jsx)(n.em,{children:"const QColor &"}),"\nThe base signal colour."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setmaxstoredsamplesn",children:"setMaxStoredSamples(n)"}),"\n",(0,a.jsx)(n.p,{children:"Set the maximum number of samples to keep in the ring buffer."}),"\n",(0,a.jsx)(n.p,{children:"When samples are appended beyond this limit, the oldest are dropped. Set to 0 (default) for unlimited storage."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"n"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nMaximum sample count per channel, or 0 for unlimited."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setchannelbadchannelidx-bad",children:"setChannelBad(channelIdx, bad)"}),"\n",(0,a.jsx)(n.p,{children:"Mark/unmark a channel as bad."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"channelIdx"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nZero-based channel index."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"bad"})," : ",(0,a.jsx)(n.em,{children:"bool"}),"\nTrue to mark bad."]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setremovedcremove",children:"setRemoveDC(remove)"}),"\n",(0,a.jsx)(n.p,{children:"Enable or disable DC (mean) removal applied on-the-fly during rendering."}),"\n",(0,a.jsx)(n.p,{children:"When enabled each channel's mean amplitude over the requested window is subtracted."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"remove"})," : ",(0,a.jsx)(n.em,{children:"bool"}),"\ntrue = subtract mean, false = raw data."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"removedc",children:"removeDC()"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"setdetrendmodemode",children:"setDetrendMode(mode)"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"detrendmode",children:"detrendMode()"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"channelcount",children:"channelCount()"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"firstsample",children:"firstSample()"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"totalsamples",children:"totalSamples()"}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"sfreq",children:"sfreq()"}),"\n",(0,a.jsxs)(n.p,{children:["Sampling frequency in Hz; 0 if no ",(0,a.jsx)(n.a,{href:"/docs/api/fiff/fiff-info",children:"FiffInfo"})," attached."]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"channelinfochannelidx",children:"channelInfo(channelIdx)"}),"\n",(0,a.jsx)(n.p,{children:"Display metadata for the given channel."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"channelIdx"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nZero-based channel index."]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.em,{children:"ChannelDisplayInfo"})," \u2014 ",(0,a.jsx)(n.code,{children:"ChannelDisplayInfo"})," struct with name, colour, amplitudeMax, bad flag."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"channelrmschannelidx-firstsample-lastsample",children:"channelRms(channelIdx, firstSample, lastSample)"}),"\n",(0,a.jsx)(n.p,{children:"Compute the RMS amplitude of a channel over a sample window."}),"\n",(0,a.jsx)(n.p,{children:"Samples outside the buffer are silently ignored. Capped internally at 1000 samples for rendering-thread safety."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"channelIdx"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nZero-based channel index."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"firstSample"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nAbsolute first sample (inclusive)."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"lastSample"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nAbsolute last sample (exclusive)."]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.em,{children:"float"})," \u2014 RMS in raw (physical) units, or 0 if no data is available."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"decimatedverticeschannelidx-firstsample-lastsample-pixelwidth-vbofirstsample",children:"decimatedVertices(channelIdx, firstSample, lastSample, pixelWidth, vboFirstSample)"}),"\n",(0,a.jsx)(n.p,{children:"Return a flat float array ready for VBO upload."}),"\n",(0,a.jsx)(n.p,{children:"The array contains interleaved (x_offset, y_amplitude) pairs."}),"\n",(0,a.jsx)(n.p,{children:"When samplesPerPixel <= 1 (zoomed in), raw samples are returned. When samplesPerPixel > 1 (zoomed out), min/max decimation is applied so that at most 2 * pixelWidth vertices are returned."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"channelIdx"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nZero-based channel index."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"firstSample"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nAbsolute sample index of the first desired sample."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"lastSample"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nAbsolute sample index (exclusive) of the last desired sample."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"pixelWidth"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nDestination viewport width in pixels."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"vboFirstSample"})," : ",(0,a.jsx)(n.em,{children:"int &"}),"\nThe absolute sample index stored at VBO vertex 0 (= firstSample, returned for the UBO uniform)."]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.em,{children:"QVector< float >"})," \u2014 Flat float array: [x0, y0, x1, y1, ...] where x is offset from vboFirstSample."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h3,{id:"samplevalueatchannelidx-sample",children:"sampleValueAt(channelIdx, sample)"}),"\n",(0,a.jsx)(n.p,{children:"Return the raw sample value at a specific absolute sample index for the given channel."}),"\n",(0,a.jsx)(n.p,{children:"Returns 0 if the sample is outside the buffer or channel index is out of range."}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"channelIdx"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nZero-based channel index."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"sample"})," : ",(0,a.jsx)(n.em,{children:"int"}),"\nAbsolute sample index."]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.em,{children:"float"})," \u2014 Sample value in physical units, or 0 if unavailable."]}),"\n"]}),"\n",(0,a.jsx)(n.hr,{}),"\n",(0,a.jsx)(n.h2,{id:"authors-of-this-file",children:"Authors of this file"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["Lorenz Esch <",(0,a.jsx)(n.a,{href:"mailto:[email protected]",children:"[email protected]"}),">"]}),"\n",(0,a.jsxs)(n.li,{children:["Christoph Dinh <",(0,a.jsx)(n.a,{href:"mailto:[email protected]",children:"[email protected]"}),">"]}),"\n"]})]})}function o(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},28453(e,n,l){l.d(n,{R:()=>r,x:()=>d});var s=l(96540);const a={},i=s.createContext(a);function r(e){const n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.