Skip to content

Commit f473e76

Browse files
committed
made ezbids formatting conditional, formatted code with black
1 parent 9c1ea19 commit f473e76

File tree

8 files changed

+1010
-921
lines changed

8 files changed

+1010
-921
lines changed

pypet2bids/poetry.lock

Lines changed: 971 additions & 397 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pypet2bids/pypet2bids/dcm2niix4pet.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def __init__(
175175
file_format="%p_%i_%t_%s",
176176
silent=False,
177177
tempdir_location=None,
178-
ezbids=False
178+
ezbids=False,
179179
):
180180
"""
181181
This class is a simple wrapper for dcm2niix and contains methods to do the following in order:
@@ -216,7 +216,7 @@ def __init__(
216216
self.blood_json = None
217217
self.blood_tsv = None
218218
self.telemetry_data = {}
219-
self.ezbids=ezbids
219+
self.ezbids = ezbids
220220
self.dcm2niix_path = self.check_for_dcm2niix()
221221
if not self.dcm2niix_path:
222222
logger.error(
@@ -763,9 +763,11 @@ def run_dcm2niix(self):
763763
if self.session_id:
764764
collection_of_fields["ses"] = self.session_id
765765

766-
hash_string = helper_functions.hash_fields(**collection_of_fields)
767-
768-
sidecar_json.update({"SeriesDescription": hash_string})
766+
if self.ezbids:
767+
hash_string = helper_functions.hash_fields(
768+
**collection_of_fields
769+
)
770+
sidecar_json.update({"SeriesDescription": hash_string})
769771

770772
# if there's a subject id rename the output file to use it
771773
if self.subject_id:
@@ -1170,7 +1172,7 @@ def cli():
11701172
action="store_true",
11711173
default=False,
11721174
help="Add fields to json output that are useful for ezBIDS or other conversion software. This will de-anonymize"
1173-
" pet2bids output and add AcquisitionDate an AcquisitionTime into the output json."
1175+
" pet2bids output and add AcquisitionDate an AcquisitionTime into the output json.",
11741176
)
11751177
return parser
11761178

0 commit comments

Comments
 (0)