Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
po09i committed Dec 21, 2023
2 parents 29d0526 + 9a1671d commit c601ace
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Expand Up @@ -19,8 +19,8 @@ jobs:
strategy:
matrix:
os:
- 'macos-11'
- 'macos-12'
- 'macos-13'
- 'ubuntu-22.04'
- 'ubuntu-20.04'
python-version:
Expand All @@ -33,10 +33,6 @@ jobs:
echo $HOME
- uses: actions/checkout@v3

- name: Set XCode version
if: contains(matrix.os, 'macos-11.0')
run: sudo xcode-select -s "/Applications/Xcode_12.2.app"

- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
32 changes: 32 additions & 0 deletions config/dcm2bids.json
Expand Up @@ -94,6 +94,38 @@
"ImageType": [".*", ".*", "M", ".*", "UNI"]
}
},
{
"datatype": "anat",
"suffix": "inv-1_MP2RAGE",
"criteria": {
"Manufacturer": "Siemens",
"SequenceName": ".*tfl3d1_16.*",
"ProtocolName": ".*mp2rage.*",
"SeriesDescription": ".*_INV1",
"ImageType": [".*", ".*", "M", "NORM", ".*"]
}
},
{
"datatype": "anat",
"suffix": "inv-2_MP2RAGE",
"criteria": {
"Manufacturer": "Siemens",
"SequenceName": ".*tfl3d1_16.*",
"ProtocolName": ".*mp2rage.*",
"SeriesDescription": ".*_INV2",
"ImageType": [".*", ".*", "M", "NORM", ".*"]
}
},
{
"datatype": "anat",
"suffix": "UNIT1",
"criteria": {
"Manufacturer": "Siemens",
"SequenceName": ".*tfl3d1_16.*",
"ProtocolName": ".*mp2rage.*",
"ImageType": [".*", ".*", "M", "UNI", ".*"]
}
},
{
"datatype": "anat",
"suffix": "T1w",
Expand Down
6 changes: 3 additions & 3 deletions shimmingtoolbox/dicom_to_nifti.py
Expand Up @@ -125,11 +125,11 @@ def rename_phasediff(path_nifti, subject_id):
# Open the json file
with open(fname_json) as json_file:
json_data = json.load(json_file)
# Make sure it is a phase data and that the keys EchoTime1 and EchoTime2 are defined and that
# sequenceName's last digit is 2 (refers to number of echoes when using dcm2bids)
# Make sure it is phase data and that the keys EchoTime1 and EchoTime2 are defined and that
# the tag "sequenceName" includes fm2d2 which is Siemens' sequence that outputs a phasediff
if ('ImageType' in json_data) and ('P' in json_data['ImageType']) and \
('EchoTime1' in json_data) and ('EchoTime2' in json_data) and \
('SequenceName' in json_data) and (int(json_data['SequenceName'][-1]) == 2) and \
('SequenceName' in json_data) and ('fm2d2' in json_data['SequenceName']) and \
('EchoNumber' in json_data) and (int(json_data['EchoNumber']) == 2):
# Make sure it is not already named phasediff
if len(os.path.basename(fname_json).split(subject_id, 1)[-1].rsplit('phasediff', 1)) == 1:
Expand Down

0 comments on commit c601ace

Please sign in to comment.