Skip to content

Commit

Permalink
Merge pull request #6 from sinhaharsh/master
Browse files Browse the repository at this point in the history
Create BIDSImagingSequence
  • Loading branch information
raamana authored Jan 31, 2024
2 parents 6dd62a7 + 1a92e97 commit 6a8f367
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ deps = flake8
commands = flake8 protocol
# E203 - whitespace before ':'
ignore =
E203,
E203, W503
exclude =
docs,
*/_version.py,
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- master

pull_request:
branches:
- master

jobs:
build:

Expand All @@ -16,7 +20,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [ "3.8", "3.9", "3.10","3.11", "3.12" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v3
Expand All @@ -31,10 +35,7 @@ jobs:
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
make lint
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ lint: ## check style with flake8
flake8 protocol

test: ## run tests quickly with the default Python
py.test
pytest

test-all: ## run tests on every Python version with tox
tox
Expand Down
2 changes: 1 addition & 1 deletion protocol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
BASE_IMAGING_PARAMS_DICOM_TAGS,
ACRONYMS_IMAGING_PARAMETERS,
UnspecifiedType)
from protocol.imaging import ImagingSequence, SiemensMRImagingProtocol, MRImagingProtocol
from protocol.imaging import DicomImagingSequence, BidsImagingSequence, SiemensMRImagingProtocol, MRImagingProtocol
2 changes: 2 additions & 0 deletions protocol/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ def __init__(self,

self.allowed_values = allowed_values
if not isinstance(value, UnspecifiedType):
if value is None:
raise ValueError(f'Got NoneType, Expected {dtype}.')
if not isinstance(value, self.dtype):
try:
value = self.dtype(value)
Expand Down
2 changes: 2 additions & 0 deletions protocol/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def __repr__(self):
'MRAcquisitionType' : (0x18, 0x23),
'MTState' : (0x18, 0x9020),
'SpoilingState' : (0x18, 0x9016),
'ImageType' : (0x08, 0x08),

# In-Plane Spatial Encoding
'ParallelReductionFactorInPlane': (0x18, 0x9069),
Expand Down Expand Up @@ -301,6 +302,7 @@ def __repr__(self):
'PATMode' : 'PATM',
'PositivePCSDirections' : 'PPCSD',
'FieldOfView' : 'FOV',
'ImageType' : 'IT',
}

ACRONYMS_DEMOGRAPHICS = {
Expand Down
Loading

0 comments on commit 6a8f367

Please sign in to comment.