Skip to content

Commit 95a7dfe

Browse files
committed
[DATALAD RUNCMD] RF: harmonize 'file name' into 'filename'
Text is using both 'file name' and 'filename' pretty much to the equal amount ATM (see git grep outputs below). Code uses 'filename', and wikipedia has https://en.wikipedia.org/wiki/Filename and prefers to use 'filename' in it. So I decided to harmonize into 'filename'. $> git grep 'file name' | grep '\.md' | grep -v MACRO | nl 1 src/02-common-principles.md:1. **File extension** - a portion of the file name after the left-most 2 src/02-common-principles.md:are compulsory. For example a particular file name format is required when 3 src/02-common-principles.md:saved under a particular file name specified in the standard. This standard 4 src/02-common-principles.md:A file name consists of a chain of *entities*, or key-value pairs, a *suffix* and an 5 src/02-common-principles.md:`subject`, the file name MUST begin with the string `sub-<label>_ses-<label>`. 6 src/02-common-principles.md:If the `session` level is omitted in the folder structure, the file name MUST begin 7 src/02-common-principles.md:key/value pair MUST also be included as part of the file names themselves. 8 src/02-common-principles.md:produces a human readable file name, such as `sub-01_task-rest_eeg.edf`. 9 src/02-common-principles.md:It is evident from the file name alone that the file contains resting state 10 src/02-common-principles.md:Entities within a file name MUST be unique. 11 src/02-common-principles.md:For example, the following file name is not valid because it uses the `acq` 12 src/02-common-principles.md:label, but must be included in file names (similarly to other key names). 13 src/02-common-principles.md:meaning of file names and setting requirements on their contents or metadata. 14 src/02-common-principles.md:to suppress warnings or provide interpretations of your file names. 15 src/03-modality-agnostic-files.md:This file is REQUIRED if `sample-<label>` is present in any file name within the dataset. 16 src/04-modality-specific-files/05-task-events.md:Where `<matches>` corresponds to task file name. For example: 17 src/04-modality-specific-files/06-physiological-and-other-continuous-recordings.md:In the template file names, the `<matches>` part corresponds to task file name 18 src/05-derivatives/02-common-data-types.md:is used to prevent clashing with the original file name. 19 src/06-longitudinal-and-multi-site-studies.md:and [file names](02-common-principles.md#file-name-structure) 20 src/99-appendices/03-hed.md:screen or the file name of the stimulus image. 21 src/99-appendices/03-hed.md: "LongName": "Stimulus file name", 22 src/99-appendices/04-entity-table.md:[file name structure](../02-common-principles.md#file-name-structure), 23 src/99-appendices/06-meg-file-formats.md:that not only the file names, but also the internal file pointers will be 24 src/99-appendices/09-entities.md:[file name structure](../02-common-principles.md#file-name-structure). 25 src/CHANGES.md:- \[FIX] Clarify use of session entity in file names [bids-standard#532](bids-standard#532) ([Moo-Marc](https://github.com/Moo-Marc)) 26 src/CHANGES.md:- \[FIX] Specify marker file names for KIT data (MEG) [bids-standard#62](bids-standard#62) ([monkeyman192](https://github.com/monkeyman192)) 27 src/CHANGES.md:- Added missing `sub-<participant_label>` in behavioral data file names. 28 src/pregh-changes.md:- Added missing `sub-<participant_label>` in behavioral data file names. $> git grep 'filename' | grep '\.md' | grep -v MACRO | nl 1 CONTRIBUTING.md:Make sure that all filename format templates, entity tables, and entity definitions are correct 2 src/02-common-principles.md:(with the same filename as the `.nii[.gz]` file, but with a `.json` extension). 3 src/03-modality-agnostic-files.md: "filename": ("REQUIRED", "There MUST be exactly one row for each file."), 4 src/03-modality-agnostic-files.md:filename acq_time 5 src/04-modality-specific-files/02-magnetoencephalography.md:which saves the MEG sensor coil positions in a separate file with two possible filename extensions (`.sqd`, `.mrk`). 6 src/05-derivatives/01-introduction.md: status. Any modification of raw files must use a modified filename that does 7 src/05-derivatives/01-introduction.md: not conflict with the raw filename. Further, any files created as part of a 8 src/05-derivatives/01-introduction.md: derivative dataset must not match a permissible filename of a valid raw 9 src/05-derivatives/01-introduction.md: dataset. Stated equivalently, if any filename in a derivative dataset has a 10 src/05-derivatives/01-introduction.md:- Each Derivatives filename MUST be of the form: 11 src/05-derivatives/01-introduction.md: `source_entities` MUST be the entire source filename, with the omission of 12 src/05-derivatives/01-introduction.md: the source suffix and extension. One exception to this rule is filename 13 src/05-derivatives/01-introduction.md:- There is no prohibition against identical filenames in different derived 14 src/05-derivatives/03-imaging.md:filename. 15 src/99-appendices/04-entity-table.md:specification, and establishes a common order within a filename. 16 src/99-appendices/08-coordinate-systems.md:The `scanner` coordinate system is implicit and assumed by default if the derivative filename does not define **any** `space-<label>`. 17 src/99-appendices/11-qmri.md:filenames will remain the same; however, the optional metadata (third column) may 18 src/CHANGES.md:- \[SCHEMA] Use macro for filename templates in file collections appendix [bids-standard#787](bids-standard#787) ([tsalo](https://github.com/tsalo)) 19 src/CHANGES.md:- \[FIX] Accidentally swapped Neuromag/Elekta/MEGIN cross-talk & fine-calibration filename extensions [bids-standard#621](bids-standard#621) ([hoechenberger](https://github.com/hoechenberger)) 20 src/CHANGES.md:- \[INFRA] SCHEMA: Declare entities by concept names, add entity field for filename components [bids-standard#616](bids-standard#616) ([effigies](https://github.com/effigies)) 21 src/CHANGES.md:- \[FIX] Common principles: Fix filename in inheritance principle [bids-standard#261](bids-standard#261) ([Lestropie](https://github.com/Lestropie)) 22 src/CHANGES.md:- \[FIX] Example for IntendedFor was missing session indicator in the filename [bids-standard#129](bids-standard#129) ([yarikoptic](https://github.com/yarikoptic)) 23 src/schema/README.md:the entity tables, entity definitions, filename templates, and metadata tables. 24 src/schema/README.md:- `entities.yaml`: Entities (key/value pairs in folder and filenames). 25 src/schema/README.md:This file contains a dictionary in which each entity (key/value pair in filenames) is defined. 26 src/schema/README.md:they appear in filenames _and_ their full names. 27 src/schema/README.md:For example, the key for the "Contrast Enhancing Agent" entity, which appears in filenames as `ce-<label>`, 28 src/schema/README.md:since many entities (such as `ce`) have very short filename elements. 29 src/schema/README.md:The `entity` field is the entity as it appears in filenames. For example, the `entity` for `ceagent` is `ce`. 30 src/schema/README.md:Given that all entities appear in filenames, they should all be strings and the `type` field should always be `string`. 31 src/schema/README.md:For example, `run` should have an index, so a valid key-value pair in a filename would be `run-01`. 32 src/schema/README.md:Keys are the filenames (without file extensions), 33 src/schema/README.md:- `datatypes/*.yaml`: Files in the `datatypes` folder contain information about valid filenames within a given datatype. 34 src/schema/README.md: Each dictionary contains a list of suffixes, entities, and file extensions which may constitute a valid BIDS filename. 35 src/schema/README.md:- `entities.yaml`: This file simply defines the order in which entities, when present, MUST appear in filenames. 36 src/schema/README.md:Each dictionary corresponds to a group of suffixes that have the same rules regarding filenames. 37 src/schema/README.md:**NOTE**: The order in which entities appear in these dictionaries does not reflect how they should appear in filenames. 38 src/schema/README.md:This file contains a list of entities in the order in which they must appear in filenames. === Do not change lines below === { "chain": [], "cmd": "bash -c 'git grep -l '\"'\"'file name'\"'\"' | grep '\"'\"'\\.md'\"'\"' | grep -v MACRO | xargs sed -i -e '\"'\"'s,file name,filename,g'\"'\"''", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
1 parent 89115cd commit 95a7dfe

