Module: source_localization

EEG source localization algorithms and related nodes.

These are domain-specific nodes that are designed to solve the inverse problem of estimating the source activity given some EEG (or MEG) observations. Also includes some nodes that act on the resulting solutions (for instance, operate on regions of interest). This category also includes some nodes for managing location information.

AssignChannelLocations

Assign standard channel locations from a pre-defined sensor montage file.

For some devices (such as EEG headsets), specific channel labels correspond to well-known sensor locations, for example "Cz" in EEG is the sensor on the top of the head in the 10-20 labeling system. For each device, there may also be multiple alternative labeling systems (e.g., C3 for the 10-20 system would be in a different place than C3 in the BioSemi system). This node can open a specified montage file and look up the channel locations based on the channel labels in the data (assuming that at least the labels are set in the data), and if no montage file is given, this node can search through all known montages and find the file that best matches the data (in the sense that more of the channel labels in the data are found in the file than in other files). If there is significant ambiguity (e.g., multiple similarly well matching files), a warning will be emitted. Note that the montage to use can also be specified upstream in the SpaceAxis.montage property, which this node will use if montage_type is set to 'auto'. Order of priority for selecting a montage is as follows: montage property > montage_type property (if not 'auto') > SpaceAxis.montage property > auto detect. This node will also set the SpaceAxis.montage property to the montage used, for use by other downstream nodes such as InterpolateMissingChannels.

Version 1.2.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • montage_type
    Choose the montage to use from among a list of common options. If set to auto, the best-matching montage will be used.

    • verbose name: Montage Type
    • default value: auto
    • port type: EnumPort
    • value type: str (can be None)
  • montage
    Optionally a montage file (.l ocs format) to use. This may be a montage file that ships with Neuropype (available in resources/montages), in which case only the filename is needed, or the full path to a montage located elsewhere. If specified, this will take precedence over the montage type field.

    • verbose name: Montage File
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • force_override
    Force-override any existing channel locations.

    • verbose name: Force Override
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

ComputeRegions

A meta-node that performs source localization for given regions of interest using sLoreta, and optionally groups them based on a given mapping.

