Skip to content

Commit

Permalink
enh: add FA-based IQMs (nans percentage and degenerate percentage)
Browse files Browse the repository at this point in the history
Percentage of brain volume.

Related: #1216.
  • Loading branch information
oesteban committed Apr 2, 2024
1 parent d62756f commit 7bf633a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mriqc/interfaces/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -202,7 +204,7 @@ def _run_interface(self, runtime):
# Summary stats
rois = {
'fg': mskdata,
'bg': ~mskdata,
'bg': 1.0 - mskdata,
'cc': ccdata,
'wm': wmdata,
}
Expand All @@ -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))
Expand Down

0 comments on commit 7bf633a

Please sign in to comment.