From d37c7abf65313f3ba3985bfe265423f7f2880029 Mon Sep 17 00:00:00 2001 From: SungHo Lee Date: Tue, 2 Jun 2020 18:38:11 -0400 Subject: [PATCH] [add feature] Issue #8- bdata generation --- brkraw/__init__.py | 2 +- brkraw/scripts/brkraw.py | 3 +++ brkraw/ui/main_win.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brkraw/__init__.py b/brkraw/__init__.py index 6a24cd3..a7f4cf1 100644 --- a/brkraw/__init__.py +++ b/brkraw/__init__.py @@ -1,6 +1,6 @@ from .lib import * -__version__ = '0.3.3rc7' +__version__ = '0.3.3rc8' __all__ = ['BrukerLoader', '__version__'] diff --git a/brkraw/scripts/brkraw.py b/brkraw/scripts/brkraw.py index a1d81e8..114a88f 100644 --- a/brkraw/scripts/brkraw.py +++ b/brkraw/scripts/brkraw.py @@ -125,7 +125,10 @@ def main(): try: scan_id = int(scan_id) reco_id = int(reco_id) + method = study._pvobj._method[scan_id].parameters['Method'] study.save_as(scan_id, reco_id, output_fname, slope=slope) + if re.search('dti', method, re.IGNORECASE): + study.save_bdata(scan_id, output_fname) if args.bids: study.save_json(scan_id, reco_id, output_fname) print('NifTi file is generated... [{}]'.format(output_fname)) diff --git a/brkraw/ui/main_win.py b/brkraw/ui/main_win.py index ec5a1a0..c8f5f51 100644 --- a/brkraw/ui/main_win.py +++ b/brkraw/ui/main_win.py @@ -188,6 +188,10 @@ def _save_as(self): else: slope = False self._raw.save_as(self._scan_id, self._reco_id, filename, dir=self._output, slope=slope) + method = self._raw._pvobj._method[self._scan_id].parameters['Method'] + import re + if re.search('dti', method, re.IGNORECASE): + self._raw.save_bdata(self._scan_id, filename) from tkinter import messagebox messagebox.showinfo(title='File conversion', message='{}/{}.nii.gz has been converted'.format(self._output,