Skip to content

← file_system package

ImportSnirf

Import data from a .s

nirf (fNIRS) file, including any events and auxiliary data. Channel names are constructed from the source and detector indices and the wavelength, in the format: S<source_number>-D<detector_number>-<wavelength> (i.e., S01-D01-760.0). Source positions are stored in the positions_source field of the Space axis, and detector positions in the positions field. Wavelengths are stored in the wavelengths field. The signal stream will be named nirs (and modality NIRS will be stored in the stream's Origin.modality property). For events, a start marker will be created with the timestamp of each stim event found, and a matching end marker will be created k seconds later (where k is the specified duration). The resulting markers will be in the following format: <event_label>-<event_duration>-start and matching <event_label>-<event_duration>-end (i.e., 1-10.0-start). Optionally, the event durations can be omitted from the resulting markers using the 'durations in labels' parameter. If the file contains auxiliary data (i.e., accelerometer and gyroscope data saved by NirX devices), these will be imported into their own streams (i.e., named accel and gyro, respectively). Other channels besides the above that have the same number of timestamps will be grouped together in separate streams (i.e., physio), etc. named aux1, aux2, etc. More Info... Version 1.6.0

Ports/Properties

data

Output signal.

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

filename

Name of the file to import (.s nirf). If a relative path is given, a file of this name will be looked up in the standard data directories (these include cpe/resources and examples/).

  • verbose name: Filename
  • default value:
  • port type: StringPort
  • value type: str (can be None)

device

Import data in .n irs format created by a specific device. Some devices have certain particularities or files which provide some additional data that is not included in the .nirs file. If importing data from a device listed here, the importer will try to account for that where possible. Select 'generic' for the standard .nirs format without any extra files or device-specific configuration.

  • verbose name: Device
  • default value: generic
  • port type: ComboPort
  • value type: str (can be None)

orientation

The orientation of the coordinate system used for the source and detector positions. 'right-handed' defines x as right, while 'left-handed' defines either y or z as right, and 'z-up' and 'y-up' define the vertical axis.

  • verbose name: Orientation
  • default value: right-handed z-up
  • port type: EnumPort
  • value type: str (can be None)

aux_field

If the device stored accelerometer data or any other auxiliary data in the .n irs file, specify the prefix of the top-level field(s) where this is stored. This is "aux" by convention. For example, NirX headsets store x/y/z accelerometer data in fields "aux1", "aux2", "aux3".

  • verbose name: Aux Field
  • default value: aux
  • port type: StringPort
  • value type: str (can be None)

sort_by

Sorting order for channels. If set to wavelength-first, the node outputs first all channels for the lowest wavelength, then all channels for the next highest wavelength etc. If set to link-first, then the node emits first all wavelengths for a given source-detector pair, then all wavelengths for the next source-detector pair, etc.

  • verbose name: Sort By
  • default value: wavelength-first
  • port type: EnumPort
  • value type: str (can be None)

durations_in_labels

Whether to include the retrieved event durations in the output event marker label names. Example: If True, --. If False, -.

  • verbose name: Durations In Labels
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

verbose

Print info about the imported file.

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

file_missing

Whether to raise an exception (error) if the file is missing or not found (which may stop the pipeline), or print a log message and continue.

  • verbose name: File Missing
  • default value: raise
  • port type: EnumPort
  • value type: str (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)

cloud_host

Cloud storage host to use (if any). You can override this option to select from what kind of cloud storage service data should be downloaded. On some environments (e.g., on NeuroScale), the value Default will be map to the default storage provider on that environment.

  • verbose name: Cloud Host
  • default value: Default
  • port type: EnumPort
  • value type: str (can be None)

cloud_account

Cloud account name on storage provider (use default if omitted). You can override this to choose a non-default account name for some storage provider (e.g., Azure or S3.). On some environments (e.g., on NeuroScale), this value will be default-initialized to your account.

  • verbose name: Cloud Account
  • default value:
  • port type: StringPort
  • value type: str (can be None)

cloud_bucket

Cloud bucket to read from (use default if omitted). This is the bucket or container on the cloud storage provider that the file would be written to. On some environments (e.g., on NeuroScale), this value will be default-initialized to a bucket that has been created for you.

  • verbose name: Cloud Bucket
  • default value:
  • port type: StringPort
  • value type: str (can be None)

cloud_credentials

Secure credential to access cloud data (use default if omitted). These are the security credentials (e.g., password or access token) for the the cloud storage provider. On some environments (e.g., on NeuroScale), this value will be default-initialized to the right credentials for you.

  • verbose name: Cloud Credentials
  • default value:
  • port type: StringPort
  • value type: str (can be None)