Skip to content

Commit

Permalink
Merge branch 'fix/deno_2_test_and_build' of github.com:bids-standard/…
Browse files Browse the repository at this point in the history
…bids-validator-temp into fix/deno_2_test_and_build
  • Loading branch information
rwblair committed Oct 31, 2024
2 parents e36d8f5 + 6d85c62 commit b896bbf
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 272 deletions.
84 changes: 0 additions & 84 deletions .circleci/config.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/docker-build-push.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/node_tests.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/test-bids-examples.yml

This file was deleted.

2 changes: 1 addition & 1 deletion bids-validator/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@hed/validator": "npm:[email protected]",
"@ignore": "npm:[email protected]",
"@libs/xml": "jsr:@libs/[email protected]",
"@mango/nifti": "npm:[email protected].8",
"@mango/nifti": "npm:@bids/[email protected].9",
"@std/assert": "jsr:@std/[email protected]",
"@std/fmt": "jsr:@std/[email protected]",
"@std/fs": "jsr:@std/[email protected]",
Expand Down
13 changes: 1 addition & 12 deletions bids-validator/src/files/nifti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,11 @@ async function extract(buffer: Uint8Array, nbytes: number): Promise<Uint8Array>
return result
}

function readHeaderQuiet(buf: ArrayBuffer) {
const console_error = console.error
const console_log = console.log
console.error = (msg: string) => { logger.info(msg)}
console.log = (msg: string) => { logger.info(msg)}
const header = readHeader(buf)
console.error = console_error
console.log = console_log
return header
}

export async function loadHeader(file: BIDSFile): Promise<NiftiHeader> {
try {
const buf = await file.readBytes(1024)
const data = isCompressed(buf.buffer) ? await extract(buf, 540) : buf
const header = readHeaderQuiet(data.buffer)
const header = readHeader(data.buffer)
if (!header) {
throw { key: 'NIFTI_HEADER_UNREADABLE' }
}
Expand Down

0 comments on commit b896bbf

Please sign in to comment.