Skip to content

Commit

Permalink
ENH: Adds support for EXT signal for CMRR physio data
Browse files Browse the repository at this point in the history
Addresses #5

Versions 4.3.3 (full pkg) and 1.4.3 (sub-pkgs)
  • Loading branch information
pvelasco committed Nov 30, 2020
1 parent 5565f3f commit 4ff8ad4
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bidsphysio.acq2bids/bidsphysio/acq2bids/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
need to also bump up the version of the dependencies
"""

__version__ = "1.4.2"
__version__ = "1.4.3"
__author__ = "Pablo Velasco"
__author_email__ = "pablo.velasco@nyu.edu"
__url__ = "https://github.com/cbinyu/bidsphysio"
Expand Down
2 changes: 1 addition & 1 deletion bidsphysio.base/bidsphysio/base/info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.4.2"
__version__ = "1.4.3"
__author__ = "Pablo Velasco, Chrysa Papadaniil"
__author_email__ = "pablo.velasco@nyu.edu"
__url__ = "https://github.com/cbinyu/bidsphysio"
Expand Down
29 changes: 15 additions & 14 deletions bidsphysio.dcm2bids/bidsphysio/dcm2bids/dcm2bidsphysio.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,32 +209,33 @@ def parse_log(physio_log, verbose=False):
# Divide the line at whitespace
parts = line.split()

# Data lines have the form "<tag> = <value>" or "<time> <name> <signal>"
if len(parts) == 3:
# Data lines have the form "<tag> = <value>" or "<time> <name/channel> <value>"
# Data lines with trigger have a forth column with "PULS_TRIGGER", which we can ignore
if len(parts) >= 3:

p1, p2, p3 = parts
p1, p2, p3 = parts[:3]

if 'UUID' in p1:
if 'PULS' in p2 or 'RESP' in p2 or 'EXT' in p2:
# The times are in multiples of 2.5 ms
t_list.append(2.5 * int(p1))
# in principle, these will also be int, but let's make them
# float to support more general signals:
s_list.append(float(p3))

elif 'UUID' in p1:
uuid = p3

if 'ScanDate' in p1:
elif 'ScanDate' in p1:
scan_date = p3

if 'LogDataType' in p1:
elif 'LogDataType' in p1:
waveform_name = p3

if 'SampleTime' in p1:
elif 'SampleTime' in p1:
# 'SampleTime' is in units of 2.5 ms
# 'dt' is in ms:
dt = 2.5 * float(p3)

if 'PULS' in p2 or 'RESP' in p2:
# The times are in multiples of 2.5 ms
t_list.append(2.5 * int(p1))
# in principle, these will also be int, but let's make them
# float to support more general signals:
s_list.append(float(p3))

# Detect the scanner trigger by going through the ACQUISITION_INFO
# and detecting when a new volume has been started:
if waveform_name == 'ACQUISITION_INFO':
Expand Down
2 changes: 1 addition & 1 deletion bidsphysio.dcm2bids/bidsphysio/dcm2bids/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
need to also bump up the version of the dependencies
"""

__version__ = "1.4.2"
__version__ = "1.4.3"
__author__ = "Pablo Velasco"
__author_email__ = "pablo.velasco@nyu.edu"
__url__ = "https://github.com/cbinyu/bidsphysio"
Expand Down
2 changes: 1 addition & 1 deletion bidsphysio.dcm2bids/tests/test_dcm2bidsphysio.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ def test_timing(
expected_TR = int(re.findall(r'alTR\[0\]\s+=\s+(\d+)', header)[0])/1000000

TRs = get_physio_TRs(outbids)
assert all(TRs) == expected_TR
assert all(TRs) == expected_TR
4 changes: 2 additions & 2 deletions bidsphysio.physio2bids/bidsphysio/physio2bids/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
need to also bump up the version of the dependencies
"""

__version__ = "1.4.2"
__version__ = "1.4.3"
__author__ = "Pablo Velasco"
__author_email__ = "pablo.velasco@nyu.edu"
__url__ = "https://github.com/cbinyu/bidsphysio"
Expand All @@ -24,7 +24,7 @@
PYTHON_REQUIRES = ">=3.6"

REQUIRES = [
'bidsphysio >= 4.3.2',
'bidsphysio >= 4.3.3',
]

TESTS_REQUIRES = [
Expand Down
2 changes: 1 addition & 1 deletion bidsphysio.pmu2bids/bidsphysio/pmu2bids/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
need to also bump up the version of the dependencies
"""

__version__ = "1.4.2"
__version__ = "1.4.3"
__author__ = "Pablo Velasco"
__author_email__ = "pablo.velasco@nyu.edu"
__url__ = "https://github.com/cbinyu/bidsphysio"
Expand Down
2 changes: 1 addition & 1 deletion bidsphysio.session/bidsphysio/session/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
need to also bump up the version of the dependencies
"""

__version__ = "1.4.2"
__version__ = "1.4.3"
__author__ = "Pablo Velasco, Chrysa Papadaniil"
__author_email__ = "pablo.velasco@nyu.edu"
__url__ = "https://github.com/cbinyu/bidsphysio"
Expand Down
2 changes: 1 addition & 1 deletion bidsphysio/info.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os.path as op
from os import scandir

__version__ = "4.3.2"
__version__ = "4.3.3"
__author__ = "Pablo Velasco"
__author_email__ = "pablo.velasco@nyu.edu"
__url__ = "https://github.com/cbinyu/bidsphysio"
Expand Down

0 comments on commit 4ff8ad4

Please sign in to comment.