Skip to content

Commit

Permalink
raise error when identical identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
lldelisle committed Oct 12, 2023
1 parent 9a1cc32 commit ce82be8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tools/interactive/interactivetool_ilastik.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
</entry_points>
<command detect_errors="exit_code">
<![CDATA[
## Check inputs have no duplicated element_identifier:
#set labels = [input.element_identifier for input in $infiles]
#set duplicates = [label for label in labels if labels.count(label) > 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":
Expand All @@ -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":
Expand Down Expand Up @@ -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/.
]]>
Expand Down

0 comments on commit ce82be8

Please sign in to comment.