12 files changed

+28
-28
lines changed

src/02-common-principles.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ misunderstanding we clarify them here.
118118
the final `_`), right before the **File extension**, for example, it is `eeg` in
119119
`sub-05_task-matchingpennies_eeg.vhdr`.
120120

121-
1. **File extension** - a portion of the file name after the left-most
121+
1. **File extension** - a portion of the filename after the left-most
122122
period (`.`) preceded by any other alphanumeric. For example, `.gitignore` does
123123
not have a file extension, but the file extension of `test.nii.gz` is `.nii.gz`.
124124
Note that the left-most period is included in the file extension.
@@ -133,10 +133,10 @@ misunderstanding we clarify them here.
133133

134134
The following standard describes a way of arranging data and writing down
135135
metadata for a subset of neuroimaging experiments. Some aspects of the standard
136-
are compulsory. For example a particular file name format is required when
136+
are compulsory. For example a particular filename format is required when
137137
storing structural scans. Some aspects are regulated but optional. For example a
138138
T2 volume does not need to be included, but when it is available it should be
139-
saved under a particular file name specified in the standard. This standard
139+
saved under a particular filename specified in the standard. This standard
140140
aspires to describe a majority of datasets, but acknowledges that there will be
141141
cases that do not fit. In such cases one can include additional files and
142142
subfolders to the existing folder structure following common sense. For example
@@ -149,13 +149,13 @@ specification.
149149

