From 65529d132c789b2385639d422f3b38e3123785ca Mon Sep 17 00:00:00 2001 From: Ubuntu <19364610+tuncK@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:10:38 +0000 Subject: [PATCH 01/10] ilastik wrapper added --- tools/interactive/interactivetool_ilastik.xml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tools/interactive/interactivetool_ilastik.xml diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml new file mode 100644 index 000000000000..934f643b9c95 --- /dev/null +++ b/tools/interactive/interactivetool_ilastik.xml @@ -0,0 +1,44 @@ + + interactive learning and segmentation toolkit + + 1.4.0 + + + quay.io/galaxy/ilastik:@VERSION@ + + + + 5800 + + + + + + + + + + + + + + + + + + + + + + 10.1038/s41592-019-0582-9 + + From ada2dd8015bfed5bb8a5ff660f3f9bd0bebb21cd Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Fri, 6 Oct 2023 17:55:11 +0200 Subject: [PATCH 02/10] use available arguments --- tools/interactive/interactivetool_ilastik.xml | 53 ++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index 934f643b9c95..6812f9c725d3 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -14,21 +14,58 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + @@ -36,6 +73,8 @@ From 57c1c65cfbc7581818bd0c1c04c60540a1ee4826 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Mon, 9 Oct 2023 14:20:22 +0200 Subject: [PATCH 03/10] fix entry_point --- tools/interactive/interactivetool_ilastik.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index 6812f9c725d3..78a8778a6f23 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -7,7 +7,7 @@ quay.io/galaxy/ilastik:@VERSION@ - + 5800 From aa947abe85e3405b1cf05aa6eab1a976b3f25d42 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Tue, 10 Oct 2023 14:19:10 +0200 Subject: [PATCH 04/10] change command and output to make it work --- tools/interactive/interactivetool_ilastik.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index 78a8778a6f23..c9ff3590a08e 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -13,7 +13,7 @@ run_ilastik && #else: - --project ./MyProject.ilp + echo "ilastik --project \$HOME/MyProject.ilp" > run_ilastik && #end if + chmod +x run_ilastik && + cp run_ilastik '/bin/' && + /init ]]> @@ -65,7 +67,7 @@ - + From 8aac1ccf6239ef821726cfc97883f0eaa5d3e2fc Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 12 Oct 2023 08:57:12 +0200 Subject: [PATCH 05/10] change run_ilastik to ilastik_with_args to fit the docker image + put images in working directory. --- tools/interactive/interactivetool_ilastik.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index c9ff3590a08e..8120663d3885 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -19,17 +19,19 @@ cp $input_type.project ./MyProject.ilp && #end if - mkdir -p ./galaxy_inputs && + ## Link input images to current working directory #for input in $infiles: - ln -s '$input' ./galaxy_inputs/'$input.name' && + ln -s '$input' ./'$input.name' && #end for + ## Write the bash script to run: #if str($input_type.existing) == "new": - echo "ilastik --new_project \$HOME/MyProject.ilp --workflow '$input_type.Workflow'" > run_ilastik && + echo "ilastik --new_project \$HOME/MyProject.ilp --workflow '$input_type.Workflow'" > ilastik_with_args && #else: - echo "ilastik --project \$HOME/MyProject.ilp" > run_ilastik && + echo "ilastik --project \$HOME/MyProject.ilp" > ilastik_with_args && #end if - chmod +x run_ilastik && - cp run_ilastik '/bin/' && + ## Copy it to /bin/ so it will be used by the container: + chmod +x ilastik_with_args && + cp ilastik_with_args '/bin/' && /init ]]> From 4110a93cbf2472edd20592212fad9f22d788ace9 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 12 Oct 2023 08:57:35 +0200 Subject: [PATCH 06/10] add more info in help section --- tools/interactive/interactivetool_ilastik.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index 8120663d3885..9af710b5f330 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -78,6 +78,11 @@ From 8092aba68e568e350e5f83ed1852b97c8743d528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gr=C3=BCning?= Date: Thu, 12 Oct 2023 14:11:55 +0200 Subject: [PATCH 07/10] add some quotes --- tools/interactive/interactivetool_ilastik.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index 9af710b5f330..07e60a060398 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -16,7 +16,7 @@ export HOME=\$PWD && ## Make a copy of the existing project if exists #if str($input_type.existing) == "existing": - cp $input_type.project ./MyProject.ilp && + cp '$input_type.project' ./MyProject.ilp && #end if ## Link input images to current working directory @@ -25,13 +25,13 @@ #end for ## Write the bash script to run: #if str($input_type.existing) == "new": - echo "ilastik --new_project \$HOME/MyProject.ilp --workflow '$input_type.Workflow'" > ilastik_with_args && + echo "ilastik --new_project \$HOME/MyProject.ilp --workflow '$input_type.Workflow'" > ./ilastik_with_args && #else: echo "ilastik --project \$HOME/MyProject.ilp" > ilastik_with_args && #end if ## Copy it to /bin/ so it will be used by the container: - chmod +x ilastik_with_args && - cp ilastik_with_args '/bin/' && + chmod +x ./ilastik_with_args && + cp ./ilastik_with_args '/bin/' && /init ]]> From 9a1cc32e341422fd5711f5e2bdb362456601755c Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 12 Oct 2023 15:10:37 +0200 Subject: [PATCH 08/10] add ./ --- tools/interactive/interactivetool_ilastik.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index 07e60a060398..b7976c7ab72d 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -27,7 +27,7 @@ #if str($input_type.existing) == "new": echo "ilastik --new_project \$HOME/MyProject.ilp --workflow '$input_type.Workflow'" > ./ilastik_with_args && #else: - echo "ilastik --project \$HOME/MyProject.ilp" > ilastik_with_args && + echo "ilastik --project \$HOME/MyProject.ilp" > ./ilastik_with_args && #end if ## Copy it to /bin/ so it will be used by the container: chmod +x ./ilastik_with_args && From ce82be8f448492e66b27a7d900eb45465fc3db9b Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 12 Oct 2023 15:31:46 +0200 Subject: [PATCH 09/10] raise error when identical identifiers --- tools/interactive/interactivetool_ilastik.xml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index b7976c7ab72d..3c037ac1f387 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -13,6 +13,17 @@ 1] + #if len(duplicates) > 0: + #set unique_duplicates = list(set(duplicates)) + echo "Cannot run ilastik because these identifiers are present more than once:" && + #for label in $unique_duplicates: + echo $label && + #end for + exit 1 && + #end if export HOME=\$PWD && ## Make a copy of the existing project if exists #if str($input_type.existing) == "existing": @@ -21,7 +32,7 @@ ## Link input images to current working directory #for input in $infiles: - ln -s '$input' ./'$input.name' && + ln -s '$input' ./'$input.element_identifier'.tif && #end for ## Write the bash script to run: #if str($input_type.existing) == "new": @@ -80,8 +91,9 @@ This tool has been designed uniquely to make/modify a project. + - It requires that input images have unique identifiers. - When you have trained your project, save it and quit the application. The project called 'MyProject.ilp' will be imported into your history. - - If you want to modify a project, make sure you use at least the same images as the first time (but you can add more). + - If you want to modify a project, make sure you use at least the same images (with the same identifiers) as the first time (but you can add more). Please, check the documentation at https://www.ilastik.org/documentation/. ]]> From 822f4c5927a7bcdb8f3eec6bd7b22b55ffdffdc6 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Fri, 13 Oct 2023 14:05:05 +0200 Subject: [PATCH 10/10] use directory where app user has rw access --- tools/interactive/interactivetool_ilastik.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/interactive/interactivetool_ilastik.xml b/tools/interactive/interactivetool_ilastik.xml index 3c037ac1f387..8f52af0b7b7b 100644 --- a/tools/interactive/interactivetool_ilastik.xml +++ b/tools/interactive/interactivetool_ilastik.xml @@ -25,9 +25,12 @@ exit 1 && #end if export HOME=\$PWD && + ## Create a directory where the app user has access + mkdir -p ./output && + chown 1000:1000 ./output/ && ## Make a copy of the existing project if exists #if str($input_type.existing) == "existing": - cp '$input_type.project' ./MyProject.ilp && + cp '$input_type.project' ./output/MyProject.ilp && #end if ## Link input images to current working directory @@ -36,9 +39,9 @@ #end for ## Write the bash script to run: #if str($input_type.existing) == "new": - echo "ilastik --new_project \$HOME/MyProject.ilp --workflow '$input_type.Workflow'" > ./ilastik_with_args && + echo "ilastik --new_project \$HOME/output/MyProject.ilp --workflow '$input_type.Workflow'" > ./ilastik_with_args && #else: - echo "ilastik --project \$HOME/MyProject.ilp" > ./ilastik_with_args && + echo "ilastik --project \$HOME/output/MyProject.ilp" > ./ilastik_with_args && #end if ## Copy it to /bin/ so it will be used by the container: chmod +x ./ilastik_with_args && @@ -80,7 +83,7 @@ - +