Skip to content

← nirs package

SeparateChannelsByDistance

Calculate the distance between channels and either remove or place into a separate chunk channels which fall either below or above the threshold.

This is useful for either separating short channels into a separate chunk, or separating and/or dropping/removing channels which are considered too long to be included in the analysis. Version 1.2.2

Ports/Properties

data

Data to process.

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

stream

Stream(s) on which to perform this action. Leave empty to perform on all qualifying streams, that is, all streams which have a space axis and both .positions and .positions_source values. Wildcards are supported, i.e. mystream* will select the streams whose name starts with mystream.

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

threshold

Distance threshold, in mm. Channels which have a distance either above or below this threshold, depending on the value of the 'greater or less' parameter, will be separated and either placed into a separate chunk or removed.

  • verbose name: Threshold
  • default value: 15
  • port type: FloatPort
  • value type: float (can be None)

reference_locs

Set of reference locations from which to calculate the distance. If not given, then the source-detector distance will be computed.

  • verbose name: Reference Locs
  • default value: None
  • port type: ListPort
  • value type: list (can be None)

reference_geom

Type of geometry for which the distance to the reference locations shall be computed. This only applies if reference_locs is given. Position uses the regular ("detector") position, source uses the source position, line-segment is the straight line between source and detector position, midpoint the midpoint of that line. For backwards compatibility only, ray and its alias line use the (infinitely long) ray connecting the two. Optical-midpoint calculates the midpoint displaced towards the head center in accordance with the (rough) photon path, where the displacement is proportional to the channel length (scaled by optical_depth_scale). Banana represents a quadratic 'banana'-shaped photon path that passes through the optical modpoint.

  • verbose name: Reference Geom
  • default value: position
  • port type: EnumPort
  • value type: str (can be None)

unit

Unit in which the distance threshold is specified.

  • verbose name: Threshold Unit
  • default value: mm
  • port type: EnumPort
  • value type: str (can be None)

operator

Comparison to use between distance and threshold. For example if <, the action is applied to channels that are less than the threshold. The ~ operator means approx. equal.

  • verbose name: Comparison Type
  • default value: <
  • port type: EnumPort
  • value type: str (can be None)

action

Action to be taken on the selected channels. Move them into a new chunk (and remove from original chunk), or remove only (drop from the packet).

  • verbose name: Action
  • default value: move
  • port type: EnumPort
  • value type: str (can be None)

optical_depth_scale

Optical depth scale for NIRS geometries. Applies to optical-midpoint and the banana geometries. Given as the max channel depth as a factor of channel length. Note that the default of 0.5 is exaggerated, whereas the physically plausible scale is around 0.2 for 20-40mm channel lengths.

  • verbose name: Optical Depth Scale
  • default value: 0.5
  • port type: FloatPort
  • value type: float (can be None)

depth_displacement

Direction of depth displacement.

  • verbose name: Depth Displacement
  • default value: center
  • port type: EnumPort
  • value type: str (can be None)

new_chunk

Optional name of the chunk into which the separated channels are placed if 'action' is set to 'move'. If unspecified, will be automatically derived from the old chunk name, operator, threshold, and unit (i.e., 'nirs<60mm'.

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

verbose

Print verbose output.

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

debug_plot

Enable debug/inspection plot. This will open a matplotlib window showing some inspection graphics. Currently only applies when reference_locs is given.

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

streams

Deprecated. Use stream instead.

  • verbose name: Streams
  • default value: None
  • 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)

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)