# MNE We are interested in having a conversation with you about how you think about your data and visualization. Would you be up for at least a quick meeting to learn about your work and to present what we have been working on? ### intro ### questions from Dan & Eric ### understanding MNE's needs 1) How did you go about implementing your visualization API? What design decisions were involved? Was it organic, planned, based on a different API? * acretion, started off small, grew as needs grew, CZI tasked w/ unification-unified maybe 10 percent of API * interactive continous data browsing windows all work together and share underlying class representation * figure inherited from mpl figure (MNEBrowse) * attach to it a parameter container - * issues with many different scale of data, need to rescale everything * 30ish configuration parameters that users want to dynamically change while browsing * just data processing knobs or also visual econding? * no color data, no linestyle, * centralizing all the methods and configuration in the Figure subclass * accounts for coupled plots (other figures / axes), callback book keeping * figures for drilling down * figures check-boxes to configure the system * all the other 2D plots are functions that build on mpl api * 3D is mostly all pyvista * new functions developed-try to take inspiration from existing and try to keep unified, design decsions made too quickly and things get out of sync * ideas - see it in other software, see what in mpl can be used to make it -ad hoc use cases 2) how do you keep track of the linked data - eg. ERP and electrode, brain cross-sections, etc? * data is in MNE container object that is basically an array, lines are line2D, keep track of which indices into the data array need to be displayed at anytime, which channel indices are we showing, what is the first and last sample index, assign that data to each x/y value of a line2D * can also assign full array to line collection, * internally do computations to evenly space the lines in display - happens in the figure containers, private methods to do this layouting, recompute the scalings , remove channels, etc 1) How is preprocessing handled? are all your computations in the matplotlib API pre-visualization? * filtering & subspace are the only interactive visualizions (they can pass in filtering functions) - method on the figure objects: * projectors - compute a matrix operator & then multiply and then update -, have to apply linear projections to all channels even if visualuzing subset * apply filter * sometimes those methods will use other parts of the codebase * 100,000+ point timeseries 4) how are they optimized? * if data are sampled at 1000HZ, will decimate the data down to every 5th point or so, as appropriate * trimming to the view range 3) What is your process for adding to or amending that API? eg. the time-frequency work in your proposed roadmap https://github.com/mne-tools/mne-python/pull/9388 5) What are the pain points? * continuous data browsers problem is updating speed * folks like overplotting all 300 channels * LineCollection hampers clipping, which is done when lines bleed into each other * blitting kind of helped, but was limited 'cause tick labels need to be frequently updated 7) If you could redesign the API, what would you do differently? What features in Matplotlib would help? ### matplotlib proposed rearchitecture * high level - functional topological model * using fiber bundles to encode data * * functional approach - MNE currently making choice of artist / topology by picking the right method. - proposing a standard way of pulling the data down into a data model - have maps from data space -> visual space - has a way to map back from screen -> data to get ### potential project (w/) * EOSS 4: time-frequency based, epochs by channels by time by frequency, keeping track of multiple spectral estimates from tapers, scaleograms, corresponding classes in brain & sensor space<- will have visualization methods ### debrief * contract programming - seperation of scales * line2d has internal state of data that is shared * all artist takes consistent data thing that describes * continuity * types * this propogates such that the arists can all take in the data #### story * what - this is the problem we're solving: data + visual in formally correct * why - vectorization, optimization, and single point of update * how - formal methods/walk through #### proof of concept * line spacing Artist * fast text updating