diff --git a/grand_challenge_forge/partials/example-algorithm/example-algorithm{{cookiecutter._}}/inference.py.j2 b/grand_challenge_forge/partials/example-algorithm/example-algorithm{{cookiecutter._}}/inference.py.j2 index 7030a57..4906aa1 100644 --- a/grand_challenge_forge/partials/example-algorithm/example-algorithm{{cookiecutter._}}/inference.py.j2 +++ b/grand_challenge_forge/partials/example-algorithm/example-algorithm{{cookiecutter._}}/inference.py.j2 @@ -107,7 +107,7 @@ def write_json_file(*, location, content): def load_image_file_as_array(*, location): # Use SimpleITK to read a file - input_files = glob(str(location / "*")) + input_files = glob(str(location / "*.tiff")) + glob(str(location / "*.mha")) result = SimpleITK.ReadImage(input_files[0]) # Convert it to a Numpy array @@ -119,10 +119,13 @@ def load_image_file_as_array(*, location): def write_array_as_image_file(*, location, array): location.mkdir(parents=True, exist_ok=True) + # You may need to change the suffix to .tiff to match the expected output + suffix = ".mha" + image = SimpleITK.GetImageFromArray(array) SimpleITK.WriteImage( image, - location / "output.mha", + location / f"output{suffix}", useCompression=True, ) {%- endif %} diff --git a/grand_challenge_forge/partials/example-evaluation-method/example-evaluation-method{{cookiecutter._}}/evaluate.py.j2 b/grand_challenge_forge/partials/example-evaluation-method/example-evaluation-method{{cookiecutter._}}/evaluate.py.j2 index 1e37c42..96ecb7a 100644 --- a/grand_challenge_forge/partials/example-evaluation-method/example-evaluation-method{{cookiecutter._}}/evaluate.py.j2 +++ b/grand_challenge_forge/partials/example-evaluation-method/example-evaluation-method{{cookiecutter._}}/evaluate.py.j2 @@ -177,7 +177,7 @@ def load_json_file(*, location): def load_image_file(*, location): # Use SimpleITK to read a file - input_files = glob(str(location / "*")) + input_files = glob(str(location / "*.tiff")) + glob(str(location / "*.mha")) result = SimpleITK.ReadImage(input_files[0]) # Convert it to a Numpy array