diff --git a/mriqc/interfaces/diffusion.py b/mriqc/interfaces/diffusion.py index 01e3c2f6..48914f96 100644 --- a/mriqc/interfaces/diffusion.py +++ b/mriqc/interfaces/diffusion.py @@ -126,6 +126,8 @@ class _DiffusionQCInputSpec(_BaseInterfaceInputSpec): class _DiffusionQCOutputSpec(TraitedSpec): cc_snr = traits.Dict efc = traits.Dict + fa_degenerate = traits.Float + fa_nans = traits.Float fber = traits.Dict fd = traits.Dict # snr = traits.Float @@ -202,7 +204,7 @@ def _run_interface(self, runtime): # Summary stats rois = { 'fg': mskdata, - 'bg': ~mskdata, + 'bg': 1.0 - mskdata, 'cc': ccdata, 'wm': wmdata, } @@ -217,6 +219,12 @@ def _run_interface(self, runtime): b_vectors=self.inputs.in_bvec, ) + fa_nans_mask = np.asanyarray(nb.load(self.inputs.in_fa_nans).dataobj) > 0.0 + self._results['fa_nans'] = float(fa_nans_mask[mskdata > 0.5].mean()) + + fa_degenerate_mask = np.asanyarray(nb.load(self.inputs.in_fa_degenerate).dataobj) > 0.0 + self._results['fa_degenerate'] = float(fa_degenerate_mask[mskdata > 0.5].mean()) + # FBER self._results['fber'] = { f'b{int(bval):d}': aqc.fber(bdata, mskdata.astype(np.uint8))