Uses the following nodes: SLORETA, Magnitude, ROIActivations, CombineChannels.

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process. Outputs source localised data per ROI without magnitude.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • data_magnitude
    Output only. Data per ROI with magnitude performed.

    • verbose name: Data Magnitude
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • data_vertex
    Output only. Source localisation per vertex, without ROI averaging.

    • verbose name: Data Vertex
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • headmodel
    Head model file to use (*.h m). If omitted, the node checks if the data has a current head model associated with it, e.g., because a previous node has annotated it, and then uses that head model. If a relative path is given, the file is searched in the resources/headmodels folder.

    • verbose name: Headmodel
    • default value: Colin-339ch-4495v-scalar-4shell-1.1.hm
    • port type: StringPort
    • value type: str (can be None)
  • regularization_strength
    Regularization strength. Larger values yield smoother solutions. In theory this is proportional to the sensor noise level. Ad-hoc choices work fairly well for visualization and basic source localization.

    • verbose name: Regularization Strength
    • default value: 0.05
    • port type: FloatPort
    • value type: float (can be None)
  • interpolate
    Rely on channel locations rather than labels. If this is enabled, the head model will be matched to the data using the channel locations rather than channel labels. This is only useful if the labels are unrecognized (e.g., non-standard labels), and if there are high-quality measured channel locations available. These locations must be in the same coordinate system as NeuroPype's default 10-5 locations (see node documentation for more details).

    • verbose name: Interpolate
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • atlas
    Optionally the name of the atlas to use. If the head model file contains multiple atlases in it, this allows to select the one to use.

    • verbose name: Atlas
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • roi_subset
    Subset of ROIs for which to calculate activations, optional. Setting this to non-empty will restrict the set of regions for which activations are calculated, for a modest performance gain.

    • verbose name: Roi Subset
    • default value: ['rostralanteriorcingulate L.1', 'rostralanteriorcingulate L.2', 'rostralanteriorcingulate R.1', 'rostralanteriorcingulate R.2', 'rostralanteriorcingulate R.3', 'caudalanteriorcingulate L.1', 'caudalanteriorcingulate L.2', 'caudalanteriorcingulate R.1', 'caudalanteriorcingulate R.2', 'rostralmiddlefrontal L.1', 'rostralmiddlefrontal L.2', 'rostralmiddlefrontal L.3', 'rostralmiddlefrontal L.4', 'rostralmiddlefrontal L.5', 'rostralmiddlefrontal L.6', 'rostralmiddlefrontal L.7', 'rostralmiddlefrontal L.8', 'rostralmiddlefrontal L.9', 'rostralmiddlefrontal L.10', 'rostralmiddlefrontal L.11', 'rostralmiddlefrontal L.12', 'rostralmiddlefrontal L.13', 'rostralmiddlefrontal L.14', 'rostralmiddlefrontal L.15', 'rostralmiddlefrontal L.16', 'rostralmiddlefrontal R.1', 'rostralmiddlefrontal R.2', 'rostralmiddlefrontal R.3', 'rostralmiddlefrontal R.4', 'rostralmiddlefrontal R.5', 'rostralmiddlefrontal R.6', 'rostralmiddlefrontal R.7', 'rostralmiddlefrontal R.8', 'rostralmiddlefrontal R.9', 'rostralmiddlefrontal R.10', 'rostralmiddlefrontal R.11', 'rostralmiddlefrontal R.12', 'rostralmiddlefrontal R.13', 'rostralmiddlefrontal R.14', 'rostralmiddlefrontal R.15', 'lateralorbitofrontal L.1', 'lateralorbitofrontal L.2', 'lateralorbitofrontal L.3', 'lateralorbitofrontal L.4', 'lateralorbitofrontal L.5', 'lateralorbitofrontal L.6', 'lateralorbitofrontal L.7', 'lateralorbitofrontal R.1', 'lateralorbitofrontal R.2', 'lateralorbitofrontal R.3', 'lateralorbitofrontal R.4', 'lateralorbitofrontal R.5', 'lateralorbitofrontal R.6', 'lateralorbitofrontal R.7', 'medialorbitofrontal L.1', 'medialorbitofrontal L.2', 'medialorbitofrontal L.3', 'medialorbitofrontal L.4', 'medialorbitofrontal L.5', 'medialorbitofrontal R.1', 'medialorbitofrontal R.2', 'medialorbitofrontal R.3', 'medialorbitofrontal R.4', 'medialorbitofrontal R.5', 'lateraloccipital L.1', 'lateraloccipital L.2', 'lateraloccipital L.3', 'lateraloccipital L.4', 'lateraloccipital L.5', 'lateraloccipital L.6', 'lateraloccipital L.7', 'lateraloccipital L.8', 'lateraloccipital L.9', 'lateraloccipital L.10', 'lateraloccipital L.11', 'lateraloccipital L.12', 'lateraloccipital L.13', 'lateraloccipital R.1', 'lateraloccipital R.2', 'lateraloccipital R.3', 'lateraloccipital R.4', 'lateraloccipital R.5', 'lateraloccipital R.6', 'lateraloccipital R.7', 'lateraloccipital R.8', 'lateraloccipital R.9', 'lateraloccipital R.10', 'precentral L.1', 'precentral L.2', 'precentral L.3', 'precentral L.4', 'precentral L.5', 'precentral L.6', 'precentral L.7', 'precentral L.8', 'precentral L.9', 'precentral L.10', 'precentral L.11', 'precentral L.12', 'precentral R.1', 'precentral R.2', 'precentral R.3', 'precentral R.4', 'precentral R.5', 'precentral R.6', 'precentral R.7', 'precentral R.8', 'precentral R.9', 'precentral R.10', 'precentral R.11', 'precentral R.12', 'inferiorparietal L.1', 'inferiorparietal L.2', 'inferiorparietal L.3', 'inferiorparietal L.4', 'inferiorparietal L.5', 'inferiorparietal L.6', 'inferiorparietal L.7', 'inferiorparietal L.9', 'inferiorparietal L.10', 'inferiorparietal L.11', 'inferiorparietal L.12', 'inferiorparietal L.13', 'inferiorparietal L.14', 'inferiorparietal R.1', 'inferiorparietal R.2', 'inferiorparietal R.3', 'inferiorparietal R.4', 'inferiorparietal R.5', 'inferiorparietal R.6', 'inferiorparietal R.7', 'inferiorparietal R.8', 'inferiorparietal R.9', 'inferiorparietal R.10', 'inferiorparietal R.11', 'inferiorparietal R.12', 'inferiorparietal R.13', 'inferiorparietal R.14', 'inferiorparietal R.15']
    • port type: ListPort
    • value type: list (can be None)
  • roi_mapping
    Grouping of old channels into new channels. The syntax is {'new_channel1': [index0, index1, ...], 'new_channel2': [index3, index4, index5, ...], ...} where 'new_channelX' are examples of two new channel names being defined, and the indexX terms stand for where you list the old channels from which each new channel would be formed, given as numeric indices (counting from 0). Example: {'mychan': [0,1,2], 'myotherchan': [3,4,5,10]}.

    • verbose name: Channel Grouping
    • default value: {'ORB_PF_L': ['lateralorbitofrontal L.1', 'lateralorbitofrontal L.2', 'lateralorbitofrontal L.3', 'lateralorbitofrontal L.4', 'lateralorbitofrontal L.5', 'lateralorbitofrontal L.6', 'lateralorbitofrontal L.7', 'medialorbitofrontal L.1', 'medialorbitofrontal L.2', 'medialorbitofrontal L.3', 'medialorbitofrontal L.4', 'medialorbitofrontal L.5'], 'PRE_CENT_L': ['precentral L.1', 'precentral L.2', 'precentral L.3', 'precentral L.4', 'precentral L.5', 'precentral L.6', 'precentral L.7', 'precentral L.8', 'precentral L.9', 'precentral L.10', 'precentral L.11', 'precentral L.12'], 'ANT_CIN_R': ['rostralanteriorcingulate R.1', 'rostralanteriorcingulate R.2', 'rostralanteriorcingulate R.3', 'caudalanteriorcingulate R.1', 'caudalanteriorcingulate R.2'], 'DORLAT_PF_L': ['rostralmiddlefrontal L.1', 'rostralmiddlefrontal L.2', 'rostralmiddlefrontal L.3', 'rostralmiddlefrontal L.4', 'rostralmiddlefrontal L.5', 'rostralmiddlefrontal L.6', 'rostralmiddlefrontal L.7', 'rostralmiddlefrontal L.8', 'rostralmiddlefrontal L.9', 'rostralmiddlefrontal L.10', 'rostralmiddlefrontal L.11', 'rostralmiddlefrontal L.12', 'rostralmiddlefrontal L.13', 'rostralmiddlefrontal L.14', 'rostralmiddlefrontal L.15', 'rostralmiddlefrontal L.16'], 'INF_PAR_R': ['inferiorparietal R.1', 'inferiorparietal R.2', 'inferiorparietal R.3', 'inferiorparietal R.4', 'inferiorparietal R.5', 'inferiorparietal R.6', 'inferiorparietal R.7', 'inferiorparietal R.8', 'inferiorparietal R.9', 'inferiorparietal R.10', 'inferiorparietal R.11', 'inferiorparietal R.12', 'inferiorparietal R.13', 'inferiorparietal R.14', 'inferiorparietal R.15'], 'DORLAT_PF_R': ['rostralmiddlefrontal R.1', 'rostralmiddlefrontal R.2', 'rostralmiddlefrontal R.3', 'rostralmiddlefrontal R.4', 'rostralmiddlefrontal R.5', 'rostralmiddlefrontal R.6', 'rostralmiddlefrontal R.7', 'rostralmiddlefrontal R.8', 'rostralmiddlefrontal R.9', 'rostralmiddlefrontal R.10', 'rostralmiddlefrontal R.11', 'rostralmiddlefrontal R.12', 'rostralmiddlefrontal R.13', 'rostralmiddlefrontal R.14', 'rostralmiddlefrontal R.15'], 'ORB_PF_R': ['lateralorbitofrontal R.1', 'lateralorbitofrontal R.2', 'lateralorbitofrontal R.3', 'lateralorbitofrontal R.4', 'lateralorbitofrontal R.5', 'lateralorbitofrontal R.6', 'lateralorbitofrontal R.7', 'medialorbitofrontal R.1', 'medialorbitofrontal R.2', 'medialorbitofrontal R.3', 'medialorbitofrontal R.4', 'medialorbitofrontal R.5'], 'LAT_OCP_R': ['lateraloccipital R.1', 'lateraloccipital R.2', 'lateraloccipital R.3', 'lateraloccipital R.4', 'lateraloccipital R.5', 'lateraloccipital R.6', 'lateraloccipital R.7', 'lateraloccipital R.8', 'lateraloccipital R.9', 'lateraloccipital R.10'], 'ANT_CIN_L': ['rostralanteriorcingulate L.1', 'rostralanteriorcingulate L.2', 'caudalanteriorcingulate L.1', 'caudalanteriorcingulate L.2'], 'INF_PAR_L': ['inferiorparietal L.1', 'inferiorparietal L.2', 'inferiorparietal L.3', 'inferiorparietal L.4', 'inferiorparietal L.5', 'inferiorparietal L.6', 'inferiorparietal L.7', 'inferiorparietal L.9', 'inferiorparietal L.10', 'inferiorparietal L.11', 'inferiorparietal L.12', 'inferiorparietal L.13', 'inferiorparietal L.14'], 'PRE_CENT_R': ['precentral R.1', 'precentral R.2', 'precentral R.3', 'precentral R.4', 'precentral R.5', 'precentral R.6', 'precentral R.7', 'precentral R.8', 'precentral R.9', 'precentral R.10', 'precentral R.11', 'precentral R.12'], 'LAT_OCP_L': ['lateraloccipital L.1', 'lateraloccipital L.2', 'lateraloccipital L.3', 'lateraloccipital L.4', 'lateraloccipital L.5', 'lateraloccipital L.6', 'lateraloccipital L.7', 'lateraloccipital L.8', 'lateraloccipital L.9', 'lateraloccipital L.10', 'lateraloccipital L.11', 'lateraloccipital L.12', 'lateraloccipital L.13']}
    • port type: Port
    • value type: object (can be None)
  • write_back_mode
    Define how new channels get written back into the list of channels. Replace-selected means that the selected old channels will be replaced by the new channels, replace-all means that only the new channels will be in the output, and append means that the new channels will be appended at the end.

    • verbose name: Write Back Mode
    • default value: replace-selected
    • port type: EnumPort
    • value type: str (can be None)
  • ignore_nans
    If activated the channels containing nan values are ignored.

    • verbose name: Ignore Nans
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • magnitude
    Perform a Magnitude operation (abs value) after sLoreta.

    • verbose name: Magnitude
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

