:mod:`neuron_morphology.transforms.scale_correction.compute_scale_correction` ============================================================================= .. py:module:: neuron_morphology.transforms.scale_correction.compute_scale_correction Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: neuron_morphology.transforms.scale_correction.compute_scale_correction.estimate_scale_correction neuron_morphology.transforms.scale_correction.compute_scale_correction.get_soma_marker_from_marker_file neuron_morphology.transforms.scale_correction.compute_scale_correction.run_scale_correction neuron_morphology.transforms.scale_correction.compute_scale_correction.collect_inputs neuron_morphology.transforms.scale_correction.compute_scale_correction.main .. function:: 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 :Parameters: **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** .. :Returns: scale factor correction .. .. !! processed by numpydoc !! .. function:: get_soma_marker_from_marker_file(marker_path: str) .. function:: run_scale_correction(morphology: Morphology, soma_marker_z: float, soma_depth: float, cut_thickness: float) .. function:: collect_inputs(args: Dict[str, Any]) -> Dict[str, Any] :Parameters: **args: dict of InputParameters** .. :Returns: dict with string keys: morphology: Morphology object soma_marker_z: z value from the marker file soma_depth: soma depth cut_thickness: slice thickness .. !! processed by numpydoc !! .. function:: main()