From 4d291c64bb9fd8764e57770d1b02aa2c11bf1573 Mon Sep 17 00:00:00 2001 From: mthang Date: Mon, 28 Oct 2024 08:23:34 +0000 Subject: [PATCH] add xnatutils folder --- tools/xnatutils/.shed.yml | 10 ++ tools/xnatutils/macros.xml | 17 ++++ tools/xnatutils/xnatutils.xml | 174 ++++++++++++++++++++++++++++++++++ 3 files changed, 201 insertions(+) create mode 100644 tools/xnatutils/.shed.yml create mode 100644 tools/xnatutils/macros.xml create mode 100644 tools/xnatutils/xnatutils.xml diff --git a/tools/xnatutils/.shed.yml b/tools/xnatutils/.shed.yml new file mode 100644 index 00000000..b71efe1c --- /dev/null +++ b/tools/xnatutils/.shed.yml @@ -0,0 +1,10 @@ +name: xnatutils +owner: galaxy-australia +categories: +- Imaging +description: Xnat-utils is a collection of scripts for conveniently up/downloading and listing data on/from XNAT +homepage_url: https://ardc.edu.au/project/australian-imaging-service-ais/ +long_description: | + Xnat-utils is a collection of scripts for conveniently up/downloading and listing data on/from XNAT at Australian Imaging Service (AIS) +remote_repository_url: https://github.com/Australian-Imaging-Service/xnatutils +type: unrestricted diff --git a/tools/xnatutils/macros.xml b/tools/xnatutils/macros.xml new file mode 100644 index 00000000..5157a33a --- /dev/null +++ b/tools/xnatutils/macros.xml @@ -0,0 +1,17 @@ + + v0.9.1 + 0 + 22.05 + + + xnatutils + + + + + + + + + + diff --git a/tools/xnatutils/xnatutils.xml b/tools/xnatutils/xnatutils.xml new file mode 100644 index 00000000..9e87063c --- /dev/null +++ b/tools/xnatutils/xnatutils.xml @@ -0,0 +1,174 @@ + + Australia Images Service + + macros.xml + + + > '$log' 2>&1 + #else + #if $operation.project_option.datatype_selector != 'session': + xnat-ls --server $xnat_url + --project $operation.project_option.project_id + -d $operation.project_option.datatype_choice >> '$log' 2>&1 + #else + #if $operation.project_option.datatype_selector.include_scan =='' and $operation.project_option.datatype_selector.exclude_scan =='': + xnat-ls --server $xnat_url + --project $operation.project_option.project_id + -d $operation.project_option.datatype_choice >> '$log' 2>&1 + #elif $operation.project_option.datatype_selector.include_scan !='' and $operation.project_option.datatype_selector.exclude_scan =='': + xnat-ls --server $xnat_url + --project $operation.project_option.project_id + -d $operation.project_option.datatype_choice + --with_scans $operation.project_option.datatype_selector.include_scan >> '$log' 2>&1 + #elif $operation.project_option.datatype_selector.include_scan =='' and $operation.project_option.datatype_selector.exclude_scan !='': + xnat-ls --server $xnat_url + --project $operation.project_option.project_id + -d $operation.project_option.datatype_choice + --without_scans $operation.project_option.datatype_selector.exclude_scan >> '$log' 2>&1 + #else + xnat-ls --server $xnat_url + --project $operation.project_option.project_id + -d $operation.project_option.datatype_choice + --with_scans $operation.project_option.datatype_selector.include_scan + --without_scans $operation.project_option.datatype_selector.exclude_scan >> '$log' 2>&1 + #end if + #end if + #end if + #elif $operation.ops_list == "get": + mkdir -p output && + xnat-get --server $xnat_url + --scans $operation.scans + #elif $operation.ops_list == "put": + echo "TODO - put" >> '$log' + #elif $operation.ops_list == "rename": + xnat-rename --server $xnat_url $operation.old_session_name $operation.new_session_name >> '$log' 2>&1 + #end if + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + Xnat-utils is a collection of scripts for conveniently up/downloading and listing data on/from XNAT + +**Remarks** + This tool leverages Xnatutils (https://github.com/Australian-Imaging-Service/xnatutils) + to query and retrieve files on Australia Image Service Server. + +