Skip to content

Commit

Permalink
[FIX] Remove B0FieldIdentifier/Source from MEG and PET data
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Feb 21, 2024
1 parent 4dc3d28 commit 804d196
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 54 deletions.
2 changes: 1 addition & 1 deletion handler/convert_meg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import sys
import json
from datetime import datetime
from mne.io import read_raw
from datetime import datetime
from mne_bids import (BIDSPath, write_raw_bids)

# Begin:
Expand Down
101 changes: 53 additions & 48 deletions ui/src/Objects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,65 +233,70 @@
<div v-if="so._type && !so._type.includes('exclude')" class="border-top">
<br />
<div v-if="!so._type.includes('events')" class="border-top">
<el-form-item label="B0FieldIdentifier">
<el-select
v-model="so.B0FieldIdentifier"
multiple
filterable
allow-create
default-first-option
placeholder="Enter text string"
size="small"
style="width: 100%"
@change="update(so)"
>
</el-select>
</el-form-item>
<p style="margin-left: 200px">
<small
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used for
fieldmap correction, enter a text string of your choice. A good formatting
suggestion is the "datatype_suffix[index]" format (e.g., <b>fmap_epi0</b>,
<b>fmap_phasediff1</b>, etc). If another sequence will be used with this one for
fieldmap correction, use the exact same text string there as well. Leave field blank
if unclear.</small
>
</p>
<div v-if="!so._type.startsWith('meg') && !so._type.startsWith('pet')" class="border-top">
<el-form-item label="B0FieldIdentifier">
<el-select
v-model="so.B0FieldIdentifier"
multiple
filterable
allow-create
default-first-option
placeholder="Enter text string"
size="small"
style="width: 100%"
@change="update(so)"
>
</el-select>
</el-form-item>
<p style="margin-left: 200px">
<small
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used
fieldmap correction, enter a text string of your choice. A good formatting
suggestion is the "datatype_suffix[index]" format (e.g., <b>fmap_epi0</b>,
<b>fmap_phasediff1</b>, etc). If another sequence will be used with this one for
fieldmap correction, use the exact same text string there as well. Leave field
if unclear.</small
>
</p>
</div>
</div>

<br />
<div v-if="!so._type.includes('events')" class="border-top">
<el-form-item label="B0FieldSource">
<el-select
v-model="so.B0FieldSource"
multiple
filterable
allow-create
default-first-option
placeholder="Enter text string"
size="small"
style="width: 100%"
@change="update(so)"
>
</el-select>
</el-form-item>
<p style="margin-left: 200px">
<small
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used for
fieldmap correction, enter a text string of your choice. A good formatting
suggestion is the "datatype_suffix" format (e.g., fmap_epi, fmap_phasediff). If
another sequence will be used with this one for fieldmap correction, use the exact
same text string there as well. Leave field blank if unclear.</small
>
</p>
<div v-if="!so._type.startsWith('meg') && !so._type.startsWith('pet')" class="border-top">
<el-form-item label="B0FieldSource">
<el-select
v-model="so.B0FieldSource"
multiple
filterable
allow-create
default-first-option
placeholder="Enter text string"
size="small"
style="width: 100%"
@change="update(so)"
>
</el-select>
</el-form-item>
<p style="margin-left: 200px">
<small
>* <b>Recommended/Optional if no IntendedFor</b>: If this sequence will be used
fieldmap correction, enter a text string of your choice. A good formatting
suggestion is the "datatype_suffix" format (e.g., fmap_epi, fmap_phasediff). If
another sequence will be used with this one for fieldmap correction, use the
same text string there as well. Leave field blank if unclear.</small
>
</p>
</div>
<el-form-item
v-if="
['perf/asl', 'perf/m0scan'].includes(so._type) ||
so._type.startsWith('pet') ||
so._type.startsWith('func') ||
so._type.startsWith('fmap') ||
so._type.startsWith('dwi') ||
so._type.startsWith('anat')
so._type.startsWith('anat') ||
so._type.startsWith('meg')
"
label="Relevant Metadata"
>
Expand Down
11 changes: 9 additions & 2 deletions ui/src/SeriesPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@
</el-form-item>
</div>

<div v-if="ss.type && !ss.type.includes('exclude')">
<div
v-if="
ss.type &&
!ss.type.includes('exclude') &&
!ss.type.startsWith('meg') &&
!ss.type.startsWith('pet')
"
>
<el-form-item label="B0FieldIdentifier" prop="B0FieldIdentifier">
<el-select
v-model="ss.B0FieldIdentifier"
Expand Down Expand Up @@ -408,7 +415,7 @@ export default defineComponent({
s.series_idx,
s.type
);
console.log(s.series_idx, s.type);
// console.log(s.series_idx, s.type);
// console.log('metadataAlertsFields', metadataAlertsFields);
if (metadataAlertsFields.length) {
let warn: string = `'Required metadata is missing, provided metadata field values have improper
Expand Down
12 changes: 9 additions & 3 deletions ui/src/libUnsafe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,13 @@ export function setIntendedFor($root: IEzbids) {
}

// check B0FieldIdentifier and B0FieldSource information
if (obj._type && !obj._type.includes('exclude') && !obj._type.includes('events')) {
if (
obj._type &&
!obj._type.includes('exclude') &&
!obj._type.includes('events') &&
!obj._type.startsWith('meg') &&
!obj._type.startsWith('pet')
) {
Object.assign(obj, { B0FieldIdentifier: [] });
Object.assign(obj, { B0FieldSource: [] });
if ('B0FieldIdentifier' in $root.series[obj.series_idx]) {
Expand Down Expand Up @@ -1924,7 +1930,7 @@ export function metadataAlerts(
}

let metadataAlertFields = requiredFields.concat(typoFields);
console.log('required', requiredFields);
console.log('typo', typoFields);
// console.log('required', requiredFields);
// console.log('typo', typoFields);
return metadataAlertFields;
}

0 comments on commit 804d196

Please sign in to comment.