neuralib.atlas.brainrender.probe_rst
- class neuralib.atlas.brainrender.probe_rst.ProbeReconstructor[source]
- DESCRIPTION: str = 'For probe(s) track reconstruction'
parser description.
- implant_depth: int
implant depth in um
- dye_label_only: bool
only show the histology dye parts
- csv_file: Path
Example:
┌───────────────────────────────────┬─────────┬─────────────┬─────────────┬─────────────┬─────────┐ │ name ┆ acronym ┆ AP_location ┆ DV_location ┆ ML_location ┆ avIndex │ │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ i64 │ ╞═══════════════════════════════════╪═════════╪═════════════╪═════════════╪═════════════╪═════════╡ │ Primary visual area layer 6a ┆ VISp6a ┆ -3.81 ┆ 1.92 ┆ -3.12 ┆ 191 │ │ optic radiation ┆ or ┆ -4.08 ┆ 2.33 ┆ -3.12 ┆ 1217 │ │ Posterolateral visual area layer… ┆ VISpl6a ┆ -4.28 ┆ 2.29 ┆ -3.12 ┆ 198 │ │ Posterolateral visual area layer… ┆ VISpl5 ┆ -4.52 ┆ 2.17 ┆ -3.12 ┆ 197 │ │ Subiculum ┆ SUB ┆ -3.93 ┆ 4.36 ┆ -3.3 ┆ 536 │ │ Entorhinal area medial part dors… ┆ ENTm5 ┆ -4.19 ┆ 4.39 ┆ -3.3 ┆ 515 │ │ Entorhinal area medial part dors… ┆ ENTm2 ┆ -4.44 ┆ 4.39 ┆ -3.3 ┆ 510 │ │ Entorhinal area medial part dors… ┆ ENTm1 ┆ -4.66 ┆ 4.29 ┆ -3.3 ┆ 509 │ └───────────────────────────────────┴─────────┴─────────────┴─────────────┴─────────────┴─────────┘
- plane_type: Literal['coronal', 'sagittal', 'transverse']
cutting orientation. Assume if multiple shanks were inserted along the AP axis, then do the sagittalslicing, if inserted along the ML axis, then do the coronal slicing
- raw: DataFrame
raw csv file
- data: DataFrame
sorted data based on plane_type
- property number_shanks: int
- class ShanksTrack[source]
shank object
Dimension parameters:
S = number of shanks
P = number of sample points after interpolated reconstruction
- rst: ProbeReconstructor
ProbeReconstructor
- shanks: list[ndarray]
length S of Array[float, [P, 3]], with ap, dv, ml
- with_theoretical(interval=250)[source]
theoretical track based on implantation depth / angle
- Parameters:
interval (int) – istance (um) relative to the specific shank. e.g., NeuroPixel 2.0 = 250 * x
- Returns:
ShanksTrack- Return type:
Self
- __init__(rst, shanks)
- Parameters:
rst (ProbeReconstructor)
shanks (list[ndarray])
- Return type:
None
- infer_probe_index(df)[source]
probe in correct order index
- Parameters:
df (DataFrame) – raw csv file
- Returns:
dataframe with probe and probe_idx fields.
- Return type:
DataFrame
Example:
┌───────────────────────────────────┬─────────┬─────────────┬─────────────┬─────────────┬─────────┬───────────────┬───────────┐ │ name ┆ acronym ┆ AP_location ┆ DV_location ┆ ML_location ┆ avIndex ┆ probe ┆ probe_idx │ │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ i64 ┆ str ┆ i64 │ ╞═══════════════════════════════════╪═════════╪═════════════╪═════════════╪═════════════╪═════════╪═══════════════╪═══════════╡ │ Primary visual area layer 6a ┆ VISp6a ┆ -3.81 ┆ 1.92 ┆ -3.12 ┆ 191 ┆ dorsal_label ┆ 1 │ │ Subiculum ┆ SUB ┆ -3.93 ┆ 4.36 ┆ -3.3 ┆ 536 ┆ ventral_label ┆ 1 │ │ optic radiation ┆ or ┆ -4.08 ┆ 2.33 ┆ -3.12 ┆ 1217 ┆ dorsal_label ┆ 2 │ │ Entorhinal area medial part dors… ┆ ENTm5 ┆ -4.19 ┆ 4.39 ┆ -3.3 ┆ 515 ┆ ventral_label ┆ 2 │ │ Posterolateral visual area layer… ┆ VISpl6a ┆ -4.28 ┆ 2.29 ┆ -3.12 ┆ 198 ┆ dorsal_label ┆ 3 │ │ Entorhinal area medial part dors… ┆ ENTm2 ┆ -4.44 ┆ 4.39 ┆ -3.3 ┆ 510 ┆ ventral_label ┆ 3 │ │ Posterolateral visual area layer… ┆ VISpl5 ┆ -4.52 ┆ 2.17 ┆ -3.12 ┆ 197 ┆ dorsal_label ┆ 4 │ │ Entorhinal area medial part dors… ┆ ENTm1 ┆ -4.66 ┆ 4.29 ┆ -3.3 ┆ 509 ┆ ventral_label ┆ 4 │ └───────────────────────────────────┴─────────┴─────────────┴─────────────┴─────────────┴─────────┴───────────────┴───────────┘
- isin_brain(shank)[source]
determine if the probe points are in the brain
- Parameters:
shank (ndarray) – Array[float, [P, 3]]
- Returns:
- Return type:
ndarray
- crop_outside_brain(shank, distance, dv_value=None)[source]
crop the probe after doing the extension
- Parameters:
shank (ndarray) – Array[float, [P, 3]]
distance (float) – depth of insertion (might with an angle, in um). mostly records during the implantation use the depth value that used while implantation to cutoff the bottom line.
dv_value (int | None) – if None, plot the probe if its in the brain if int type, plot the probe if dv larger than this value
- Returns:
- Return type:
ndarray