Skip to content

Portable Processing

Portable processing means that one container image, identified by its digest, is meant to run the same processing wherever a job is sent. Every job names its executor: NEMAR’s cluster path, or a workstation runner that NEMAR has registered. The containers are nemar-process, and the code is public at github.com/nemarOrg/nemar-process, so you can run exactly what NEMAR runs and check its results.

  1. Dispatch. NEMAR creates a job for one dataset that names the runner pool as its executor, the container image by its digest, and the recipe to run.
  2. Claim. A runner asks NEMAR for work over Hypertext Transfer Protocol Secure (HTTPS) and claims at most as many jobs as it has free slots. NEMAR never connects to the runner, and the runner opens no port. Each claim holds a lease that the runner renews every minute while the job runs; the same call tells the runner when a job has been canceled.
  3. Run. The runner starts the image by its digest under Apptainer or Docker, in a directory of its own that no other job can see. The job reads public data only.
  4. Outputs. The job uploads its outputs to NEMAR, and the job counts as finished only after NEMAR has checked them.
  5. Scratch deleted. The runner deletes the job’s directory when the job ends, whatever happened, and deletes any leftover directories when it starts again.

A runner job writes no service-unit charge to NEMAR’s compute ledger. Its usage is recorded as runner-reported core-hours, measured by the runner, never as service units. If a runner stops reporting, its unstarted claims return to the queue a limited number of times, and a started job that does not finish in time is marked as lost.

  • Jobs do not yet run on clusters or supercomputers, and the same job is not yet shown to run there without change.
  • Runners do not process private data: runner jobs read public data only.
  • No installable runner bundle and no runtime image are published yet.
  • Podman is not yet supported.
  • Processing does not run EEGLAB, and is not integrated with EEGDash.
  • Outputs are not published, not shown on dataset pages and not citable.
  • Processing has not been run across the whole catalog, and nothing here claims catalog-scale throughput.

Processing on Zarr input, including quality control (QC), runs on NEMAR’s Zarr serving copy, not on the archived recordings. The serving copy is 16-bit, and its sampling rate is capped per modality, with electroencephalography (EEG) capped at 250 Hz. QC results on that input describe the serving copy, and every result names the input it describes. See Zarr and edge access for the serving copy itself.

A workstation runner is a small program that a lab runs on its own machine to take NEMAR jobs.

  • It runs as a dedicated, unprivileged account, and nothing else should run as that account.
  • It needs Python 3.9 or newer, Apptainer or Docker, and outbound HTTPS to NEMAR; it needs no inbound access.
  • Docker must be a rootful daemon, and access to it is equivalent to root on that machine; rootless Docker is not supported, so on a shared machine use Apptainer.
  • The runner checks each image’s signature with cosign by default, and will not start without a cosign it can trust; that check is in nemar-process v0.1.1.
  • NEMAR registers each runner and gives it a secret, shown once, that the runner trades for short-lived access tokens.
  • NEMAR can revoke a runner at any time: its tokens stop working, its unstarted claims return to the queue, and its running jobs can no longer deliver outputs.
  • Each job gets its own directory under the runner’s working directory, and the runner deletes it when the job ends.
  • Runners on NEMAR’s own workstations run NEMAR’s own processing only, not a person’s or a partner’s jobs.

The standard process is built on eegprep, a Python library for EEG preprocessing. It reads a dataset in the Brain Imaging Data Structure (BIDS), or NEMAR’s Zarr serving copy, and runs these stages on each recording:

  1. Import: load the recording and select its signal channels.
  2. Preprocess: remove flat lines, drift and line noise, and mark bad channels and bad time windows.
  3. Independent component analysis (ICA): decompose the cleaned data into components.
  4. ICLabel: classify each component, for example as brain, eye or muscle activity.
  5. Quality: compute quality metrics and write the data behind the quality views.

The process comes as two recipes. nemar-floor runs the import and preprocessing stages and measures each recording. nemar-ica runs the same preparation, then the decomposition, ICLabel and the quality stage. Before its decomposition, nemar-ica applies a high-pass filter, removes line noise with a band-stop filter at 50 or 60 Hz, repairs bursts with artifact subspace reconstruction (ASR) at a cutoff of 30, and leaves out the bad channels. ASR repairs bursts in place and removes no samples; the share of samples it changed is recorded as a metric.

Every signal-processing step is an eegprep function. When a step is missing, it is added to eegprep itself rather than written only for NEMAR, so anyone using eegprep gets it too.

Each run writes a signalJourney record for every recording and for the dataset as a whole. A record names the pipeline and its version, and every step with its software version, parameters, inputs and outputs. Quality metrics are stored in the same record, beside the step that computed them, with headline numbers summarized for the recording and for the dataset. Each data file behind a quality view is an output of the step that wrote it, with its size and digest. Anyone reading the record can see what was done to the data, in what order, and with which settings.

