55
55
</div >
56
56
<div v-if =" ss" >
57
57
<h5 >BIDS Datatype, Suffix, Entities</h5 >
58
- <!-- <pre>{{ getFieldsMetaData(ss.type) }}</pre> -->
59
58
<el-form label-width =" 150px" >
60
59
<el-alert v-if =" ss.message" :title =" ss.message" type =" info" show-icon style =" margin-bottom : 4px " />
61
60
<div style =" margin-bottom : 10px " >
122
121
</template >
123
122
</el-popover >
124
123
</el-form-item >
125
- <!-- <p style="border-top: 1px solid #eee; padding: 10px 20px;">
126
- <small>The following metadata fields are required, recommoneded, or optional for this datatype/suffix. Please enter missing required information.</small>
127
- <el-form-item v-for="(v, md) in getSomeMetadata(ss.type)" :key="md"
128
- :label="md.toString()+'-'+(v=='required'?' *':'')" label-width="350" style="width: 350px">
129
- <el-popover v-if="bidsSchema.metadata[md]" :width="350"
130
- :title="bidsSchema.metadata[md].name"
131
- :content="bidsSchema.metadata[md].description">
132
- <template #reference>
133
- <el-input v-model="ss.md" size="small" :required="v == 'required'" @change="validateAll()"/>
134
- </template>
135
- </el-popover>
136
- </el-form-item>
137
- <p style="border-top: 1px solid #eee; padding: 10px 20px;"></p>
138
- </p> -->
139
124
</div >
140
125
141
126
<div v-if =" ss.type && (ss.type.startsWith('fmap/') || ss.type === 'perf/m0scan')" >
241
226
ss.type.startsWith('pet') ||
242
227
ss.type.startsWith('func') ||
243
228
ss.type.startsWith('fmap') ||
244
- ss.type.startsWith('dwi')
229
+ ss.type.startsWith('dwi') ||
230
+ ss.type.startsWith('anat') ||
231
+ ss.type.startsWith('meg')
245
232
"
246
233
label =" Relevant Metadata"
247
234
>
@@ -316,17 +303,22 @@ import { prettyBytes } from './filters';
316
303
317
304
import { Series , IObject } from ' ./store' ;
318
305
319
- import { validateEntities , validate_B0FieldIdentifier_B0FieldSource } from ' ./libUnsafe' ;
306
+ import { validateEntities , validate_B0FieldIdentifier_B0FieldSource , metadataAlerts } from ' ./libUnsafe' ;
307
+ import anatYaml from ' ../src/assets/schema/rules/sidecars/anat.yaml' ;
308
+ import funcYaml from ' ../src/assets/schema/rules/sidecars/func.yaml' ;
309
+ import fmapYaml from ' ../src/assets/schema/rules/sidecars/fmap.yaml' ;
310
+ import dwiYaml from ' ../src/assets/schema/rules/sidecars/dwi.yaml' ;
320
311
import aslYaml from ' ../src/assets/schema/rules/sidecars/asl.yaml' ;
321
312
import petYaml from ' ../src/assets/schema/rules/sidecars/pet.yaml' ;
322
- import metadata_types from ' ../src/assets/schema/rules/sidecars/metadata_types.yaml' ;
313
+ import megYaml from ' ../src/assets/schema/rules/sidecars/meg.yaml' ;
314
+ import metadataInfo from ' ../src/assets/schema/rules/sidecars/metadata.yaml' ;
315
+
323
316
import AsyncImageLink from ' ./components/AsyncImageLink.vue' ;
324
317
325
318
// @ts-ignore
326
319
import { Splitpanes , Pane } from ' splitpanes' ;
327
320
328
321
import ' splitpanes/dist/splitpanes.css' ;
329
- import axios from ' ./axios.instance' ;
330
322
331
323
export default defineComponent ({
332
324
components: {
@@ -342,8 +334,7 @@ export default defineComponent({
342
334
return {
343
335
showInfo: {} as any ,
344
336
ss: null as Series | null , // selected series
345
- petYaml: petYaml ,
346
- aslYaml: aslYaml ,
337
+ metadataAlertsFields: [] as any ,
347
338
fields: {},
348
339
showDialog: false ,
349
340
rules: {},
@@ -390,6 +381,42 @@ export default defineComponent({
390
381
validate_B0FieldIdentifier_B0FieldSource (s );
391
382
}
392
383
384
+ /* Alert users to metadata issues, such as missing required fields or
385
+ improperly-formmated metadata field values.
386
+ */
387
+ let bidsDatatypeMetadata = {};
388
+ if ([' perf/asl' , ' perf/m0scan' ].includes (s .type )) {
389
+ bidsDatatypeMetadata = aslYaml ;
390
+ } else if (s .type .startsWith (' pet' )) {
391
+ bidsDatatypeMetadata = petYaml ;
392
+ } else if (s .type .startsWith (' func' )) {
393
+ bidsDatatypeMetadata = funcYaml ;
394
+ } else if (s .type .startsWith (' fmap' )) {
395
+ bidsDatatypeMetadata = fmapYaml ;
396
+ } else if (s .type .startsWith (' dwi' )) {
397
+ bidsDatatypeMetadata = dwiYaml ;
398
+ } else if (s .type .startsWith (' anat' )) {
399
+ bidsDatatypeMetadata = anatYaml ;
400
+ } else if (s .type .startsWith (' meg' )) {
401
+ bidsDatatypeMetadata = megYaml ;
402
+ }
403
+
404
+ const metadataAlertsFields = metadataAlerts (
405
+ bidsDatatypeMetadata ,
406
+ metadataInfo ,
407
+ this .ezbids ,
408
+ s .series_idx ,
409
+ s .type
410
+ );
411
+ // console.log(s.type);
412
+ // console.log('metadataAlertsFields', metadataAlertsFields);
413
+ if (metadataAlertsFields .length ) {
414
+ let warn: string = ` 'Required metadata is missing and/or provided metadata field values have improper
415
+ format. Please click on the "Edit Metadata" button below to resolve. You may skip fields for which you
416
+ do not know the proper value, but you will not have a fully BIDS-compliant dataset.' ` ;
417
+ s .validationWarnings .push (warn );
418
+ }
419
+
393
420
// DON'T REALLY NEED THIS if setRun() functionality is in place
394
421
395
422
// //let user know if multiple series have same datatype and entity labels
@@ -465,13 +492,6 @@ export default defineComponent({
465
492
});
466
493
}
467
494
}
468
-
469
- // Alert users to check relevant metadata ("Edit Metadata" button for any perf sequences)
470
- if (s .type .startsWith (' perf/' ) || s .type .startsWith (' pet/' )) {
471
- s .validationWarnings .push (
472
- " Please check to ensure that all necessary metadata is provided, by clicking on the 'Edit Metadata' button below"
473
- );
474
- }
475
495
},
476
496
477
497
isValid(cb : (v ? : string ) => void ) {
@@ -490,6 +510,7 @@ export default defineComponent({
490
510
submitForm(data : any ) {
491
511
// TODO: should we make an interface for data in store/index.ts?
492
512
this .ezbids = data ;
513
+ this .ezbids .series .forEach (this .validate );
493
514
},
494
515
},
495
516
});
0 commit comments