pymaid.stack.Stack

class pymaid.stack.Stack(stack_info: StackInfo, mirror: int | str | None = None)[source]

Class representing a CATMAID stack of images.

Stacks are usually a scale pyramid. This class can, for certain stack mirror types, allow access to individual scale levels as arrays which can be queried in voxel or world coordinates.

HTTP requests to fetch stack data are often configured differently for different stack mirrors and tile source types. For most non-public mirrors, you will need to set the object to make these requests: see the my_stack.set_mirror_session() method; if you just need to set HTTP Basic authentication headers, see the my_stack.set_mirror_auth() convenience method.

See the my_stack.get_scale() method for getting an xarray.DataArray representing that scale level. This can be queried in stack/ voxel or project/ world coordinates, efficiently sliced and transposed etc..

The Stack.from_catmaid() constructor may be more convenient.

Parameters:
  • stack_info (StackInfo) –

  • mirror_id (Optional[int], optional) –

__init__(stack_info: StackInfo, mirror: int | str | None = None)[source]

The Stack.from_catmaid() constructor may be more convenient.

Parameters:
  • stack_info (StackInfo) –

  • mirror_id (Optional[int], optional) –

Methods

__init__(stack_info[, mirror])

The Stack.from_catmaid() constructor may be more convenient.

from_catmaid(stack[, mirror, remote_instance])

Fetch relevant data from CATMAID and build a Stack.

get_scale(scale_level[, mirror_id])

Get an xarray.DataArray representing the given scale level.

select_from_catmaid([remote_instance])

Interactively select a stack and mirror from those available.

select_mirror()

Interactively select a mirror from those available.

set_mirror(mirror)

Set the mirror using its int ID or str title.

set_mirror_auth(mirror, http_user, http_password)

Set the HTTP Basic credentials for a particular stack mirror.

set_mirror_session(mirror, session)

Set functions which construct the session for fetching image data, per mirror.