neuror.cut_plane.viewer

App to find cut planes with arbitrary cut planes orientations with the help of a manual hint.

Related to https://bbpteam.epfl.ch/project/issues/browse/NGV-85

Functions

create_plane

Create a 3d plane using a center position and a quaternion for orientation.

display_click_data

Callback that redraw everything when sliders are changed.

export

Write the final file cut-plane.json to disk.

optimize

Optimize cut plane parameters.

set_neuron

Globally loads the neuron.

update_output

Update histo when sliders are changed.

update_post_optim_x_rotate

Dash callback.

update_post_optim_x_translate

Dash callback.

update_post_optim_y_rotate

Dash callback.

update_post_optim_y_translate

Dash callback.

update_post_optim_z_rotate

Dash callback.

update_post_optim_z_translate

Dash callback.

Classes

NumpyEncoder

JSON encoder that handles numpy types.

class neuror.cut_plane.viewer.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

JSON encoder that handles numpy types.

In python3, numpy types don’t serialize to correctly, so a custom converter is needed.

default(o)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
neuror.cut_plane.viewer.create_plane(pos, quat)[source]

Create a 3d plane using a center position and a quaternion for orientation.

Args :

pos: x,y,z position of the plane’s center (array([x,y,z])) quat: quaternion representing the orientations (Quaternion)

Returns :

dict: A square surface to the plotly format

neuror.cut_plane.viewer.display_click_data(rot_x, rot_y, rot_z, transl_x, transl_y, transl_z, hide, layout)[source]

Callback that redraw everything when sliders are changed.

neuror.cut_plane.viewer.export(n_clicks, rot_x, rot_y, rot_z, transl_x, transl_y, transl_z, output_path)[source]

Write the final file cut-plane.json to disk.

neuror.cut_plane.viewer.optimize(n_clicks, rot_x, rot_y, rot_z, transl_x, transl_y, transl_z)[source]

Optimize cut plane parameters.

neuror.cut_plane.viewer.set_neuron(filename)[source]

Globally loads the neuron.

neuror.cut_plane.viewer.update_output(rot_x, rot_y, rot_z, transl_x, transl_y, transl_z)[source]

Update histo when sliders are changed.

neuror.cut_plane.viewer.update_post_optim_x_rotate(params)[source]

Dash callback.

neuror.cut_plane.viewer.update_post_optim_x_translate(params)[source]

Dash callback.

neuror.cut_plane.viewer.update_post_optim_y_rotate(params)[source]

Dash callback.

neuror.cut_plane.viewer.update_post_optim_y_translate(params)[source]

Dash callback.

neuror.cut_plane.viewer.update_post_optim_z_rotate(params)[source]

Dash callback.

neuror.cut_plane.viewer.update_post_optim_z_translate(params)[source]

Dash callback.