Skip to content

← file_system package

ImportBIDSMetadata

Import metadata from BIDS sidecar files and apply it to an existing data packet.

This node looks for BIDS-formatted sidecar files (_channels.tsv, _electrodes.tsv, _coordsystem.json, _events.tsv, participants.tsv, and JSON metadata files) based on the source file path stored in the packet's chunk properties (Origin.source_url). The node follows BIDS inheritance rules, where metadata from more specific files overrides metadata from less specific files in the hierarchy (dataset → subject → session → run). When importing electrode locations, coordinate system information (_coordsystem.json) is automatically used to ensure proper transformation to NeuroPype's internal coordinate system (meters, x=right, y=front, z=up). Participant information from participants.tsv at the BIDS root is included in the metadata with normalized values for age (numeric, capped at 89), sex (male/female/other), and handedness (left/right/ambidextrous). Events can be merged with existing events in the packet, replacing them entirely, or appending to them based on the event_merge_mode setting. All BIDS metadata is also archived in chunk.props['BIDS'] for traceability and future reference. Version 0.9.0

Ports/Properties

data

Data packet to augment with BIDS metadata.

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

import_metadata

Import metadata from BIDS JSON sidecar files and apply to chunk properties.

  • verbose name: Import Metadata
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

import_channels

Import channel information from _channels.t sv files and apply to SpaceAxis.

  • verbose name: Import Channels
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

import_electrodes

Import electrode locations from _electrodes.t sv files and apply to SpaceAxis positions. When enabled, coordinate system information from _coordsystem.json will also be imported to ensure proper coordinate transformation.

  • verbose name: Import Electrodes
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

import_events

Import events from _events.t sv files and apply to markers chunk.

  • verbose name: Import Events
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

event_merge_mode

How to handle existing events when importing from BIDS. 'replace' removes all existing events; 'merge' filters out duplicates based on time and type; 'append' adds all BIDS events regardless of duplicates.

  • verbose name: Event Merge Mode
  • default value: merge
  • port type: EnumPort
  • value type: str (can be None)

event_type_columns

Priority-ordered list of column names to use for event type (Marker field). The first column found in the events file will be used.

  • verbose name: Event Type Columns
  • default value: ['type', 'event_type', 'HED', 'value', 'code', 'trial_type']
  • port type: ListPort
  • value type: list (can be None)

chunk_selection

Which chunks to process. 'all' processes all chunks using a source file of record; 'if_source_url' only processes chunks that have their own Origin.source_url.

  • verbose name: Chunk Selection
  • default value: all
  • port type: EnumPort
  • value type: str (can be None)

verbose

Enable verbose logging.

  • verbose name: Verbose
  • 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)

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)