NEMAR indexes what it shows from these records with neuroschema, in its dataQuality extension. A recording’s dataQuality entry holds its metrics and the declarations of its quality views, and a dataset’s entry holds the run’s counts and the distribution over the recordings of each metric it summarizes. Each entry carries the digest of the signalJourney record it came from, so it is never a second source of the same numbers.

Each metric in dataQuality has a value, a unit, a one-sentence description, bounds when it has a valid range, and exactly one producer: the recipe or the plugin that computed it, with its version. Bounds state the range a value can take, never a pass or fail threshold. A metric that a recipe computes has a plain name. A metric that a plugin computes is named <plugin>:<name>, so two producers can never claim one name.

nemar-floor writes these metrics for each recording, and nemar-ica writes them too, as its own, because it runs the same preparation:

Metric Unit What it measures
nChannelsInput count Channels in the recording, of every type.
nSignalChannels count Channels typed EEG, the ones the process assesses.
nGoodChannels count EEG channels judged good.
nNoiseOnlyChannels count EEG channels without coordinates, judged on the noise criterion only.
nNotAssessedChannels count EEG channels no criterion could judge.
percentGoodChannels % Share of the EEG channels judged good.
percentGoodSamples % Share of the samples outside the bad windows.
durationS s Duration of the samples read.
samplingRateHz Hz Sampling rate of the samples read.
lineNoiseBeforeDb dB Line-noise excess before the band-stop filters, at whichever of 50 and 60 Hz had the larger excess.
lineNoiseAfterDb dB Line-noise excess after the band-stop filters, at the same frequency.

nemar-ica adds these:

Metric Unit What it measures
icaRank count Rank of the decomposition: one less than the good channels, for the average reference.
icaIterations count Iterations the decomposition ran.
asrBurstFraction fraction, 0 to 1 Share of the samples that ASR repaired.
nemar-quality:percentBrainComponents % Share of components whose most probable ICLabel class is Brain, from the nemar-quality plugin.
nemar-quality:mutualInformationReduction nat Mutual information reduction (MIR) of the decomposition, from the nemar-quality plugin.

The MIR is the mutual information that the components’ weights remove from the sphered data, computed by eegprep’s eeg_mir with each entropy estimated over 256 fixed bins. It is 0 for weights that change nothing, larger when the decomposition removes more dependence from the sphered data, and below 0 when the weights add dependence. It rates only what the unmixing weights add beyond sphering, so it is not comparable with the MIR of Delorme et al. (2012), which includes the reduction that sphering makes and is reported in other units. When the MIR cannot be computed for a recording’s decomposition, it has no value and the reason is recorded.

A dataset’s summary gives, for each metric it summarizes, the number of recordings with a value, the minimum, median and maximum, and a histogram with fixed bins. For nemar-floor these are percentGoodChannels, percentGoodSamples, lineNoiseBeforeDb and lineNoiseAfterDb; for nemar-ica they are icaRank, icaIterations, asrBurstFraction, percentGoodChannels, percentGoodSamples, lineNoiseBeforeDb, nemar-quality:percentBrainComponents and nemar-quality:mutualInformationReduction. The summary also counts the recordings that passed, failed and were skipped, and lists those that were not processed, with the reason.

NEMAR stores no figure image, and no NEMAR code draws one. A quality run writes the data behind each view, small tables of numbers, and a declaration that says what the view is and how to draw it. Your browser draws the view from that data. A drawing can follow the page’s theme, be read by a screen reader, be checked against the numbers it shows, and be redrawn everywhere at once when a drawing is fixed; a stored image can do none of these.

A view declaration names its kind and the kind’s version, a caption, its source (the recipe or plugin that wrote it, with its version), and its parameters. It then lists either its data files, each with its size and its Secure Hash Algorithm 256 (SHA-256) digest, or the inputs and the named transform it is computed from, or both. The vocabulary of views is part of neuroschema: general kinds (a table, lines, a heat map, a histogram and a scalp map), and specific kinds built on them (a spectrum, component maps, component classes, component activations and a signal window). A browser that does not know a view’s kind draws it with the general kind it is built on, and otherwise shows its data as a table you can download, so a new kind is never an error.

  • The recording’s quality record is checked against the digest that comes with it before it is read.
  • Each view’s declaration is checked against the digest NEMAR published for it, the SHA-256 of its canonical JavaScript Object Notation (JSON) text, as Request for Comments (RFC) 8785 defines it.
  • Each file’s size is checked before it is fetched, and its SHA-256 before it is read.

A failed check draws nothing of what it covers and says why. These checks catch damage in storage, in a cache or on the way to you. They do not prove that the data are authentic, because NEMAR serves both the files and their digests, so the page says only that a file matches the digest NEMAR recorded.

