Skip to content

Commit

Permalink
Import re for file inputs (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
amickan authored Jul 31, 2024
1 parent 5a27536 commit 43408bb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import json
from glob import glob
import SimpleITK
{%- endif %}
{% if cookiecutter.phase.algorithm_inputs | has_image -%}
{% if cookiecutter.phase.algorithm_inputs | has_image or cookiecutter.phase.algorithm_inputs | has_file -%}
import re
{%- endif %}
import random
Expand Down Expand Up @@ -157,6 +157,7 @@ def get_image_name(*, values, slug):
raise RuntimeError(f"Image with interface {slug} not found!")
{%- endif %}


{%- if cookiecutter.phase.algorithm_inputs | has_file %}
def get_file_name(*, values, slug):
# This tells us the user-provided name of the input file
Expand All @@ -172,6 +173,7 @@ def get_file_name(*, values, slug):
raise RuntimeError(f"File with interface {slug} not found!")
{%- endif %}


def get_interface_relative_path(*, values, slug):
# Gets the location of the interface relative to the input or output
for value in values:
Expand Down

0 comments on commit 43408bb

Please sign in to comment.