Skip to content

Commit fd764f3

Browse files
committed
Minor tweaks
1 parent 0ab34c3 commit fd764f3

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

bidscoin/bids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ def poolmetadata(datasource: DataSource, targetmeta: Path, usermeta: Meta, metae
20752075
LOGGER.bcdebug(f"Adding '{metakey}: {metaval}' to: {targetmeta}")
20762076
metapool[metakey] = metaval or None
20772077

2078-
# Update <<session_id>> in B0FieldIdentifiers/Sources. NB: Leave range specifiers (<<session_id:[-2:2]>>) untouched (-> bidscoiner)
2078+
# Update <<session_id>> in B0FieldIdentifiers/Sources. NB: Leave range specifiers (<<session_id:[-2:2]>>) untouched until all data is present (-> bidscoiner -> addmetadata)
20792079
sesid = get_bidsvalue(targetmeta, 'ses')
20802080
for key in ('B0FieldSource', 'B0FieldIdentifier'):
20812081

bidscoin/heuristics/bidsmap_dccn.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ DICOM:
5757
age<<session_id>>: &age
5858
value: <<PatientAge>>
5959
meta:
60-
Description: Age of the participant
60+
Description: Age of the participant at the time of the acquired session
6161
Units: year
6262
sex: &sex
6363
value: <<PatientSex>>

bidscoin/heuristics/bidsmap_sst.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ DICOM:
4646
# ------------------------------------------------------------------
4747
participant: # Attributes or properties to populate the participants tsv/json files
4848
participant_id: &participant_id
49-
value: <<filepath:/sub-(.*?)/>> # This filesystem property extracts the subject label from the source directory. NB: Any property or attribute can be used as subject-label, e.g. <PatientID>
50-
meta: # All data in "meta" is stored in the participants json sidecar-file
49+
value: <<filepath:/sub-(.*?)/>> # This filesystem property extracts the subject label from the source directory. NB: Any property or attribute can be used as subject-label, e.g. <PatientID>
50+
meta: # All data in "meta" is stored in the participants json sidecar-file
5151
Description: The unique participant identifier of the form sub-<label>, matching a participant entity found in the dataset
5252
session_id: &session_id
5353
value: <<filepath:/sub-.*?/ses-\.\.\.(.*?)/>> # This filesystem property extracts the session label from the source directory. NB: Any property or attribute can be used as session-label, e.g. <StudyID>
5454
meta:
5555
Description: The session identifier of the form ses-<label>, matching a session found in the dataset
56-
age: &age
56+
age<<session_id>>: &age
5757
value: <<PatientAge>>
5858
meta:
59-
Description: Age of the participant
59+
Description: Age of the participant at the time of the acquired session
6060
Units: year
6161
sex: &sex
6262
value: <<PatientSex>>

bidscoin/utilities/dicomsort.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def sortsession(sessionfolder: Path, dicomfiles: list[Path], folderscheme: str,
9898
sessionfolder.mkdir(parents=True, exist_ok=True)
9999

100100
# Sort the dicomfiles in (e.g. DICOM Series) subfolders
101-
for dicomfile in dicomfiles:
101+
for n, dicomfile in enumerate(dicomfiles):
102102

103103
# Check if the DICOM file exists (e.g. in case of DICOMDIRs this may not be the case)
104104
if not dicomfile.is_file():
@@ -120,7 +120,8 @@ def sortsession(sessionfolder: Path, dicomfiles: list[Path], folderscheme: str,
120120
return
121121
destination = sessionfolder/subfolder
122122
if not destination.is_dir():
123-
LOGGER.verbose(f" Creating: {destination}")
123+
sorted = int(100 * n / len(dicomfiles))
124+
LOGGER.verbose(f"[{sorted}%] Creating: {destination}")
124125
if not dryrun:
125126
destination.mkdir(parents=True)
126127

0 commit comments

Comments
 (0)