Skip to content

Commit

Permalink
[FIX] minor intendedFor issue and additional edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Aug 15, 2023
1 parent f906fee commit cc0a2ee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
11 changes: 8 additions & 3 deletions handler/ezBIDS_core/ezBIDS_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,16 +1218,21 @@ 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
unique_dic["IntendedFor"] = ref_IntendedFor
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.
Expand Down
6 changes: 3 additions & 3 deletions ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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;
}
Expand Down
5 changes: 4 additions & 1 deletion ui/src/Objects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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) {
Expand All @@ -393,6 +394,8 @@
validate(o: IObject|null) {
if(!o) return;
setIntendedFor(this.ezbids)
let entities_requirement = this.getBIDSEntities(o._type);
Expand Down
7 changes: 3 additions & 4 deletions ui/src/libUnsafe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`]
}
}
});

}


Expand Down Expand Up @@ -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)
});
}
Expand Down

0 comments on commit cc0a2ee

Please sign in to comment.