Skip to content

Commit

Permalink
v2023.1.12 add support for Flywheel DICOM download tarballs in top-le…
Browse files Browse the repository at this point in the history
…vel BIDS directory. Rename README.md to README for validation. Add tarballs to bidsignore
  • Loading branch information
jmtyszka committed Jan 12, 2023
1 parent 7a98cb2 commit 357f003
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bidskit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def main():
'Recon': args.recon
}

# Read version from setup.py
# Read installed version number
ver = pkg_resources.get_distribution('bidskit').version

if args.version:
Expand Down
2 changes: 1 addition & 1 deletion bidskit/bidstree.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, dataset_dir, overwrite=False):
print('Creating file templates required for BIDS compliance')

# Copy BIDS-compliant JSON templates to BIDS directory root
self.copy_template('README.md', 'README.md')
self.copy_template('README', 'README')
self.copy_template('CHANGES', 'CHANGES')
self.copy_template('dataset_description.json', 'dataset_description.json')
self.copy_template('participants.json', 'participants.json')
Expand Down
4 changes: 2 additions & 2 deletions bidskit/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ def parse_dcm2niix_fname(fname):
# Filename format: <PatientName>--<SeriesDescription>--s<SeriesNo>--e<EchoNo>[_ph].<ext>
info['SubjName'] = vals[0]
info['SerDesc'] = vals[1]
info['SerNo'] = np.int(vals[2].replace('s', ''))
info['SerNo'] = int(vals[2].replace('s', ''))

# Check for phase image suffix after echo number (eg "e2_ph")
bits = vals[3].split('_', 1)
info['EchoNo'] = np.int(bits[0].replace('e', ''))
info['EchoNo'] = int(bits[0].replace('e', ''))

# Record any suffix after the echo number key (typically "ph" if anything)
if len(bits) > 1:
Expand Down
2 changes: 1 addition & 1 deletion bidskit/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def acqtime_mins(json_file):
if 'AcquisitionTime' in info:
t1 = dt.datetime.strptime(info['AcquisitionTime'], '%H:%M:%S.%f0')
t0 = dt.datetime(1900, 1, 1)
t_mins = np.float((t1 - t0).total_seconds() / 60.0)
t_mins = float((t1 - t0).total_seconds() / 60.0)
else:
print(f'* WARNING: AcquisitionTime not found in {json_file} (deidentified?)')
print(f'* WARNING: Automatic fieldmap binding will not work correctly')
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion bidskit/templates/bidsignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
exclude/
derivatives/
work/
incoming/
incoming/
*.tar
4 changes: 2 additions & 2 deletions docs/Flywheel.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ folder and build the template BIDS files and folders (Phase 1)
$ bidskit --flywheel <other command line arguments>
```
3. Edit `code/Protocol_Translator.json` manually or use the `--auto` option to autofill the translator file
4. Run bidskit again (Phase 2) to complete the curation
4. Run bidskit again (Phase 2) without the `--flywheel` option to complete the curation
```
$ bidskit --flywheel <other command line arguments>
$ bidskit <other command line arguments>
```
5. Delete the original Flywheel tarball

0 comments on commit 357f003

Please sign in to comment.