From 0af4107b910cfc2d1ca8a0d4b112caf22488a3cb Mon Sep 17 00:00:00 2001 From: Dan Levitas Date: Fri, 3 Nov 2023 15:34:24 +0000 Subject: [PATCH] code cleanup --- ui/src/libUnsafe.ts | 86 --------------------------------------------- 1 file changed, 86 deletions(-) diff --git a/ui/src/libUnsafe.ts b/ui/src/libUnsafe.ts index 214a1919..aaf21498 100755 --- a/ui/src/libUnsafe.ts +++ b/ui/src/libUnsafe.ts @@ -450,92 +450,6 @@ export function setRun($root:IEzbids) { }) } -// export function setRun($root:IEzbids) { // REFERENCE -// // Set run entity label for all objects, if appropriate. -// // Applied on the Dataset Review page. - -// // Loop through subjects -// $root._organized.forEach((subGroup:OrganizedSubject) => { -// // Loop through sessions -// subGroup.sess.forEach((sesGroup:OrganizedSession) => { -// sesGroup.objects.forEach((obj:IObject) => { - -// // leave two entity labels out for now: part and run. The part entity could have a pairing (mag/phase or real/imag), and we're interested in the run entity -// let targetEntities = Object.fromEntries(Object.entries(obj._entities).filter(([key])=>key !== "part" && key !== "run" && key !== "echo")) - -// let initialGrouping = sesGroup.objects.filter(e=>e._type !== "exclude" && -// !e._exclude && -// e._type === obj._type && -// e._type !== "func/events" && // let users specify the run number for func/events files -// deepEqual(Object.fromEntries(Object.entries(e._entities).filter(([key])=>key !== "part" && key !== "run" && key !== "echo")), targetEntities) -// ) -// // console.log(initialGrouping) - -// if (initialGrouping.length) { -// // Sort this new array by idx (i.e. order in which the sequences were collected in the scanner) -// initialGrouping.sort((a, b) => a.idx - b.idx) - -// let setRun = false -// if (initialGrouping.length > 1) { -// setRun = true -// // } else if (initialGrouping.length === 1 && (initialGrouping[0]._type.includes("anat") || initialGrouping[0]._type.includes("func"))) { // might need to add conditional for not having func/events -// } else if (initialGrouping.length === 1 && (initialGrouping[0]._type.includes("func"))) { // might need to add conditional for not having func/events -// setRun = true -// } - -// if (setRun) { -// let run = 1 -// initialGrouping.forEach((o:IObject) => { -// if (o._entities.part && ["", "mag", "real"].includes(o._entities.part)) { -// o._entities.run = run.toString() -// o.entities.run = o._entities.run -// run++ -// } else if (o._entities.part && !["", "mag", "real"].includes(o._entities.part)) { -// if (o._entities.part === "phase") { -// let correspondingFuncMag = initialGrouping.filter(e=>e._entities.part === "mag" && -// ((e.idx === o.idx - 1 && e._type === "func/bold") || (e.idx === o.idx - 2 && e._type === "func/bold")) -// ) - -// if (!correspondingFuncMag.length) { -// o._exclude = true -// o.exclude = true -// o.validationWarnings = ["There is no corresponding func/bold (part-mag) sequence, therefore this sequence will be excluded from BIDS conversion"] -// } else { -// o._entities.run = correspondingFuncMag[0]._entities.run -// o.entities.run = o._entities.run -// } -// } else if (o._entities.part === "imag") { -// let correspondingFuncReal = initialGrouping.filter(e=>e._entities.part === "real" && -// ((e.idx === o.idx - 1 && e._type === "func/bold") || (e.idx === o.idx - 2 && e._type === "func/bold")) -// ) - -// if (!correspondingFuncReal.length) { -// o._exclude = true -// o.exclude = true -// o.validationWarnings = ["There is no corresponding func/bold (part-real) sequence, therefore this sequence will be excluded from BIDS conversion"] -// } else { -// o._entities.run = correspondingFuncReal[0]._entities.run -// o.entities.run = o._entities.run -// } -// } -// } else { -// o._entities.run = run.toString() -// o.entities.run = o._entities.run -// run++ -// } -// }) -// } else { -// initialGrouping.forEach((o:IObject) => { -// o._entities.run = "" -// o.entities.run = o._entities.run -// }) -// } -// } -// }) -// }) -// }) -// } - export function setIntendedFor($root:IEzbids) { // Apply fmap intendedFor mapping, based on user specifications on Series page.