From 5593205e903703b0968f1f9973586996b3de1ea6 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Sun, 4 Oct 2020 19:38:47 +0100 Subject: [PATCH] r.xform_brain: if present, also convert soma_radius --- navis/interfaces/r.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/navis/interfaces/r.py b/navis/interfaces/r.py index 7d6edc5f..e0d2457a 100644 --- a/navis/interfaces/r.py +++ b/navis/interfaces/r.py @@ -22,6 +22,7 @@ """ import math +import numbers import os import sys @@ -1164,6 +1165,10 @@ def xform_brain(x: Union['core.NeuronObject', 'pd.DataFrame', 'np.ndarray'], if isinstance(xf.units, (config.ureg.Unit, config.ureg.Quantity)): xf.units = (xf.units / 10**magnitude).to_compact() + # Fix soma radius if applicable + if hasattr(xf, 'soma_radius') and isinstance(xf.soma_radius, numbers.Number): + xf.soma_radius *= 10**magnitude + return xf elif isinstance(x, pd.DataFrame): if any([c not in x.columns for c in ['x', 'y', 'z']]):