Module Contents


estimate_scale_correction(morphology: Morphology, soma_depth: float, soma_marker_z: float, cut_thickness: Optional[float] = 350) Estimate a scale factor to correct the reconstructed morphology
get_soma_marker_from_marker_file(marker_path: str)
run_scale_correction(morphology: Morphology, soma_marker_z: float, soma_depth: float, cut_thickness: float)
collect_inputs(args: Dict[str, Any]) → Dict[str, Any]
neuron_morphology.transforms.scale_correction.compute_scale_correction.estimate_scale_correction(morphology: Morphology, soma_depth: float, soma_marker_z: float, cut_thickness: Optional[float] = 350)

Estimate a scale factor to correct the reconstructed morphology for slice shrinkage

Prior to reconstruction, the slice shrinks due to evaporation. This is most notable in the z axis, which is the slice thickness.

To correct for shrinkage we compare soma depth within the slice obtained soon after cutting the slice to the fixed_soma_depth obtained during the reconstruction. Then the scale correction is estimated as: scale = soma_depth / fixed_soma_depth. This is sensible as long as the z span of the corrected reconstruction is contained within the slice thickness. Thus we also estimate the maximum scale correction as: scale_max = cut_thickness / z_span, and take the smaller of scale and scale_max

morphology: Morphology object
soma_depth: recorded depth of the soma when it was sliced
soma_marker_z: soma marker z value from revised marker file

(z is on the slice surface for the marker file)

cut_thickness: thickness of the cut slice
scale factor correction
neuron_morphology.transforms.scale_correction.compute_scale_correction.get_soma_marker_from_marker_file(marker_path: str)
neuron_morphology.transforms.scale_correction.compute_scale_correction.run_scale_correction(morphology: Morphology, soma_marker_z: float, soma_depth: float, cut_thickness: float)
neuron_morphology.transforms.scale_correction.compute_scale_correction.collect_inputs(args: Dict[str, Any]) → Dict[str, Any]
args: dict of InputParameters
dict with string keys:

morphology: Morphology object soma_marker_z: z value from the marker file soma_depth: soma depth cut_thickness: slice thickness