omids-validator 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. omids_validator/__init__.py +11 -0
  2. omids_validator/__main__.py +11 -0
  3. omids_validator/acquisition_profiles.py +478 -0
  4. omids_validator/cli.py +185 -0
  5. omids_validator/data/metadata_requirements.json +337 -0
  6. omids_validator/data/rules.json +364 -0
  7. omids_validator/file_types.py +46 -0
  8. omids_validator/inventory.py +133 -0
  9. omids_validator/models.py +60 -0
  10. omids_validator/participant_table.py +128 -0
  11. omids_validator/participants.py +235 -0
  12. omids_validator/patient_metadata.py +150 -0
  13. omids_validator/reporters/__init__.py +1 -0
  14. omids_validator/reporters/html_report.py +607 -0
  15. omids_validator/reporters/json_report.py +74 -0
  16. omids_validator/reporters/markdown_report.py +283 -0
  17. omids_validator/reporters/report_data.py +79 -0
  18. omids_validator/reporters/terminal.py +18 -0
  19. omids_validator/rule_catalog.py +279 -0
  20. omids_validator/rules/__init__.py +5 -0
  21. omids_validator/rules/layer0_structure.py +316 -0
  22. omids_validator/rules/layer1_naming.py +191 -0
  23. omids_validator/rules/layer2_sidecars.py +292 -0
  24. omids_validator/rules/layer3_metadata.py +144 -0
  25. omids_validator/rules/layer4_image_headers.py +152 -0
  26. omids_validator/rules/layer5_dataset.py +261 -0
  27. omids_validator/rules_document.py +192 -0
  28. omids_validator/validator.py +274 -0
  29. omids_validator-0.2.0.dist-info/METADATA +158 -0
  30. omids_validator-0.2.0.dist-info/RECORD +34 -0
  31. omids_validator-0.2.0.dist-info/WHEEL +5 -0
  32. omids_validator-0.2.0.dist-info/entry_points.txt +3 -0
  33. omids_validator-0.2.0.dist-info/licenses/LICENSE +677 -0
  34. omids_validator-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,337 @@
