Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions ezbids-upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

FOLDER=$1
SESSION=$2

API_URL="http://localhost:8082"
UI_URL="http://localhost:3000/ezbids/convert"


if [ ! -z "$FOLDER" ]; then
cd $FOLDER
fi

if [ -z "$SESSION" ]; then
SESSION=$(
curl "$API_URL/session" \
-X "POST" \
-H "Content-Type: application/json" | jq -r '._id'
)
fi


echo ""
echo "Session ID: $SESSION"
echo ""


FOLDER_NAME=$(basename `pwd`)

echo "Uploading `pwd`"
#for file in $(find * -type f); do
find * -type f | while IFS= read -r file; do
echo "Uploading $file"
curl "$API_URL/upload-multi/$SESSION" \
-H "Authorization: Bearer ${bearerToken}" \
-F "paths=$FOLDER_NAME/$file" \
-F "mtimes=1706756151" \
-F "files=@$file"
echo
done


echo "Marking as done"
curl "$API_URL/session/uploaded/$SESSION" \
-X 'PATCH'

echo ""
echo "$UI_URL/#$SESSION"
45 changes: 0 additions & 45 deletions ui/src/Finalize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,6 @@
<el-button style="width: 250px" type="primary" @click="download(`ezBIDS_template.json`)"
>Download configuration/template</el-button
>
<p>Or send the dataset to other cloud resources.</p>
<p>
<el-dropdown v-if="hasAuth">
<el-button style="margin-right: 10px">
Send to <b>Brainlife.io</b>&nbsp;
<font-awesome-icon :icon="['fas', 'angle-down']" />
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="sendBrainlife()">Send to brainlife</el-dropdown-item>
<el-dropdown-item @click="sendBrainlife('DWI')"
>Send to brainlife and run DWI Pipeline</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button @click="sendOpenneuro">Send to <b>OpenNeuro</b></el-button>
</p>

<p style="background-color: #0001; padding: 20px; padding-top: 10px">
If you have re-named the original DICOM patient names for your BIDS subject/session names, you can
Expand Down Expand Up @@ -256,33 +238,6 @@ export default defineComponent({
URL.revokeObjectURL(link.href);
},

sendBrainlife(pipeline?: 'DWI') {
const pipelineString = pipeline ? `&pipeline=${pipeline}` : '';
window.open(
`https://brainlife.io/projects#ezbids=${this.session._id}${pipelineString}`,
`_brainlife.${this.session._id}`
);
},

async sendOpenneuro() {
try {
const res = await axios.get(`${this.config.apihost}/download/${this.session._id}/token`);
const shortLivedJWT = res.data;

const url = `${this.config.apihost}/download/${this.session._id}/bids/${this.ezbids.datasetDescription.Name}?token=${shortLivedJWT}`;

const fullurl = new URL(url, document.baseURI).href;
window.open('https://openneuro.org/import?url=' + encodeURI(fullurl));

} catch (e) {
console.error(e);
ElNotification({
message: 'there was an error downloading the data',
type: 'error',
});
}
},

isValid(cb: (err?: string) => void) {
if (this.session.status != 'finished') return cb('Please finalize the page first');
cb();
Expand Down