Skip to content

Commit

Permalink
remove old code
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorhanayikVBC committed Aug 26, 2024
1 parent b55e6e6 commit 26c5450
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,6 @@ import { inferenceModelsList, brainChopOpts } from "./brainchop-parameters.js"
import { isChrome, localSystemDetails } from "./brainchop-telemetry.js"
import MyWorker from "./brainchop-webworker.js?worker"

// class NiiMathWrapper {
// constructor(workerScript) {
// this.worker = new Worker(workerScript)
// }
// static async load(workerScript = './niimathWorker.js') {
// return new NiiMathWrapper(workerScript)
// }
// niimath(niiBuffer, operationsText) {
// return new Promise((resolve, reject) => {
// const niiBlob = new Blob([niiBuffer], { type: 'application/octet-stream' })
// const inName = 'input.nii' // or derive from context
// let outName = inName
// if (operationsText.includes("-mesh")) {
// outName = 'output.mz3' // or derive from context
// }
// const args = operationsText.trim().split(/\s+/)
// args.unshift(inName)
// args.push(outName)
// const file = new File([niiBlob], inName)
// this.worker.onmessage = (e) => {
// if (e.data.blob instanceof Blob) {
// const reader = new FileReader()
// reader.onload = () => {
// resolve(reader.result) // return ArrayBuffer
// }
// reader.onerror = () => {
// reject(new Error('Failed to read the Blob as an ArrayBuffer'))
// }
// reader.readAsArrayBuffer(e.data.blob)
// } else {
// reject(new Error('Expected Blob from worker'))
// }
// }
// this.worker.onerror = (e) => {
// reject(new Error(e.message))
// }
// this.worker.postMessage({ blob: file, cmd: args, outName: outName })
// })
// }
// terminate() {
// this.worker.terminate()
// }
// }

async function main() {
const niimath = new Niimath()
await niimath.init()
Expand Down

0 comments on commit 26c5450

Please sign in to comment.