1
+ {
2
+ "schema_version": "0.1",
3
+ "status": "working transcription",
4
+ "source": "ORMIR-MIDS main imaging-method table, supplied by the project owner",
5
+ "notes": [
6
+ "Field names and units reproduce the supplied table and require comparison with the detailed standard and current package output before validation code is implemented.",
7
+ "Expected JSON value types have not yet been assigned.",
8
+ "MRI suffix-specific requirements are incomplete and will be added after review of the MRI-specific tables.",
9
+ "Missing mandatory fields produce MIDS-301 warnings. Missing optional fields produce MIDS-304 information findings.",
10
+ "Draft velocity and strain profiles still inherit mandatory and optional fields from the common MRI profile; only their profile-specific draft fields are not enforced.",
11
+ "Fields marked proposed or draft are not enforced by the current validator."
12
+ ],
13
+ "profiles": {
14
+ "ct": {
15
+ "imaging_method": "Computed tomography: CT",
16
+ "folders": ["ct"],
17
+ "suffixes": ["ct"],
18
+ "image_dimensions": [3],
19
+ "dimension_labels": ["x", "y", "z"],
20
+ "json_fields": [
21
+ {"name": "XRayEnergy", "requirement_status": "mandatory", "unit": "kVp"},
22
+ {"name": "XRayExposure", "requirement_status": "mandatory", "unit": "mAs"}
23
+ ]
24
+ },
25
+ "pcct": {
26
+ "imaging_method": "Computed tomography: PCCT",
27
+ "folders": ["ct"],
28
+ "suffixes": ["pcct"],
29
+ "image_dimensions": [3],
30
+ "dimension_labels": ["x", "y", "z"],
31
+ "json_fields": [
32
+ {"name": "XRayEnergy", "requirement_status": "mandatory", "unit": "kVp"},
33
+ {"name": "XRayExposure", "requirement_status": "mandatory", "unit": "mAs"}
34
+ ]
35
+ },
36
+ "cbct": {
37
+ "imaging_method": "Computed tomography: CBCT",
38
+ "folders": ["ct"],
39
+ "suffixes": ["cbct"],
40
+ "image_dimensions": [3],
41
+ "dimension_labels": ["x", "y", "z"],
42
+ "json_fields": [
43
+ {"name": "XRayEnergy", "requirement_status": "mandatory", "unit": "kVp"}
44
+ ]
45
+ },
46
+ "hrpqct": {
47
+ "imaging_method": "Computed tomography: HR-pQCT",
48
+ "folders": ["ct"],
49
+ "suffixes": ["hrpqct"],
50
+ "image_dimensions": [3],
51
+ "dimension_labels": ["x", "y", "z"],
52
+ "json_fields": [
53
+ {"name": "XRayEnergy", "requirement_status": "mandatory", "unit": "kVp"},
54
+ {"name": "XRayExposure", "requirement_status": "mandatory", "unit": "μAs"},
55
+ {"name": "XRayExposureTime", "requirement_status": "mandatory", "unit": "ms"},
56
+ {"name": "ConvolutionKernel", "requirement_status": "mandatory", "unit": null},
57
+ {"name": "RescaleIntercept", "requirement_status": "mandatory", "unit": null},
58
+ {"name": "RescaleSlope", "requirement_status": "mandatory", "unit": null},
59
+ {"name": "ScancoMuScaling", "requirement_status": "mandatory", "unit": null},
60
+ {"name": "ScancoDensitySlope", "requirement_status": "mandatory", "unit": null},
61
+ {"name": "ScancoDensityIntercept", "requirement_status": "mandatory", "unit": null},
62
+ {"name": "ScancoMuWater", "requirement_status": "mandatory", "unit": null}
63
+ ]
64
+ },
65
+ "cr": {
66
+ "imaging_method": "Plain radiography",
67
+ "folders": ["rx"],
68
+ "suffixes": ["cr"],
69
+ "image_dimensions": [2],
70
+ "dimension_labels": ["x", "y"],
71
+ "json_fields": [
72
+ {"name": "ExposureTime", "requirement_status": "mandatory", "unit": "ms"},
73
+ {"name": "X-RayTubeCurrent", "requirement_status": "mandatory", "unit": "mA"}
74
+ ]
75
+ },
76
+ "mri_common": {
77
+ "imaging_method": "MRI",
78
+ "folders": ["mr-anat", "mr-quant"],
79
+ "suffixes": [],
80
+ "suffix_status": "various; exact recognized suffixes incomplete",
81
+ "image_dimensions": [3, 4, 5],
82
+ "dimension_labels": ["varies by acquisition"],
83
+ "json_fields": [
84
+ {"name": "EchoTime", "requirement_status": "mandatory", "unit": "ms"},
85
+ {"name": "RepetitionTime", "requirement_status": "mandatory", "unit": "ms"},
86
+ {"name": "FlipAngle", "requirement_status": "mandatory", "unit": "degrees"},
87
+ {"name": "RefocusingFlipAngle", "requirement_status": "optional", "unit": "degrees"},
88
+ {"name": "InversionTime", "requirement_status": "optional", "unit": "ms"},
89
+ {"name": "ScanningSequence", "requirement_status": "optional", "unit": null},
90
+ {"name": "SequenceVariant", "requirement_status": "optional", "unit": null},
91
+ {"name": "ScanOptions", "requirement_status": "optional", "unit": null},
92
+ {"name": "SequenceName", "requirement_status": "optional", "unit": null},
93
+ {"name": "MRAcquisitionType", "requirement_status": "optional", "unit": null},
94
+ {"name": "ParallelReductionFactorInPlane", "requirement_status": "optional", "unit": null},
95
+ {"name": "ParallelAcquisitionTechnique", "requirement_status": "optional", "unit": null},
96
+ {"name": "PartialFourier", "requirement_status": "optional", "unit": null},
97
+ {"name": "PartialFourierDirection", "requirement_status": "optional", "unit": null},
98
+ {"name": "PixelBandwidth", "requirement_status": "optional", "unit": "Hz/px"},
99
+ {"name": "Manufacturer", "requirement_status": "optional", "unit": null},
100
+ {"name": "ImagingFrequency", "requirement_status": "optional", "unit": "MHz"},
101
+ {"name": "MagneticFieldStrength", "requirement_status": "optional", "unit": "T"},
102
+ {"name": "ImageType", "requirement_status": "optional", "unit": null},
103
+ {"name": "PhaseEncodingDirection", "requirement_status": "optional", "unit": null}
104
+ ]
105
+ },
106
+ "mri_anatomical_weighted": {
107
+ "imaging_method": "MRI: T1w / T1w-FS / T2w / T2w-FS",
108
+ "folders": ["mr-anat"],
109
+ "suffixes": ["t1w", "t1w-fs", "t2w", "t2w-fs"],
110
+ "inherits_json_fields_from": "mri_common",
111
+ "image_dimensions": [3],
112
+ "dimension_labels": ["x", "y", "z"],
113
+ "json_fields": []
114
+ },
115
+ "mri_quantitative_relaxometry": {
116
+ "imaging_method": "MRI: Quantitative T1 / T2 / wT2",
117
+ "folders": ["mr-quant"],
118
+ "suffixes": ["t1", "t2", "wt2"],
119
+ "inherits_json_fields_from": "mri_common",
120
+ "image_dimensions": [3],
121
+ "dimension_labels": ["x", "y", "z"],
122
+ "json_fields": []
123
+ },
124
+ "mri_other_quantitative": {
125
+ "imaging_method": "MRI: Other recognized quantitative images",
126
+ "folders": ["mr-quant"],
127
+ "suffixes": ["ff", "b0", "b1"],
128
+ "inherits_json_fields_from": "mri_common",
129
+ "image_dimensions": [3, 4, 5],
130
+ "dimension_labels": ["varies by acquisition"],
131
+ "json_fields": [],
132
+ "profile_notes": [
133
+ "These suffixes were already recognized by the validator before the metadata catalogue was introduced; their more specific dimensional and metadata requirements remain to be documented."
134
+ ]
135
+ },
136
+ "mri_dess": {
137
+ "imaging_method": "MRI: DESS",
138
+ "folders": ["mr-anat"],
139
+ "suffixes": ["dess", "dess-fid", "dess_echo"],
140
+ "inherits_json_fields_from": "mri_common",
141
+ "image_dimensions": [3],
142
+ "dimension_labels": ["x", "y", "z"],
143
+ "json_fields": [
144
+ {
145
+ "name": "PulseSequenceType",
146
+ "requirement_status": "mandatory",
147
+ "expected_value": "DESS",
148
+ "unit": null
149
+ }
150
+ ]
151
+ },
152
+ "mri_megre": {
153
+ "imaging_method": "MRI: Multi-echo gradient echo",
154
+ "folders": ["mr-anat"],
155
+ "suffixes": ["megre", "part-phase_megre", "part-real_megre", "part-imag_megre", "megre_reco"],
156
+ "inherits_json_fields_from": "mri_common",
157
+ "image_dimensions": [4],
158
+ "dimension_labels": ["x", "y", "z", "echo"],
159
+ "json_fields": [
160
+ {
161
+ "name": "EchoTime",
162
+ "requirement_status": "mandatory",
163
+ "expected_json_type": "array",
164
+ "unit": "ms"
165
+ },
166
+ {
167
+ "name": "WaterFatShift",
168
+ "requirement_status": "mandatory",
169
+ "unit": "pixels"
170
+ },
171
+ {
172
+ "name": "MagneticFieldStrength",
173
+ "requirement_status": "mandatory",
174
+ "unit": null
175
+ },
176
+ {
177
+ "name": "ReadoutMode",
178
+ "requirement_status": "proposed",
179
+ "allowed_values": ["Monopolar", "Bipolar"],
180
+ "unit": null
181
+ },
182
+ {
183
+ "name": "PrecessionDirection",
184
+ "requirement_status": "proposed",
185
+ "allowed_values": ["Counterclockwise", "Clockwise"],
186
+ "transcription_note": "The source displays Counter-/Clockwise; this expansion into two values requires confirmation.",
187
+ "unit": null
188
+ }
189
+ ]
190
+ },
191
+ "mri_mese": {
192
+ "imaging_method": "MRI: Multi-echo spin echo",
193
+ "folders": ["mr-anat"],
194
+ "suffixes": ["mese", "part-phase_mese"],
195
+ "inherits_json_fields_from": "mri_common",
196
+ "image_dimensions": [4],
197
+ "dimension_labels": ["x", "y", "z", "echo"],
198
+ "json_fields": [
199
+ {
200
+ "name": "EchoTime",
201
+ "requirement_status": "mandatory",
202
+ "expected_json_type": "array",
203
+ "unit": "ms"
204
+ },
205
+ {
206
+ "name": "RefocusingFlipAngle",
207
+ "requirement_status": "mandatory",
208
+ "unit": "degrees"
209
+ },
210
+ {
211
+ "name": "ExcitationProfile",
212
+ "requirement_status": "optional",
213
+ "expected_json_type": "array",
214
+ "unit": "degrees"
215
+ },
216
+ {
217
+ "name": "RefocusingProfile",
218
+ "requirement_status": "optional",
219
+ "expected_json_type": "array",
220
+ "unit": "degrees"
221
+ }
222
+ ]
223
+ },
224
+ "mri_velocity": {
225
+ "imaging_method": "MRI: Velocity quantification",
226
+ "profile_status": "draft",
227
+ "folders": ["mr-quant"],
228
+ "suffixes": ["vel"],
229
+ "inherits_json_fields_from": "mri_common",
230
+ "image_dimensions": [5],
231
+ "dimension_labels": ["x", "y", "z", "t", "direction"],
232
+ "json_fields": [
233
+ {
234
+ "name": "FourthDimension",
235
+ "requirement_status": "draft",
236
+ "expected_value": "TriggerTime",
237
+ "unit": null
238
+ },
239
+ {
240
+ "name": "TriggerTime",
241
+ "requirement_status": "draft",
242
+ "expected_json_type": "array",
243
+ "unit": "ms"
244
+ },
245
+ {
246
+ "name": "FifthDimension",
247
+ "requirement_status": "draft",
248
+ "expected_value": "VelocityEncodingDirection",
249
+ "unit": null
250
+ },
251
+ {
252
+ "name": "VelocityEncodingDirection",
253
+ "requirement_status": "draft",
254
+ "expected_json_type": "array of vectors",
255
+ "unit": null
256
+ },
257
+ {
258
+ "name": "Venc",
259
+ "requirement_status": "draft",
260
+ "expected_json_type": "array",
261
+ "unit": "m/s"
262
+ }
263
+ ],
264
+ "profile_notes": [
265
+ "Volume values store actual velocity in m/s and range from -Venc to +Venc for each encoding direction.",
266
+ "VelocityEncodingDirection contains one vector for each encoded velocity direction; for example [[1,0,0],[0,1,0],[0,0,1]] represents row, column, and slice directions.",
267
+ "Venc records the original value for each volume dimension for velocity-to-noise considerations; the volume data are already scaled for interpretation."
268
+ ]
269
+ },
270
+ "mri_strain_eigenvalues": {
271
+ "imaging_method": "MRI: Strain Eigenvalues",
272
+ "profile_status": "draft",
273
+ "folders": ["mr-quant"],
274
+ "suffixes": ["strain"],
275
+ "inherits_json_fields_from": "mri_common",
276
+ "image_dimensions": [5],
277
+ "dimension_labels": ["x", "y", "z", "t", "ev_order"],
278
+ "json_fields": [
279
+ {"name": "FourthDimension", "requirement_status": "draft", "expected_value": "TriggerTime", "unit": null},
280
+ {"name": "TriggerTime", "requirement_status": "draft", "expected_json_type": "array", "unit": "ms"},
281
+ {"name": "FifthDimension", "requirement_status": "draft", "expected_value": "EigenOrder", "unit": null}
282
+ ]
283
+ },
284
+ "mri_strain_eigenvectors": {
285
+ "imaging_method": "MRI: Strain Eigenvectors",
286
+ "profile_status": "draft",
287
+ "folders": ["mr-quant"],
288
+ "suffixes": ["strain-vec"],
289
+ "inherits_json_fields_from": "mri_common",
290
+ "image_dimensions": [6],
291
+ "dimension_labels": ["x", "y", "z", "t", "ev_order", "vector_component"],
292
+ "json_fields": [
293
+ {"name": "FourthDimension", "requirement_status": "draft", "expected_value": "TriggerTime", "unit": null},
294
+ {"name": "TriggerTime", "requirement_status": "draft", "expected_json_type": "array", "unit": "ms"},
295
+ {"name": "FifthDimension", "requirement_status": "draft", "expected_value": "EigenOrder", "unit": null},
296
+ {"name": "SixthDimension", "requirement_status": "draft", "expected_value": "VectorComponent", "unit": null}
297
+ ]
298
+ },
299
+ "mri_strain_rate_eigenvalues": {
300
+ "imaging_method": "MRI: Strain Rate Eigenvalues",
301
+ "profile_status": "draft",
302
+ "folders": ["mr-quant"],
303
+ "suffixes": ["strain-rate"],
304
+ "inherits_json_fields_from": "mri_common",
305
+ "image_dimensions": [5],
306
+ "dimension_labels": ["x", "y", "z", "t", "ev_order"],
307
+ "json_fields": [
308
+ {"name": "FourthDimension", "requirement_status": "draft", "expected_value": "TriggerTime", "unit": null},
309
+ {"name": "TriggerTime", "requirement_status": "draft", "expected_json_type": "array", "unit": "ms"},
310
+ {"name": "FifthDimension", "requirement_status": "draft", "expected_value": "EigenOrder", "unit": null}
311
+ ]
312
+ },
313
+ "mri_strain_rate_eigenvectors": {
314
+ "imaging_method": "MRI: Strain Rate Eigenvectors",
315
+ "profile_status": "draft",
316
+ "folders": ["mr-quant"],
317
+ "suffixes": ["strain-rate-vec"],
318
+ "inherits_json_fields_from": "mri_common",
319
+ "image_dimensions": [6],
320
+ "dimension_labels": ["x", "y", "z", "t", "ev_order", "vector_component"],
321
+ "json_fields": [
322
+ {"name": "FourthDimension", "requirement_status": "draft", "expected_value": "TriggerTime", "unit": null},
323
+ {"name": "TriggerTime", "requirement_status": "draft", "expected_json_type": "array", "unit": "ms"},
324
+ {"name": "FifthDimension", "requirement_status": "draft", "expected_value": "EigenOrder", "unit": null},
325
+ {"name": "SixthDimension", "requirement_status": "draft", "expected_value": "VectorComponent", "unit": null}
326
+ ]
327
+ }
328
+ },
329
+ "shared_semantics": {
330
+ "eigen_order": [
331
+ "First Eigenvalue/Eigenvector: largest positive eigenvalue.",
332
+ "Second Eigenvalue/Eigenvector: largest negative eigenvalue.",
333
+ "Third Eigenvalue/Eigenvector: remaining eigenvalue."
334
+ ],
335
+ "vector_component_reference": "Vector components use the same reference system as the volume."
336
+ }
337
+ }