A dataset page gets two quality tabs, beside Demographics, once an administrator promotes a quality result for a public dataset. A dataset with no promoted result shows neither tab.

  • Data quality is the dataset’s summary, drawn on the server: the counts of recordings, the recordings that were not processed and why, and for each summarized metric its values, median, observed range and histogram, each histogram with a data table.
  • Recording quality shows the views of one recording, picked from the dataset’s recordings, in these tabs:
    • Spectrum: the power spectrum of each good channel, by Welch’s method with two-second Hamming windows at 50% overlap, in decibels relative to 1 µV²/Hz, up to 125 Hz or the recording’s Nyquist frequency when that is lower, with scalp maps at 6, 10 and 22 Hz and at the line frequency.
    • Components: a scalp map of each independent component with its share of the variance and its ICLabel probabilities, each with a text row, and a histogram of ICLabel classes, labeled as the summed variance of the components in each class. The components are not orthogonal, so a bar does not say how much variance a class explains.
    • Activations: the components’ time courses over a window you choose, computed in your browser from the serving copy and the stored weights, and labeled as computed. The browser applies the decomposition’s weights to the serving copy’s channels in one step and does not repeat the high-pass filter, line-noise removal or ASR, so activations approximate what was decomposed, and the caption says so. A 1 Hz high-pass filter is applied for display only. Bad segments are shaded, and activations carry no physical unit. A decomposition that read the archived recordings rather than the serving copy says so in its caption.
    • Signal: opens the dataset page’s signal viewer on the two seconds of good data nearest the middle of the recording, with bad channels marked and bad segments shaded.
    • Other views: any other view the record declares.

Each view has a link of its own, #quality/<recording>/<view> on the dataset page, which opens the tab on that view. Colors are colorblind-safe diverging and sequential maps, with a turbo map as an option. Every view is a captioned figure with a text description built from its numbers and a data-table toggle. A number shown on screen is always a stored value: a hover snaps to a stored row, and a scalp map’s readout is the sensor’s own value, never an interpolated one.

A run lists every view it did not write for a recording, with the reason, so no view goes missing silently.

Every scalp map on NEMAR, in the quality views and in the signal viewer, uses one algorithm: EEGLAB’s map, a biharmonic spline interpolation on a 67-by-67 grid, tested against eegprep’s topoplot as the reference implementation. A map needs at least 8 sensors and is not drawn from fewer. No coordinate frame is ever assumed, and a map whose sensors cannot be placed with confidence is not drawn: its reason is shown in its place.

Where the sensors go is decided in this order.

  1. Measured positions in a known frame are used as they are. When the dataset’s own electrodes file gives positions in a BIDS coordinate system that NEMAR knows, those positions are used, and the map says they are measured. NEMAR does not verify measured positions; they are the dataset’s own. Only sensors typed EEG are drawn. Positions in a coordinate system for intracranial recordings draw no scalp map at all, neither from the positions nor from the names.
  2. Otherwise, names are matched to a standard montage. When a recording has no positions, or its positions are in an undeclared or unknown frame, too flat, or cover too little of the head, its channel names are matched to a standard montage. The map then says that its positions were inferred, and why any measured ones were not used. Names are compared with case folded and a modality prefix or reference suffix removed (as in EEG Fp1-REF), and the old and new names of one site count as the same electrode (T3 and T7, T4 and T8, T5 and P7, T6 and P8). The montages are the 10-05 system, BioSemi caps and Electrical Geodesics, Inc. (EGI) HydroCel nets, each with its source and license recorded. A montage is accepted when at least 8 channel names match it and they are at least 80% of the channels that could be EEG electrodes.
  3. Some recordings get no map, with a stated reason. The reasons include fewer than 8 channels that could be EEG electrodes, names that pair two electrodes (such as Fp1-F7), names that match no standard montage, too small a share of names matched, two channels naming one electrode, names that fit two montages that place the electrodes differently, and names that match less than 90% of the electrodes of the EGI net or BioSemi cap they point to.

The EGI case. EGI nets number their electrodes, and older EGI nets put the same numbers in other places, so the names alone never decide which net a recording used. A recording is placed on a HydroCel net by name only when its BIDS CapManufacturersModelName names that net. NEMAR’s serving copy does not yet carry that field, so an EGI recording without usable measured positions currently gets no map, with the reason that its cap model does not name the net its channel names point to. This is a known limitation, and carrying the cap model into the serving copy is tracked for a fix.

Exports are made only when you ask for one, from a view’s Export control:

  • Image: a Portable Network Graphics (PNG) file at two, three or four times screen size, in a light palette for print.
  • Drawing: a Scalable Vector Graphics (SVG) file, for the spectrum and the class histogram.
  • Files: each data file of the view, as its exact bytes, checked against its recorded size and SHA-256.

