Skip to content

Commit

Permalink
[ENH] Enable configuration file (finalized.json) upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Aug 15, 2023
1 parent fc0ec0c commit f906fee
Show file tree
Hide file tree
Showing 11 changed files with 580 additions and 336 deletions.
10 changes: 5 additions & 5 deletions handler/convert.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions handler/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fs.writeFileSync(root+"/bids/"+datasetName+"/dataset_description.json", JSON.str
fs.writeFileSync(root+"/bids/"+datasetName+"/.bidsignore", `
**/excluded
**/*_MP2RAGE.*
finalized.json
*finalized.json
`);

info.readme += `
Expand Down Expand Up @@ -197,14 +197,14 @@ async.forEachOf(info.objects, (o, idx, next_o)=>{
break;
case "json":
//handle B0FieldIdentifier and B0FieldSource if present
if(o.B0FieldIdentifier.length) {
if(o.B0FieldIdentifier) {
if(o.B0FieldIdentifier.length > 1) {
item.sidecar.B0FieldIdentifier = Object.values(o.B0FieldIdentifier)
}else{
item.sidecar.B0FieldIdentifier = o.B0FieldIdentifier[0]
}
}
if(o.B0FieldSource.length) {
if(o.B0FieldSource) {
if(o.B0FieldSource.length > 1) {
item.sidecar.B0FieldSource = Object.values(o.B0FieldSource)
}else{
Expand Down Expand Up @@ -310,7 +310,6 @@ async.forEachOf(info.objects, (o, idx, next_o)=>{
}else{
item.sidecar.B0FieldIdentifier = o.B0FieldIdentifier[0]
}
console.log(item.sidecar.B0FieldIdentifier)
}
if(o.B0FieldSource.length) {
if(o.B0FieldSource.length > 1) {
Expand Down
Loading

0 comments on commit f906fee

Please sign in to comment.