Skip to content

Module dcm2bids.utils.scaffold⚓︎

View Source
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# -*- coding: utf-8 -*-

class bids_starter_kit(object):

    CHANGES = """Revision history for your dataset

1.0.0 DATE

 - Initialized study directory

 """

    dataset_description = """{

    "Name": "",

    "BIDSVersion": "BIDS_VERSION",

    "License": "",

    "Authors": [

        ""

    ],

    "Acknowledgments": "",

    "HowToAcknowledge": "",

    "Funding": [

        ""

    ],

    "ReferencesAndLinks": [

        ""

    ],

    "DatasetDOI": ""

}

"""

    participants_json = """{

    "age": {

        "LongName": "",

        "Description": "age of the participant",

        "Units": "years"

    },

    "sex": {

        "LongName": "",

        "Description": "sex of the participant as reported by the participant",

        "Levels": {

            "M": "male",

            "F": "female"

        }

    },

    "group": {

        "LongName": "",

        "Description": "experimental group the participant belonged to",

        "Levels": {

            "control": "control",

            "patient": "patient"

        }

    }

}

"""

    participants_tsv = """participant_id    age sex group

sub-01  34  M   control

sub-02  12  F   control

sub-03  33  F   patient

"""

    README = """# README

The README is usually the starting point for researchers using your data

and serves as a guidepost for users of your data. A clear and informative

README makes your data much more usable.

In general you can include information in the README that is not captured by some other

files in the BIDS dataset (dataset_description.json, events.tsv, ...).

It can also be useful to also include information that might already be

present in another file of the dataset but might be important for users to be aware of

before preprocessing or analysing the data.

If the README gets too long you have the possibility to create a `/doc` folder

and add it to the `.bidsignore` file to make sure it is ignored by the BIDS validator.

More info here: https://neurostars.org/t/where-in-a-bids-dataset-should-i-put-notes-about-individual-mri-acqusitions/17315/3

## Details related to access to the data

- [ ] Data user agreement

If the dataset requires a data user agreement, link to the relevant information.

- [ ] Contact person

Indicate the name and contact details (email and ORCID) of the person responsible for additional information.

- [ ] Practical information to access the data

If there is any special information related to access rights or

how to download the data make sure to include it.

For example, if the dataset was curated using datalad,

make sure to include the relevant section from the datalad handbook:

http://handbook.datalad.org/en/latest/basics/101-180-FAQ.html#how-can-i-help-others-get-started-with-a-shared-dataset

## Overview

- [ ] Project name (if relevant)

- [ ] Year(s) that the project ran

If no `scans.tsv` is included, this could at least cover when the data acquisition

starter and ended. Local time of day is particularly relevant to subject state.

- [ ] Brief overview of the tasks in the experiment

A paragraph giving an overview of the experiment. This should include the

goals or purpose and a discussion about how the experiment tries to achieve

these goals.

- [ ] Description of the contents of the dataset

An easy thing to add is the output of the bids-validator that describes what type of

data and the number of subject one can expect to find in the dataset.

- [ ] Independent variables

A brief discussion of condition variables (sometimes called contrasts

or independent variables) that were varied across the experiment.

- [ ] Dependent variables

A brief discussion of the response variables (sometimes called the

dependent variables) that were measured and or calculated to assess

the effects of varying the condition variables. This might also include

questionnaires administered to assess behavioral aspects of the experiment.

- [ ] Control variables

A brief discussion of the control variables --- that is what aspects

were explicitly controlled in this experiment. The control variables might

include subject pool, environmental conditions, set up, or other things

that were explicitly controlled.

- [ ] Quality assessment of the data

Provide a short summary of the quality of the data ideally with descriptive statistics if relevant

and with a link to more comprehensive description (like with MRIQC) if possible.

## Methods

### Subjects

A brief sentence about the subject pool in this experiment.

Remember that `Control` or `Patient` status should be defined in the `participants.tsv`

using a group column.

- [ ] Information about the recruitment procedure

- [ ] Subject inclusion criteria (if relevant)

- [ ] Subject exclusion criteria (if relevant)

### Apparatus

A summary of the equipment and environment setup for the

experiment. For example, was the experiment performed in a shielded room

with the subject seated in a fixed position.

### Initial setup

A summary of what setup was performed when a subject arrived.

### Task organization

How the tasks were organized for a session.

This is particularly important because BIDS datasets usually have task data

separated into different files.)

- [ ] Was task order counter-balanced?

- [ ] What other activities were interspersed between tasks?

- [ ] In what order were the tasks and other activities performed?

### Task details

As much detail as possible about the task and the events that were recorded.

### Additional data acquired

A brief indication of data other than the

imaging data that was acquired as part of this experiment. In addition

to data from other modalities and behavioral data, this might include

questionnaires and surveys, swabs, and clinical information. Indicate

the availability of this data.

This is especially relevant if the data are not included in a `phenotype` folder.

https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#phenotypic-and-assessment-data

### Experimental location

This should include any additional information regarding the

the geographical location and facility that cannot be included

in the relevant json files.

### Missing data

Mention something if some participants are missing some aspects of the data.

This can take the form of a processing log and/or abnormalities about the dataset.

Some examples:

- A brain lesion or defect only present in one participant

- Some experimental conditions missing on a given run for a participant because

  of some technical issue.

- Any noticeable feature of the data for certain participants

- Differences (even slight) in protocol for certain participants.

### Notes

Any additional information or pointers to information that

might be helpful to users of the dataset. Include qualitative information

related to how the data acquisition went.

"""

Classes⚓︎

bids_starter_kit⚓︎

