morphology_workflows.curation

Curation functions.

Module Contents

Functions

collect(row, data_dir, morph_path_col='morph_path')

Collect morphologies.

extract_marker(row, data_dir)

Extract marker data from morphology files.

plot_markers(row, data_dir, with_plotly=True)

Plot markers on morphologies.

sanitize(row, data_dir)

Sanitize morphologies.

fix_root_section(morph, min_length=_ZERO_LENGTH)

Ensures that each neurite has a root section with non-zero length.

check_neurites(row, data_dir, axon_n_section_min=5, mock_soma_type='spherical', ensure_stub_axon=False, min_length_first_section=_ZERO_LENGTH)

Check which neurites are present, add soma if missing and mock_soma_type is not None.

fix_soma_radius(morph)

Fix the radius of a spherical soma.

fix_neurites_in_soma(row, data_dir)

Fix neurites whose points are located inside the soma.

recenter(row, data_dir)

Recenter morphologies to place soma at [0, 0, 0].

orient(row, data_dir, pia_direction='y')

Orient a morphology such that the original pia_direcion is along y.

align(row, data_dir, method='whole', neurite_type='apical', direction=None, custom_orientation_json_path=None)

Align a morphology.

z_range(neuron, min_range=50)

Checker for z-range.

detect_errors(row, data_dir, min_range=50)

Detect errors in morphologies.

plot_errors(row, data_dir, with_plotly=True)

Plot error markers.

make_error_report(df, data_dir, error_report_path='error_report.csv')

Make the error report as a df and save to .csv.

resample(row, data_dir, linear_density=1.0)

Resample morphologies with fixed linear density.

plot_morphology(row, data_dir, with_plotly=True, realistic_diameters=True)

Plot a morphology.

morphology_workflows.curation.collect(row, data_dir, morph_path_col='morph_path')

Collect morphologies.

morphology_workflows.curation.extract_marker(row, data_dir)

Extract marker data from morphology files.

morphology_workflows.curation.plot_markers(row, data_dir, with_plotly=True)

Plot markers on morphologies.

morphology_workflows.curation.sanitize(row, data_dir)

Sanitize morphologies.

morphology_workflows.curation.fix_root_section(morph, min_length=_ZERO_LENGTH)

Ensures that each neurite has a root section with non-zero length.

morphology_workflows.curation.check_neurites(row, data_dir, axon_n_section_min=5, mock_soma_type='spherical', ensure_stub_axon=False, min_length_first_section=_ZERO_LENGTH)

Check which neurites are present, add soma if missing and mock_soma_type is not None.

morphology_workflows.curation.fix_soma_radius(morph)

Fix the radius of a spherical soma.

If all points of a neurite are located inside the soma, the radius is reduced such that at least the last point of each neurite is located outside the soma.

morphology_workflows.curation.fix_neurites_in_soma(row, data_dir)

Fix neurites whose points are located inside the soma.

Method:
  • The radius of the soma is adapted to reduce the number of points inside the soma.

  • The remaining points inside the soma are removed.

morphology_workflows.curation.recenter(row, data_dir)

Recenter morphologies to place soma at [0, 0, 0].

morphology_workflows.curation.orient(row, data_dir, pia_direction='y')

Orient a morphology such that the original pia_direcion is along y.

morphology_workflows.curation.align(row, data_dir, method='whole', neurite_type='apical', direction=None, custom_orientation_json_path=None)

Align a morphology.

morphology_workflows.curation.z_range(neuron, min_range=50)

Checker for z-range.

morphology_workflows.curation.detect_errors(row, data_dir, min_range=50)

Detect errors in morphologies.

TODO: bypass dangling if only one axon/neurite

morphology_workflows.curation.plot_errors(row, data_dir, with_plotly=True)

Plot error markers.

morphology_workflows.curation.make_error_report(df, data_dir, error_report_path='error_report.csv')

Make the error report as a df and save to .csv.

morphology_workflows.curation.resample(row, data_dir, linear_density=1.0)

Resample morphologies with fixed linear density.

morphology_workflows.curation.plot_morphology(row, data_dir, with_plotly=True, realistic_diameters=True)

Plot a morphology.