CoregisterExistingLocations

Co-register the locations in the given data with the NeuroPype internal coordinate system.

Currently the only method supported is based on landmark locations; for this your data must have, or you must specify, a set of named landmarks and their 3d positions in the same (arbitrary) coordinate system of your data. Note that if you have standard channel names for your data, then you don't need to use this node, since you can just look up the canonical locations by name -- use the AssignChannelLocations node. Therefore, this node is mostly useful if you don't have standard locations, or (more rarely) you have per-session digitized locations, and you also have landmarks in the same system that you trust to be measured well enough that you can rely on least-squares co-registration. This node can open a specified montage file (which is expected to have landmark positions in a well-defined canonical coordinate system with the same center as the 10-20 system), or it can search the .locs files that come with Neuropype to find your landmark labels in them (this will work if your landmarks have standard names, such as Nz, Iz, Cz, LPA, and RPA).

Version 0.5.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • montage
    Optionally the montage filename to use. If not given, the best-matching one will be searched (see node description for more information).

    • verbose name: Montage File (Optional)
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • landmarks
    Known landmark locations (optional). This is formatted as a Python dictionary from landmark names to 3d coordinates, e.g., {'Nz': [0.1,0.2,-0.5], 'Iz': [0.2,-0.33,0.5], 'Cz': [0,0,0.6]}, where the names must follow standard naming (e.g. Nz, Iz, LPA, RPA, Cz), and the locations must be in the same coordinate system as the input data, which can be arbitrary. Note that you need at least 3 landmarks for successful coregistration, but more (e.g., 5) will reduce the error. If not given, the data must have a 'landmarks' field in the properties, which is expected to be a dictionary that is formatted the same as this dictionary.

    • verbose name: Landmarks
    • default value: None
    • port type: DictPort
    • value type: dict (can be None)
  • stream_names
    List of streams to update locations on. Leave empty to attempt on all signal streams. (Marker streams are ignored.)

    • verbose name: Stream Names
    • default value: []
    • port type: ListPort
    • value type: list (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

ELORETA

Estimate brain source activity using the Exact Low-Resolution Brain Electromagnetic Tomography (eLORETA) algorithm.

This node accepts an EEG time series, and estimates for each time point the current source density (CSD) for a large number of locations (e.g., a few 1000) in the brain. The result is a time series with the EEG channels replaced by as many channels as there are source locations, and otherwise the same format as the input data. The set of source locations is defined by a headmodel, which is selectable via the headmodel_file parameter. Like sLORETA, this is a rather easy-to-use and very fast source estimation method. Important: the input data to this node should previously have been re-referenced to common average reference using the ReReferencing node (with default settings). Note: by default, the headmodel will be matched to EEG channel space using the EEG channel names, which are then assumed to be in the 10-20 (or the finer-grained 10-5) system. If your EEG channels do not use this label system, you need to know the locations of your channels relative to the 10-20 locations (which can be found in the resources/montages/standard-10-5-* file), and using that, you can either try to replace the channel labels by the closest 10-5 equivalent labels, or, likely better, select the interpolate option in this node to directly interpolate the head model for your given channel locations.

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • headmodel
    Head model file to use (*.h m). If omitted, the node checks if the data has a current head model associated with it, e.g., because a previous node has annotated it, and then uses that head model. If a relative path is given, the file is searched in the resources/headmodels folder of the cpe.

    • verbose name: Head Model File
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • regu
    Regularization strength. Larger values yield smoother solutions. In theory this is proportional to the sensor noise level. Ad-hoc choices work fairly well for visualization and basic source localization.

    • verbose name: Regularization Strength
    • default value: 0.05
    • port type: FloatPort
    • value type: float (can be None)
  • interpolate
    Rely on channel locations rather than labels. If this is enabled, the head model will be matched to the data using the channel locations rather than channel labels. This is only useful if the labels are unrecognized (e.g., non-standard labels), and if there are high-quality measured channel locations available. These locations must be in the same coordinate system as NeuroPype's default 10-5 locations (see node documentation for more details).

    • verbose name: Interpolate Using Channel Locations
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • max_iter
    Maximum number of iterations.

    • verbose name: Max Iterations
    • default value: 20
    • port type: IntPort
    • value type: int (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

LCMVBeamforming

Estimate brain source activity using the linearly-constrained minimum variance (LCMV) beamforming algorithm.

This node accepts an EEG time series and estimates for each time point the current source density (CSD) for a large number of locations (e.g., several thousand) in the brain. The result is a time series with the EEG channels replaced by as many channels as there are source locations, and otherwise the same format as the input data. The set of source locations is defined by a headmodel, which can be set via the headmodel_file parameter (several generic headmodels are provided with Neuropype, or you can specify any other, such as a subject-specific one). Note that by default the headmodel will be matched to EEG channel space using the EEG channel names, which are then assumed to be in the 10-20 (or the finer-grained 10-5) system. If your EEG channels do not use this label system, you need to know the locations of your channels relative to the 10-20 locations (which can be found in the resources/montages/standard-10-5-* file), and using that, you can either try to replace the channel labels by the closest 10-5 equivalent labels, or, likely better, select the interpolate option in this node to directly interpolate the head model for your given channel locations. Note that, as with other source estimation nodes, the input EEG should have been re-referenced to common average reference, which can be achieved using the ReReferencing node with default settings. Lastly, to use LCMV beamforming, it is also necessary to provide as the secondary input a running estimate of the data covariance matrix. That covariance can be estimated in principle using a variety of techniques (and thus combinations of nodes); one setup is to use the per-element covariance matrix node on the re-referenced EEG, and smooth the result using either the moving average or exponential moving average nodes. Also, since this node uses the average covariance over the data segment, when processing "offline" (non-streaming) data it is recommended to first segment the data (i.e., using ShiftedWindows or Segmentation) prior to this node.

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • covariance
    Data covariance.

    • verbose name: Covariance
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • headmodel
    Head model file to use (*.h m). If omitted, the node checks if the data has a current head model associated with it, e.g., because a previous node has annotated it, and then uses that head model. If a relative path is given, the file is searched in the resources/headmodels folder of the cpe.

    • verbose name: Head Model File
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • shrinkage
    Shrinkage regularization strength. This can improve numeric conditioning, especially when the data covariance matrix used was estimated from a very short time window and/or over many channels (e.g., >64). Ad-hoc choices work fairly well.

    • verbose name: Regularization Strength
    • default value: 0.001
    • port type: FloatPort
    • value type: float (can be None)
  • rescale_activations
    Rescale estimated brain source activations to correct scale. This can be disabled if the scale does not affect subsequent processing (e.g., because of data normalization) and can yield a modest performance improvement.

    • verbose name: Rescale Activations
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • interpolate
    Rely on channel locations rather than labels. If this is enabled, the head model will be matched to the data using the channel locations rather than channel labels. This is only useful if the labels are unrecognized (e.g., non-standard labels), and if there are high-quality measured channel locations available. These locations must be in the same coordinate system as NeuroPype's default 10-5 locations (see node documentation for more details).

    • verbose name: Interpolate Using Channel Locations
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • normalize_leadfield
    Normalize the lead-field matrix. This can be used to fix problems with the scaling of the lead field matrix (e.g., when using a new or alternative head model).

    • verbose name: Normalize Leadfield
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

ROIActivations

Compute the activations of regions of interest (ROIs) in the given atlas from current source density.

This node accepts as input a signal that has brain activity estimates (current source density) for each source location in the headmodel, which can be obtained by using one of the source estimation nodes (e.g., sLORETA). This node will then estimate average activity in selected (or all) ROIs that are defined in a brain atlas. The result is a time series with one channel for each region, and otherwise the same data format as the input. The atlas is essentially a parcellation of brain source locations (e.g., cells in a 3d grid or vertices in a triangle mesh of the brain surface) into regions, and is stored in the head model file. Some head models may have multiple atlases (although not the current default model), and the desired atlas can be selected using the atlas parameter.

More Info...

Version 1.2.1

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • headmodel
    Override head model file to use (*.h m). If omitted, the node checks if the data has a current head model associated with it e.g., because a previous node has annotated it, (which is most likely the case for this node) and then uses that head model. If a relative path is given, the file is searched in the resources/headmodels folder of the cpe.

    • verbose name: Head Model File
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • atlas
    Optionally the name of the atlas to use. If the head model file contains multiple atlases in it, this allows to select the one to use.

    • verbose name: Atlas
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • subset
    Subset of ROIs for which to calculate activations, optional. Setting this to non-empty will restrict the set of regions for which activations are calculated, for a modest performance gain. Supports filename matching syntax (see fnmatch).

    • verbose name: Restrict To Roi Subsets
    • default value: []
    • port type: ListPort
    • value type: list (can be None)
  • fill_with_nan
    ROIs not in restricted subset will remain in data but their activations will be filled with nan.

    • verbose name: Set Non-Subset Rois To Nan
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

ROIsToVertices

Expand ROI activations such that each ROI gets broadcast to all of its vertices.

Version 0.2

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • nan_to_const
    Vertices corresponding to ROIs with nan activations will be set to a constant value. If False (default) then they will be set to nan.

    • verbose name: Nan To Constant
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • nan_replace
    Constant value replacing nan.

    • verbose name: Nan Replacement Value
    • default value: 0.0
    • port type: FloatPort
    • value type: float (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

RemoveUnlocalizedChannels

Remove channels from the data that have no location assigned to them.

Elements of the space axis ("channels") have an associated 3xN sized .position porperty, which [NaN,NaN,NaN] for channels that have no location, and holds the spatial coordinates of the channel otherwise. This node removes those channels that have no location. Note: the node will only affect the first space axis in the data.

Version 1.2.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • unlocalized
    Data with removed channels.

    • verbose name: Unlocalized
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • protect_channels
    Channels to protect from removal. This protects the channels with the given names from being removed. The syntax is as in ['Fp1','Fp2','C3','Cz'].

    • verbose name: Protect Channels From Removal
    • default value: []
    • port type: ListPort
    • value type: list (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

SLORETA

Estimate brain source activity using the Standardized Low-Resolution Brain Electromagnetic Tomography (sLORETA) algorithm.

This node accepts an EEG time series, and estimates for each time point the current source density (CSD) for a large number of locations (e.g., a few 1000) in the brain. The result is a time series with the EEG channels replaced by as many channels as there are source locations, and otherwise the same format as the input data. The set of source locations is defined by a headmodel, which is selectable via the headmodel_file parameter. Like eLORETA, this is a rather easy-to-use and very fast source estimation method. Important: the input data to this node should previously have been re-referenced to common average reference using the ReReferencing node (with default settings). Note: by default, the headmodel will be matched to EEG channel space using the EEG channel names, which are then assumed to be in the 10-20 (or the finer-grained 10-5) system. If your EEG channels do not use this label system, you need to know the locations of your channels relative to the 10-20 locations (which can be found in the resources/montages/standard-10-5-* file), and using that, you can either try to replace the channel labels by the closest 10-5 equivalent labels, or, likely better, select the interpolate option in this node to directly interpolate the head model for your given channel locations.

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • headmodel
    Head model file to use (*.h m). If omitted, the node checks if the data has a current head model associated with it, e.g., because a previous node has annotated it, and then uses that head model. If a relative path is given, the file is searched in the resources/headmodels folder of the cpe.

    • verbose name: Head Model File
    • default value:
    • port type: StringPort
    • value type: str (can be None)
  • regu
    Regularization strength. Larger values yield smoother solutions. In theory this is proportional to the sensor noise level. Ad-hoc choices work fairly well for visualization and basic source localization.

    • verbose name: Regularization Strength
    • default value: 0.05
    • port type: FloatPort
    • value type: float (can be None)
  • interpolate
    Rely on channel locations rather than labels. If this is enabled, the head model will be matched to the data using the channel locations rather than channel labels. This is only useful if the labels are unrecognized (e.g., non-standard labels), and if there are high-quality measured channel locations available. These locations must be in the same coordinate system as NeuroPype's default 10-5 locations (see node documentation for more details).

    • verbose name: Interpolate Using Channel Locations
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

SelectROIs

Pick a subset of regions of interest in the given data.

This node assumes that source activity has previously been computed using one of the source-estimation nodes (e.g. sLORETA), and that region-of-interest activity has been calculated from the raw source activity using the ROIActivations node. The same effect can also be achieved using the Select Range node -- however, due to the large number of ROIs and their non-trivial naming, this node offers a more convenient user interface.

More Info...

Version 1.0.1

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • selection
    Regions of interest to retain. Multiple regions can be selected out of the given set of ROIs. These regions correspond to the Desikan-Killiany Atlas.

    • verbose name: Regions To Keep (Multi-Select)
    • default value: []
    • port type: SubsetPort
    • value type: list (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

SelectRoiGroups

Selects among major groups of regions of interest taken from the Desikan-Killiany atlas.

More Info...

Version 1.0.0

Ports/Properties

  • metadata
    User-definable meta-data associated with the node. Usually reserved for technical purposes.

    • verbose name: Metadata
    • default value: {}
    • port type: DictPort
    • value type: dict (can be None)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • selection
    Groups of ROIs to retain. Multiple regions can be selected. These major regions correspond to the Desikan-Killiany Atlas.

    • verbose name: Regions To Keep (Multi-Select)
    • default value: []
    • port type: SubsetPort
    • value type: list (can be None)
  • set_breakpoint
    Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

    • verbose name: Set Breakpoint (Debug Only)
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)