diff --git a/FastSurferCNN/segstats.py b/FastSurferCNN/segstats.py index 3f2769fe..3a106375 100644 --- a/FastSurferCNN/segstats.py +++ b/FastSurferCNN/segstats.py @@ -876,7 +876,8 @@ def main(args: argparse.Namespace) -> Literal[0] | str: pv_data = pv_preproc_future.result() names = ["nbr", "nbr_means", "seg_means", "mix_coeff", "nbr_mix_coeff"] - save_maps = any(getattr(args, n, "") for n in names) + save_maps_paths = (getattr(args, n, "") for n in names) + save_maps = any(bool(path) and path != Path() for path in save_maps_paths) out = pv_calc(seg_data, pv_data, norm_data, labels, return_maps=save_maps, **kwargs) _io_futures = [] diff --git a/FastSurferCNN/utils/brainvolstats.py b/FastSurferCNN/utils/brainvolstats.py index e06a06cf..bc9ca9af 100644 --- a/FastSurferCNN/utils/brainvolstats.py +++ b/FastSurferCNN/utils/brainvolstats.py @@ -714,7 +714,6 @@ def __init__( self._classes = classes super().__init__(name, description, unit) self._pv_value = None - self._vox_vol = 0. @property def vox_vol(self) -> float: @@ -736,12 +735,8 @@ def __call__(self) -> float: f"The partial volume of {self._name} has not been updated in the " f"PVMeasure object yet!" ) - if self.unit == "unitless": - vox_vol, col = 1, "NVoxels" - else: - vox_vol, col = self._vox_vol, "Volume_mm3" - out = self._pv_value[col].item() * vox_vol - return out + col = "NVoxels" if self.unit == "unitless" else "Volume_mm3" + return self._pv_value[col].item() def _parsable_args(self) -> list[str]: return ["classes"] @@ -2191,8 +2186,7 @@ def mask_77_lat(arr): brain_seg_classes.extend(range(2002, 2032)) brain_seg_classes.remove(2004) brain_seg_classes.extend((2034, 2035)) - brainseg_class = self.voxel_class - return brainseg_class( + return self.voxel_class( brain_seg_classes, "BrainSegVol", "Brain Segmentation Volume",