Skip to content

Commit 804d196

Browse files
author
Dan Levitas
committed
[FIX] Remove B0FieldIdentifier/Source from MEG and PET data
1 parent 4dc3d28 commit 804d196

File tree

4 files changed

+72
-54
lines changed

4 files changed

+72
-54
lines changed

handler/convert_meg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import sys
1818
import json
19-
from datetime import datetime
2019
from mne.io import read_raw
20+
from datetime import datetime
2121
from mne_bids import (BIDSPath, write_raw_bids)
2222

2323
# Begin:

ui/src/Objects.vue

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -233,65 +233,70 @@
233233
<div v-if="so._type && !so._type.includes('exclude')" class="border-top">
234234
<br />
235235
<div v-if="!so._type.includes('events')" class="border-top">
236-
<el-form-item label="B0FieldIdentifier">
237-
<el-select
238-
v-model="so.B0FieldIdentifier"
239-
multiple
240-
filterable
241-
allow-create
242-
default-first-option
243-
placeholder="Enter text string"
244-
size="small"
245-
style="width: 100%"
246-
@change="update(so)"
247-
>
248-
</el-select>
249-
</el-form-item>
250-
<p style="margin-left: 200px">
251-
<small
252-
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used for
253-
fieldmap correction, enter a text string of your choice. A good formatting
254-
suggestion is the "datatype_suffix[index]" format (e.g., <b>fmap_epi0</b>,
255-
<b>fmap_phasediff1</b>, etc). If another sequence will be used with this one for
256-
fieldmap correction, use the exact same text string there as well. Leave field blank
257-
if unclear.</small
258-
>
259-
</p>
236+
<div v-if="!so._type.startsWith('meg') && !so._type.startsWith('pet')" class="border-top">
237+
<el-form-item label="B0FieldIdentifier">
238+
<el-select
239+
v-model="so.B0FieldIdentifier"
240+
multiple
241+
filterable
242+
allow-create
243+
default-first-option
244+
placeholder="Enter text string"
245+
size="small"
246+
style="width: 100%"
247+
@change="update(so)"
248+
>
249+
</el-select>
250+
</el-form-item>
251+
<p style="margin-left: 200px">
252+
<small
253+
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used
254+
fieldmap correction, enter a text string of your choice. A good formatting
255+
suggestion is the "datatype_suffix[index]" format (e.g., <b>fmap_epi0</b>,
256+
<b>fmap_phasediff1</b>, etc). If another sequence will be used with this one for
257+
fieldmap correction, use the exact same text string there as well. Leave field
258+
if unclear.</small
259+
>
260+
</p>
261+
</div>
260262
</div>
261263

262264
<br />
263265
<div v-if="!so._type.includes('events')" class="border-top">
264-
<el-form-item label="B0FieldSource">
265-
<el-select
266-
v-model="so.B0FieldSource"
267-
multiple
268-
filterable
269-
allow-create
270-
default-first-option
271-
placeholder="Enter text string"
272-
size="small"
273-
style="width: 100%"
274-
@change="update(so)"
275-
>
276-
</el-select>
277-
</el-form-item>
278-
<p style="margin-left: 200px">
279-
<small
280-
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used for
281-
fieldmap correction, enter a text string of your choice. A good formatting
282-
suggestion is the "datatype_suffix" format (e.g., fmap_epi, fmap_phasediff). If
283-
another sequence will be used with this one for fieldmap correction, use the exact
284-
same text string there as well. Leave field blank if unclear.</small
285-
>
286-
</p>
266+
<div v-if="!so._type.startsWith('meg') && !so._type.startsWith('pet')" class="border-top">
267+
<el-form-item label="B0FieldSource">
268+
<el-select
269+
v-model="so.B0FieldSource"
270+
multiple
271+
filterable
272+
allow-create
273+
default-first-option
274+
placeholder="Enter text string"
275+
size="small"
276+
style="width: 100%"
277+
@change="update(so)"
278+
>
279+
</el-select>
280+
</el-form-item>
281+
<p style="margin-left: 200px">
282+
<small
283+
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used
284+
fieldmap correction, enter a text string of your choice. A good formatting
285+
suggestion is the "datatype_suffix" format (e.g., fmap_epi, fmap_phasediff). If
286+
another sequence will be used with this one for fieldmap correction, use the
287+
same text string there as well. Leave field blank if unclear.</small
288+
>
289+
</p>
290+
</div>
287291
<el-form-item
288292
v-if="
289293
['perf/asl', 'perf/m0scan'].includes(so._type) ||
290294
so._type.startsWith('pet') ||
291295
so._type.startsWith('func') ||
292296
so._type.startsWith('fmap') ||
293297
so._type.startsWith('dwi') ||
294-
so._type.startsWith('anat')
298+
so._type.startsWith('anat') ||
299+
so._type.startsWith('meg')
295300
"
296301
label="Relevant Metadata"
297302
>

ui/src/SeriesPage.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,14 @@
153153
</el-form-item>
154154
</div>
155155

156-
<div v-if="ss.type && !ss.type.includes('exclude')">
156+
<div
157+
v-if="
158+
ss.type &&
159+
!ss.type.includes('exclude') &&
160+
!ss.type.startsWith('meg') &&
161+
!ss.type.startsWith('pet')
162+
"
163+
>
157164
<el-form-item label="B0FieldIdentifier" prop="B0FieldIdentifier">
158165
<el-select
159166
v-model="ss.B0FieldIdentifier"
@@ -408,7 +415,7 @@ export default defineComponent({
408415
s.series_idx,
409416
s.type
410417
);
411-
console.log(s.series_idx, s.type);
418+
// console.log(s.series_idx, s.type);
412419
// console.log('metadataAlertsFields', metadataAlertsFields);
413420
if (metadataAlertsFields.length) {
414421
let warn: string = `'Required metadata is missing, provided metadata field values have improper

ui/src/libUnsafe.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,13 @@ export function setIntendedFor($root: IEzbids) {
578578
}
579579

580580
// check B0FieldIdentifier and B0FieldSource information
581-
if (obj._type && !obj._type.includes('exclude') && !obj._type.includes('events')) {
581+
if (
582+
obj._type &&
583+
!obj._type.includes('exclude') &&
584+
!obj._type.includes('events') &&
585+
!obj._type.startsWith('meg') &&
586+
!obj._type.startsWith('pet')
587+
) {
582588
Object.assign(obj, { B0FieldIdentifier: [] });
583589
Object.assign(obj, { B0FieldSource: [] });
584590
if ('B0FieldIdentifier' in $root.series[obj.series_idx]) {
@@ -1924,7 +1930,7 @@ export function metadataAlerts(
19241930
}
19251931

19261932
let metadataAlertFields = requiredFields.concat(typoFields);
1927-
console.log('required', requiredFields);
1928-
console.log('typo', typoFields);
1933+
// console.log('required', requiredFields);
1934+
// console.log('typo', typoFields);
19291935
return metadataAlertFields;
19301936
}

0 commit comments

Comments
 (0)