neuralib.imaging.widefield.align.NapariAlignmentOptions

class neuralib.imaging.widefield.align.NapariAlignmentOptions[source]

Bases: AbstractParser

__init__()

Methods

__init__()

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().

run()

called when all argument attributes are set

Attributes

DESCRIPTION

parser description.

EPILOG

parser epilog.

USAGE

parser usage.

color

alignment map with color

dorsal_map_path

dorsal map file, If None then use default

reference_path

reference image (e.g., bright-field)

sequence_path

file path for the video sequence

DESCRIPTION: str = 'View the video sequences and top view of dorsal cortex using napari'

parser description.

sequence_path: str

file path for the video sequence

reference_path: str | None

reference image (e.g., bright-field)

dorsal_map_path: str | None

dorsal map file, If None then use default

color: bool

alignment map with color

run()[source]

called when all argument attributes are set

EPILOG: str = None

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

USAGE: str = None

parser usage.

static __new__(cls, *args, **kwargs)
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

post_parsing()

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.