neuralib.atlas.brainrender.probe.ProbeRenderCLI

class neuralib.atlas.brainrender.probe.ProbeRenderCLI[source]

Bases: BrainRenderCLI

Probe track reconstruction with brainrender

__init__()

Methods

__init__()

export(reconstructor[, output, areas, alpha])

Export reconstruction as html

get_atlas_brain_globe([check_latest])

main([args, exit_on_error])

parsing the commandline input args and set the argument attributes, then call run().

new_parser(**kwargs)

create an argparse.ArgumentParser.

post_parsing()

called when all argument attributes are set but before run().

render()

brainrender interactive

render_output()

io handling.

run()

called when all argument attributes are set

video_maker(output_file)

generate video

Attributes

DEFAULT_REGION_COLORS

DESCRIPTION

parser description.

EPILOG

parser epilog.

GROUP_OPTIONAL

GROUP_OUTPUT

GROUP_PROBE

GROUP_REGION

GROUP_SETTINGS

USAGE

parser usage.

annotation

whether draw point annotation.

background

background color

camera_angle

camera angle

coordinate_space

which coordinate space, by default ccf

dye_label_only

only show the histology dye parts

file

multi-shank npy or csv file to be inferred

hemisphere

which hemisphere for rendering the region

implant_depth

implant depth in um

logger

no_root

render without root(brain) mesh

output

output path for the html, if None, preview

plane_type

cutting orientation to infer the multi-shank label point/probe_idx

print_name

print acronym and the corresponding name

print_tree

print tree for the available regions for the given source

region_colors

region(s) color

regions

region(s) name

regions_alpha

region alpha value

remove_outside_brain

remove reconstruction outside the brain

root_alpha

root alpha

shader_style

Shader style to use

shank_interval

shank interval in um if multi-shank

source

atlas source name.

title

title added to the top of the window

tree_init

init region for the tree print

video_output

video output path

scene

DESCRIPTION: str = 'Probe track reconstruction with brainrender'

parser description.

GROUP_PROBE = 'Probe Option'
implant_depth: int

implant depth in um

shank_interval: int | None

shank interval in um if multi-shank

dye_label_only: bool

only show the histology dye parts

remove_outside_brain: bool

remove reconstruction outside the brain

file: Path

multi-shank npy or csv file to be inferred

plane_type: Literal['coronal', 'sagittal', 'transverse']

cutting orientation to infer the multi-shank label point/probe_idx

post_parsing()[source]

called when all argument attributes are set but before run().

It is used for a common operation for a common option class, for example, checking arguments before doing things.

run()[source]

called when all argument attributes are set

render()[source]

brainrender interactive

DEFAULT_REGION_COLORS = ['lightblue', 'pink', 'turquoise']
EPILOG: str = None

parser epilog. Could be override as a method if its content is dynamic-generated.

GROUP_OPTIONAL = 'Optional Option'
GROUP_OUTPUT = 'Output Option'
GROUP_REGION = 'Region Option'
GROUP_SETTINGS = 'Basic Settings Option'
USAGE: str = None

parser usage.

static __new__(cls, *args, **kwargs)
annotation: tuple[str, ...] | None

whether draw point annotation. e.g., 1.5:1:0.4,-3.2:0.8:0.4 for two points

background: Literal['white', 'black']

background color

camera_angle: CAMERA_ANGLE_TYPE

camera angle

coordinate_space: Literal['ccf', 'brainrender']

which coordinate space, by default ccf

classmethod export(reconstructor, output=None, areas=None, alpha=0.15)

Export reconstruction as html

Parameters:
  • reconstructor (Self | None) – BrainRenderReconstructor if use the current scene, and –output cli. Otherwise, general func usage

  • output (Path | None) – output file path

  • areas (list[str] | None) – list of area(s)

  • alpha (float) – brain region alpha

get_atlas_brain_globe(check_latest=False)
Return type:

BrainGlobeAtlas

hemisphere: Literal['right', 'left', 'both']

which hemisphere for rendering the region

logger = <RootLogger root (IO)>
main(args=None, *, exit_on_error=True)

parsing the commandline input args and set the argument attributes, then call run().

Example

if overwrite with the argument default, use args

>>> AbstractParser().main((['--source=allen_mouse_25um', '--region=VISal,VISam,...'], []))
Parameters:
  • args (list[str] | tuple[list[str]] | None) – commandline arguments, or a tuple of (prepend, append) arguments

  • exit_on_error (bool) – exit when commandline parsed fail. Otherwise, raise a RuntimeError.

classmethod new_parser(**kwargs)

create an argparse.ArgumentParser.

class variable: USAGE, DESCRIPTION and EPILOG are used when creation.

>>> class A(AbstractParser):
...     @classmethod
...     def new_parser(cls, **kwargs) -> argparse.ArgumentParser:
...         return super().new_parser(**kwargs)
Parameters:

kwargs – keyword parameters to ArgumentParser

Returns:

an ArgumentParser.

Return type:

ArgumentParser

no_root: bool

render without root(brain) mesh

output: Path | None

output path for the html, if None, preview

print_name: bool

print acronym and the corresponding name

print_tree: bool

print tree for the available regions for the given source

region_colors: str | tuple[str, ...] | None

region(s) color

regions: str | tuple[str, ...]

region(s) name

regions_alpha: float

region alpha value

render_output()

io handling. i.e., video, html output

root_alpha: float

root alpha

shader_style: SHADER_STYLE_TYPE

Shader style to use

source: str

atlas source name. allen_human_500um as human

title: str | None

title added to the top of the window

tree_init: str | None

init region for the tree print

video_maker(output_file)

generate video

Parameters:

output_file (Path) – video output path

video_output: Path | None

video output path

scene: brainrender.Scene