1
2
3
4
5
class bids_starter_kit(
    /,
    *args,
    **kwargs
)
View Source
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
class bids_starter_kit(object):

    CHANGES = """Revision history for your dataset

1.0.0 DATE

 - Initialized study directory

 """

    dataset_description = """{

    "Name": "",

    "BIDSVersion": "BIDS_VERSION",

    "License": "",

    "Authors": [

        ""

    ],

    "Acknowledgments": "",

    "HowToAcknowledge": "",

    "Funding": [

        ""

    ],

    "ReferencesAndLinks": [

        ""

    ],

    "DatasetDOI": ""

}

"""

    participants_json = """{

    "age": {

        "LongName": "",

        "Description": "age of the participant",

        "Units": "years"

    },

    "sex": {

        "LongName": "",

        "Description": "sex of the participant as reported by the participant",

        "Levels": {

            "M": "male",

            "F": "female"

        }

    },

    "group": {

        "LongName": "",

        "Description": "experimental group the participant belonged to",

        "Levels": {

            "control": "control",

            "patient": "patient"

        }

    }

}

"""

    participants_tsv = """participant_id    age sex group

sub-01  34  M   control

sub-02  12  F   control

sub-03  33  F   patient

"""

    README = """# README

The README is usually the starting point for researchers using your data

and serves as a guidepost for users of your data. A clear and informative

README makes your data much more usable.

In general you can include information in the README that is not captured by some other

files in the BIDS dataset (dataset_description.json, events.tsv, ...).

It can also be useful to also include information that might already be

present in another file of the dataset but might be important for users to be aware of

before preprocessing or analysing the data.

If the README gets too long you have the possibility to create a `/doc` folder

and add it to the `.bidsignore` file to make sure it is ignored by the BIDS validator.

More info here: https://neurostars.org/t/where-in-a-bids-dataset-should-i-put-notes-about-individual-mri-acqusitions/17315/3

## Details related to access to the data

- [ ] Data user agreement

If the dataset requires a data user agreement, link to the relevant information.

- [ ] Contact person

Indicate the name and contact details (email and ORCID) of the person responsible for additional information.

- [ ] Practical information to access the data

If there is any special information related to access rights or

how to download the data make sure to include it.

For example, if the dataset was curated using datalad,

make sure to include the relevant section from the datalad handbook:

http://handbook.datalad.org/en/latest/basics/101-180-FAQ.html#how-can-i-help-others-get-started-with-a-shared-dataset

## Overview

- [ ] Project name (if relevant)

- [ ] Year(s) that the project ran

If no `scans.tsv` is included, this could at least cover when the data acquisition

starter and ended. Local time of day is particularly relevant to subject state.

- [ ] Brief overview of the tasks in the experiment

A paragraph giving an overview of the experiment. This should include the

goals or purpose and a discussion about how the experiment tries to achieve

these goals.

- [ ] Description of the contents of the dataset

An easy thing to add is the output of the bids-validator that describes what type of

data and the number of subject one can expect to find in the dataset.

- [ ] Independent variables

A brief discussion of condition variables (sometimes called contrasts

or independent variables) that were varied across the experiment.

- [ ] Dependent variables

A brief discussion of the response variables (sometimes called the

dependent variables) that were measured and or calculated to assess

the effects of varying the condition variables. This might also include

questionnaires administered to assess behavioral aspects of the experiment.

- [ ] Control variables

A brief discussion of the control variables --- that is what aspects

were explicitly controlled in this experiment. The control variables might

include subject pool, environmental conditions, set up, or other things

that were explicitly controlled.

- [ ] Quality assessment of the data

Provide a short summary of the quality of the data ideally with descriptive statistics if relevant

and with a link to more comprehensive description (like with MRIQC) if possible.

## Methods

### Subjects

A brief sentence about the subject pool in this experiment.

Remember that `Control` or `Patient` status should be defined in the `participants.tsv`

using a group column.

- [ ] Information about the recruitment procedure

- [ ] Subject inclusion criteria (if relevant)

- [ ] Subject exclusion criteria (if relevant)

### Apparatus

A summary of the equipment and environment setup for the

experiment. For example, was the experiment performed in a shielded room

with the subject seated in a fixed position.

### Initial setup

A summary of what setup was performed when a subject arrived.

### Task organization

How the tasks were organized for a session.

This is particularly important because BIDS datasets usually have task data

separated into different files.)

- [ ] Was task order counter-balanced?

- [ ] What other activities were interspersed between tasks?

- [ ] In what order were the tasks and other activities performed?

### Task details

As much detail as possible about the task and the events that were recorded.

### Additional data acquired

A brief indication of data other than the

imaging data that was acquired as part of this experiment. In addition

to data from other modalities and behavioral data, this might include

questionnaires and surveys, swabs, and clinical information. Indicate

the availability of this data.

This is especially relevant if the data are not included in a `phenotype` folder.

https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#phenotypic-and-assessment-data

### Experimental location

This should include any additional information regarding the

the geographical location and facility that cannot be included

in the relevant json files.

### Missing data

Mention something if some participants are missing some aspects of the data.

This can take the form of a processing log and/or abnormalities about the dataset.

Some examples:

- A brain lesion or defect only present in one participant

- Some experimental conditions missing on a given run for a participant because

  of some technical issue.

- Any noticeable feature of the data for certain participants

- Differences (even slight) in protocol for certain participants.

### Notes

Any additional information or pointers to information that

might be helpful to users of the dataset. Include qualitative information

related to how the data acquisition went.

"""

Class variables⚓︎

1
CHANGES
1
README
1
dataset_description
1
participants_json
1
participants_tsv

Last update: 2024-07-23
Created: 2024-07-23