From e1e591a6365190a0ac7cf705d0d7bc38385f8dbc Mon Sep 17 00:00:00 2001 From: suliciac Date: Mon, 31 Mar 2025 10:36:43 +0200 Subject: [PATCH 1/3] remove openneuro button/upload; work without ethernet connection --- ui/src/Finalize.vue | 45 --------------------------------------------- 1 file changed, 45 deletions(-) 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(); From 72485a10f0dc0eefbee0231126a68fe29c6a866c Mon Sep 17 00:00:00 2001 From: suliciac Date: Wed, 2 Apr 2025 12:26:57 +0200 Subject: [PATCH 2/3] add upload from terminal file; extra software requirement: jq --- ezbids-upload.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 ezbids-upload.sh diff --git a/ezbids-upload.sh b/ezbids-upload.sh new file mode 100755 index 00000000..c5c871a6 --- /dev/null +++ b/ezbids-upload.sh @@ -0,0 +1,50 @@ +#!/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' + ) + # DEBUG line + echo "DEBUG: Session ID is '$SESSION'" +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" From 8dd7488774b4a8e095eed09372cfbf24bc53f0b1 Mon Sep 17 00:00:00 2001 From: suliciac Date: Tue, 8 Apr 2025 15:24:44 +0200 Subject: [PATCH 3/3] upload from terminal file --- ezbids-upload.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ezbids-upload.sh b/ezbids-upload.sh index c5c871a6..13c77830 100755 --- a/ezbids-upload.sh +++ b/ezbids-upload.sh @@ -17,8 +17,6 @@ if [ -z "$SESSION" ]; then -X "POST" \ -H "Content-Type: application/json" | jq -r '._id' ) - # DEBUG line - echo "DEBUG: Session ID is '$SESSION'" fi