Each image and drawing embeds the view’s digest, its kind and kind version, and a permalink to the view on nemar.org. An activation view exports the window you drew as a PNG, with the window’s start and length, and its input files, each checked against its digest.

Public. On a public dataset, anyone can read the dataset’s quality summary and the quality views of its recordings, and export them. Public pages show only results an administrator has promoted, and of those the newest, with a note naming the dataset version it was computed on. When a dataset is unpublished or withdrawn, its recordings’ quality views stop being served within five minutes. The summary in the Data quality tab is part of the dataset page itself, so it follows that page’s cache and is not covered by this bound. For each recording with a promoted result, the data plane also answers GET /<id>/quality/v1/<recipe>/processing/<recording>: the recording’s outcome at each checkpoint of the run and, for a recording that succeeded, a link to its signalJourney record with the record’s SHA-256. A recording that failed or was skipped has no record, and its link says it failed. The plugin interface, the view vocabulary and the processing code are public, so anyone can check what was computed.

Private datasets. Today only NEMAR’s administrators can open a private dataset’s quality results. Opening them as anyone who can already read the dataset is planned and not built. Activations need the public serving copy, so a private dataset has none in the browser.

Admin-only. These are for NEMAR’s administrators only, on the Pipelines page of the website’s admin area: the live progress of each run, by checkpoint (import, preprocess, ICA, ICLabel, quality and stored); the failed files of a run, with their failure codes; a run that has stopped reporting, shown as stalled; the coverage of each recipe across the catalog; and results that have not been promoted. Administrators can open a run’s stored views from the run’s own page before it is promoted; views computed in the browser, such as activations, are drawn only on the dataset page once the run is promoted.

A plugin is a small Python module with a public interface, described in the plugin interface on nemar-process’s development branch. It declares its name, version, what it reads, its parameters, and the metrics and views it returns.

  • It returns numbers and arrays, never a file or a drawing.
  • The runner checks every array against the view it belongs to, its dimensions against the recording, and its size against fixed caps, then writes it as a data file and records it in signalJourney.
  • A plugin whose output fails a check is skipped, and the rest of the recording is kept.
  • It never writes signal data.

The first two plugins run in nemar-ica: nemar-quality reports nemar-quality:percentBrainComponents and, since its version 0.2.0, the MIR, and writes the ICLabel class histogram, and nemar-spectrum writes the power spectrum. nemar-ica declares its own views: the component maps, the activations and the signal window.

Anyone can write a plugin and run it on their own. Write it against the public interface and run it with nemar-process on your own computer, on any dataset you can read.

The plugins shown on NEMAR are reviewed and added by NEMAR. The metrics and views NEMAR shows for a dataset come only from plugins that have been reviewed and merged into nemar-process, each pinned to a version. NEMAR never shows results from a plugin it has not reviewed. To propose a plugin for NEMAR, open a pull request on the nemar-process repository.

You will be able to package your own analysis the same way: in a nemar-process container, or one built from it, with its stages declared and its results written to signalJourney. Packaged like this, it runs on your own computer, where it writes progress and results reports locally, and, once NEMAR compute is open, it can run through NEMAR compute with the same progress and results reports shown to you. The interfaces this relies on are public, and a change to any of them gets a new version.

As of 2026-11-27, no processing job has run on the production system, and running jobs on workstation runners is switched off in production and on NEMAR’s staging system.

  • Workstation runners and their job queue are built and tested end to end against NEMAR’s own server code on a local test system. That server code is released, and its runner routes answer that runners are disabled.
  • The runner program in nemar-process is public, and its code is in the v0.1.1 release; no installable runner bundle and no runtime image are published yet.
  • Jobs on the San Diego Supercomputer Center’s supercomputers wait for NEMAR’s tenant on Tapis, the job platform; see where compute stands.
  • A runner that hands jobs to a cluster’s own batch queue is designed and not built.
  • Live progress, quality metrics and quality views are released. NEMAR’s server serves the quality views and each recording’s checkpoint outcomes, dataset pages have the Data quality and Recording quality tabs, and administrators have the Pipelines page. The tabs appear only on a dataset with a promoted quality result, and because compute is switched off, no dataset has one yet.
  • The first two plugins and the recipes that run them are on nemar-process’s development branch and not yet in a nemar-process release.
  • nemar-ica is not yet dispatched on any dataset, so no quality views exist for a real dataset, and none will show on a public page until compute runs it and an administrator promotes the run.
  • Activations are drawn with a caption saying that the serving copy was not checked, because the serving copy does not yet publish the content digest that ties it to the decomposition’s record.
  • The signal viewer’s scalp map uses the placement rules above, released with the quality views.
  • EGI recordings placed by name get no scalp map until the serving copy carries the cap model, as described above.
  • Further metrics, such as signal-to-noise measures, are planned and not built.