diff --git a/ezbids-upload.sh b/ezbids-upload.sh new file mode 100755 index 00000000..13c77830 --- /dev/null +++ b/ezbids-upload.sh @@ -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" diff --git a/ui/src/Finalize.vue b/ui/src/Finalize.vue index 9cf32e0b..33b94740 100755 --- a/ui/src/Finalize.vue +++ b/ui/src/Finalize.vue @@ -45,24 +45,6 @@ Download configuration/template -

Or send the dataset to other cloud resources.

-

- - - Send to Brainlife.io  - - - - - Send to OpenNeuro -

If you have re-named the original DICOM patient names for your BIDS subject/session names, you can @@ -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();