From cc0a2ee4fc0db73fe51259edafb893ec8daa6a06 Mon Sep 17 00:00:00 2001 From: Dan Levitas Date: Tue, 15 Aug 2023 16:10:56 +0000 Subject: [PATCH] [FIX] minor intendedFor issue and additional edits --- handler/ezBIDS_core/ezBIDS_core.py | 11 ++++++++--- ui/src/App.vue | 6 +++--- ui/src/Objects.vue | 5 ++++- ui/src/libUnsafe.ts | 7 +++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/handler/ezBIDS_core/ezBIDS_core.py b/handler/ezBIDS_core/ezBIDS_core.py index 77650d34..4f39e354 100755 --- a/handler/ezBIDS_core/ezBIDS_core.py +++ b/handler/ezBIDS_core/ezBIDS_core.py @@ -1218,6 +1218,7 @@ def finalized_configuration(dataset_list_unique_series, subjects_information, co ref_IntendedFor = config_series_ref["IntendedFor"] ref_B0FieldIdentifier = config_series_ref["B0FieldIdentifier"] ref_B0FieldSource = config_series_ref["B0FieldSource"] + ref_message = config_series_ref["message"] unique_dic["type"] = ref_type unique_dic["entities"] = ref_entities @@ -1225,9 +1226,13 @@ def finalized_configuration(dataset_list_unique_series, subjects_information, co unique_dic["B0FieldIdentifier"] = ref_B0FieldIdentifier unique_dic["B0FieldSource"] = ref_B0FieldSource unique_dic["finalized_match"] = True - unique_dic["message"] = "Datatype, suffix, and entity information was determined based on match "\ - "with corresponding data in ezBIDS configuration (finalized.json) file. Please modify if incorrect" - + if "localizer" in ref_message: + unique_dic["message"] = "Datatype, suffix, and entity information was determined based on match "\ + "with corresponding data in ezBIDS configuration (finalized.json) file. This data is believed to "\ + "be a localizer. Please modify if incorrect" + else: + unique_dic["message"] = "Datatype, suffix, and entity information was determined based on match "\ + "with corresponding data in ezBIDS configuration (finalized.json) file. Please modify if incorrect" """ If events.tsv files (for func/bold) are referenced in the configuration, grab this information and display it on the Events page if user uploads event timing data again. diff --git a/ui/src/App.vue b/ui/src/App.vue index e1681dc2..c530c4a2 100755 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -20,7 +20,7 @@ import { IObject } from './store' import { ElNotification } from 'element-plus' //import 'element-plus/es/components/notification/style/css' -import { setSectionIDs, funcQA, fmapQA, dwiQA, setRun, setIntendedFor, setVolumeThreshold } from './libUnsafe' +import { setSectionIDs, funcQA, fmapQA, dwiQA, setRun, setVolumeThreshold } from './libUnsafe' //import { IObjectItem } from './store' import { createEventsTSV } from './lib' @@ -158,9 +158,9 @@ export default defineComponent({ this.mapObjects(); break; case "object": - // createEventsTSV(this.ezbids, this.events); + // createEventsTSV(this.ezbids, this.events); // functionality replace by next line createEventsTSV(this.ezbids, this.ezbids.events); - setIntendedFor(this.ezbids); + // setIntendedFor(this.ezbids); // Moving this into Objects.vue directly break; } diff --git a/ui/src/Objects.vue b/ui/src/Objects.vue index ea466833..6f2f2ac9 100755 --- a/ui/src/Objects.vue +++ b/ui/src/Objects.vue @@ -224,7 +224,7 @@ import { IObject, Session, OrganizedSession, OrganizedSubject } from './store' import { prettyBytes } from './filters' - import { deepEqual, validate_Entities_B0FieldIdentifier_B0FieldSource } from './libUnsafe' + import { deepEqual, setIntendedFor, validate_Entities_B0FieldIdentifier_B0FieldSource } from './libUnsafe' // @ts-ignore import { Splitpanes, Pane } from 'splitpanes' @@ -381,6 +381,7 @@ intendedForLabel(o: IObject) { const series = this.ezbids.series[o.series_idx]; if(!series) return "no-series"; + // if(!series && o._type != "func/events") return "no-series"; let l = "#"+series.series_idx+" "; l += o._type; for(let k in o._entities) { @@ -393,6 +394,8 @@ validate(o: IObject|null) { if(!o) return; + + setIntendedFor(this.ezbids) let entities_requirement = this.getBIDSEntities(o._type); diff --git a/ui/src/libUnsafe.ts b/ui/src/libUnsafe.ts index 07eb9638..7008c68b 100755 --- a/ui/src/libUnsafe.ts +++ b/ui/src/libUnsafe.ts @@ -71,12 +71,11 @@ export function setVolumeThreshold($root) { o.exclude = true o.analysisResults.warnings = [`This func/bold sequence contains ${numVolumes} volumes, which is \ less than the threshold value of ${numVolumes1min} volumes, calculated by the expected number of \ - volumes in a 1min time frame. This acquisition will thus be excluded from BIDS conversion. \ - Please modify if incorrect`] + volumes in a 1 min time frame. This acquisition will thus be excluded from BIDS conversion unless \ + unexcluded. Please modify if incorrect.`] } } }); - } @@ -397,7 +396,7 @@ export function setIntendedFor($root) { Object.assign(obj, {IntendedFor: []}) let correspindingSeriesIntendedFor = $root.series[obj.series_idx].IntendedFor correspindingSeriesIntendedFor.forEach(i=>{ - let IntendedForIDs = section.filter(o=>o.series_idx == i && o.type != "func/events").map(o=>o.idx) + let IntendedForIDs = section.filter(o=>o.series_idx == i && o._type != "func/events").map(o=>o.idx) obj.IntendedFor = obj.IntendedFor.concat(IntendedForIDs) }); }