150150
## File name structure
151151

152-
A file name consists of a chain of *entities*, or key-value pairs, a *suffix* and an
152+
A filename consists of a chain of *entities*, or key-value pairs, a *suffix* and an
153153
*extension*.
154154
Two prominent examples of entities are `subject` and `session`.
155155

156156
For a data file that was collected in a given `session` from a given
157-
`subject`, the file name MUST begin with the string `sub-<label>_ses-<label>`.
158-
If the `session` level is omitted in the folder structure, the file name MUST begin
157+
`subject`, the filename MUST begin with the string `sub-<label>_ses-<label>`.
158+
If the `session` level is omitted in the folder structure, the filename MUST begin
159159
with the string `sub-<label>`, without `ses-<label>`.
160160

161161
Note that `sub-<label>` corresponds to the `subject` entity because it has
@@ -169,19 +169,19 @@ be added for all subjects if at least one subject in the dataset has more than
169169
one session.
170170
If a `/ses-<label>` subfolder is included as part of the directory hierarchy,
171171
then the same [`ses-<label>`](./99-appendices/09-entities.md#ses)
172-
key/value pair MUST also be included as part of the file names themselves.
172+
key/value pair MUST also be included as part of the filenames themselves.
173173
Acquisition time of session can
174174
be defined in the [sessions file](03-modality-agnostic-files.md#sessions-file).
175175

176176
A chain of entities, followed by a suffix, connected by underscores (`_`)
177-
produces a human readable file name, such as `sub-01_task-rest_eeg.edf`.
178-
It is evident from the file name alone that the file contains resting state
177+
produces a human readable filename, such as `sub-01_task-rest_eeg.edf`.
178+
It is evident from the filename alone that the file contains resting state
179179
data from subject `01`.
180180
The suffix `eeg` and the extension `.edf` depend on the imaging modality and
181181
the data format and indicate further details of the file's contents.
182182

183-
Entities within a file name MUST be unique.
184-
For example, the following file name is not valid because it uses the `acq`
183+
Entities within a filename MUST be unique.
184+
For example, the following filename is not valid because it uses the `acq`
185185
entity twice:
186186
`sub-01_acq-laser_acq-uneven_electrodes.tsv`
187187

@@ -658,7 +658,7 @@ of `<index>`es.
658658
Please note that a given label or index is distinct from the "prefix"
659659
it refers to. For example `sub-01` refers to the `sub` entity (a
660660
subject) with the label `01`. The `sub-` prefix is not part of the subject
661-
label, but must be included in file names (similarly to other key names).
661+
label, but must be included in filenames (similarly to other key names).
662662

663663
## Uniform Resource Indicator
664664

@@ -816,10 +816,10 @@ For example, an ASSET calibration scan might be named
816816

817817
Non-standard files and directories should be named with care.
818818
Future BIDS efforts may standardize new entities and suffixes, changing the
819-
meaning of file names and setting requirements on their contents or metadata.
819+
meaning of filenames and setting requirements on their contents or metadata.
820820
Validation and parsing tools MAY treat the presence of non-standard files and
821821
directories as an error, so consult the details of these tools for mechanisms
822-
to suppress warnings or provide interpretations of your file names.
822+
to suppress warnings or provide interpretations of your filenames.
823823

824824
<!-- Link Definitions -->
825825

src/03-modality-agnostic-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ samples.json
259259
```
260260

261261
The purpose of this file is to describe properties of samples, indicated by the `sample` entity.
262-
This file is REQUIRED if `sample-<label>` is present in any file name within the dataset.
262+
This file is REQUIRED if `sample-<label>` is present in any filename within the dataset.
263263
Each sample MUST be described by one and only one row.
264264

265265
{{ MACROS___make_columns_table(

src/04-modality-specific-files/05-task-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sub-<label>/[ses-<label>]
2020
<matches>_events.json
2121
```
2222

23-
Where `<matches>` corresponds to task file name. For example:
23+
Where `<matches>` corresponds to task filename. For example:
2424
`sub-control01_task-nback`.
2525

2626
Each task events file REQUIRES a corresponding task data file.

src/04-modality-specific-files/06-physiological-and-other-continuous-recordings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ For the template directory name, `<datatype>` can correspond to any data
2424
recording modality, for example `func`, `anat`, `dwi`, `meg`, `eeg`, `ieeg`,
2525
or `beh`.
2626

27-
In the template file names, the `<matches>` part corresponds to task file name
27+
In the template filenames, the `<matches>` part corresponds to task filename
2828
before the suffix.
2929
For example for the file `sub-control01_task-nback_run-1_bold.nii.gz`,
3030
`<matches>` would correspond to `sub-control01_task-nback_run-1`.

src/05-derivatives/02-common-data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ share the following (non-required) ones:
2626
Preprocessed `bold` NIfTI file in the original coordinate space of the original run.
2727
The location of the file in the original datasets is encoded in the `RawSources` metadata,
2828
and [`_desc-<label>`](../99-appendices/09-entities.md#desc)
29-
is used to prevent clashing with the original file name.
29+
is used to prevent clashing with the original filename.
3030

3131
{{ MACROS___make_filetree_example(
3232
{

src/06-longitudinal-and-multi-site-studies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Longitudinal and multi-site studies
22

33
Multiple sessions (visits) are encoded by adding an extra layer of directories
4-
and [file names](02-common-principles.md#file-name-structure)
4+
and [filenames](02-common-principles.md#file-name-structure)
55
in the form of a session (for example `ses-<label>`) and
66
with a [`*_sessions.tsv` file](03-modality-agnostic-files.md#sessions-file).
77

src/99-appendices/03-hed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Example: An accompanying `*_events.json` sidecar describing the `mycodes` catego
104104

105105
Each column of `*_events.tsv` containing non-categorical values usually represents a
106106
particular type of data, for example the `speed` of a stimulus object across the
107-
screen or the file name of the stimulus image.
107+
screen or the filename of the stimulus image.
108108
These variables could be annotated in the HED column of `*_events.tsv`.
109109
However, that approach requires repeating the values appearing in the individual
110110
columns in the HED column.
@@ -155,7 +155,7 @@ Example: An accompanying `*_events.json` sidecar describing both categorical and
155155
"HED": "Attribute/Response start delay/# ms, Action/Button press"
156156
},
157157
"stim_file": {
158-
"LongName": "Stimulus file name",
158+
"LongName": "Stimulus filename",
159159
"Description": "Relative path of the stimulus image file",
160160
"HED": "Attribute/File/#"
161161
}

src/99-appendices/04-entity-table.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Entity formats indicate whether the value is alphanumeric
1010
(`<label>`) or numeric (`<index>`).
1111

1212
A general introduction to entities is given in the section on
13-
[file name structure](../02-common-principles.md#file-name-structure),
13+
[filename structure](../02-common-principles.md#file-name-structure),
1414
while entity definitions are in [Appendix IX](09-entities.md).
1515

1616
<!--

src/99-appendices/06-meg-file-formats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Each of these files has an internal pointer to the next file.
187187
This is important when renaming these split recordings to the BIDS convention.
188188
Instead of a simple renaming, files should be read in and saved under their new
189189
names with dedicated tools like [MNE](https://mne.tools), which will ensure
190-
that not only the file names, but also the internal file pointers will be
190+
that not only the filenames, but also the internal file pointers will be
191191
updated.
192192

193193
It is RECOMMENDED that FIFF files with multiple parts use the `split-<index>`

src/99-appendices/09-entities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This section compiles the entities (key-value pairs) described throughout this
44
specification, and describes each.
55

66
A general introduction to entities is given in the section on
7-
[file name structure](../02-common-principles.md#file-name-structure).
7+
[filename structure](../02-common-principles.md#file-name-structure).
88

99
The ordering of entities, and whether each is OPTIONAL, REQUIRED, or MUST NOT
1010
be specified for a given file type, is specified in the [Entity Table](04-entity-table.md).

0 commit comments

Comments
 (0)