Input and Output

Input and Output  

  By: luanmath on Aug. 23, 2024, 9:36 p.m.

Hello,

I have two questions:

1. I would like to know the correct path for the input and output to be considered. In the Docker template, the suggested structure is: test - input - output

However, when submitting the algorithm for the challenge, the guidance is as follows:

input: /input/images
output: /output/images/stroke-lesion-segmentation

Which structure should be followed?

2. I would like to know if it is expected that the script reads all the directories mentioned in the algorithm submission, including the .json file, or if it needs to read only the image that the algorithm is using.

(I am making the submission during the "Preliminary Docker Evaluation Submission" phase).

Re: Input and Output  

  By: AWinder on Aug. 23, 2024, 10:57 p.m.

Hi Luanmath, I've been able to submit to the Preliminary Docker Evaluation Submission phase so I can probably answer your questions.

1) When you go to https://grand-challenge.org/algorithms to create your algorithm, the 'upload a container' page provides very specific guidance on where the data is saved and loaded to/from:

These paths are the same as what the Docker template at the provided GitHub repository assumes within the file inference.py. The only difference is that that the Docker template saves the output (to the correct directory) as result.mha whereas the Docker image that you submit should use the name insert-uuid-here.mha.

2) You only need to (and should only - to conserve time and memory) read the files that your algorithm needs to run. All of the files will be available at their respective paths, but there is no need to read them.

 Last edited by: AWinder on Aug. 23, 2024, 11:02 p.m., edited 4 times in total.
Reason: Fixed bullet numbering

Re: Input and Output  

  By: luanmath on Aug. 23, 2024, 11:48 p.m.

Ok, thank you so much! Just to confirm:

I need to clone the images using git clone, and the directory structure should be:

input/images/modality/uid.mha

Then, I need to save the output in:

output/images/stroke-lesion-segmentation/

Additionally, I added the following line to the Dockerfile: COPY input /opt/app/

Does this make sense?

Re: Input and Output  

  By: AWinder on Aug. 24, 2024, 1:42 a.m.

I can confirm that you should clone the template repository with git clone and then add the directory test/input to the template containing the example images that are linked in the README. Your directory structure should match what is depicted in the README. To the best of my recollection, you do not need to modify the Dockerfile to COPY input /opt/app/. That bit is already taken care of. The way it works is that /input is a root-level directory in the Docker container created by test_run.sh. The directory 'test' in the Docker template is the location on your local machine that is used for sharing files with the root directory of the Docker container .

In summary, you put the test data in your local directory test/input. Then, you code inference.py to expect to see that data in /input. When you execute your Docker container, the data that you put in locally in test/input will be available to code running within the container at the path /input. Similarly, code within the container will write to /output inside the container and then those files will be available locally in the Docker template directory at test/output.

 Last edited by: AWinder on Aug. 24, 2024, 1:44 a.m., edited 1 time in total.
Reason: Clarified language

Re: Input and Output  

  By: ezequieldlrosa on Aug. 26, 2024, 8:57 a.m.

Hi Luan,

Were you able to run your algorithms locally using ./test_run.sh?

Just a quick reminder—please stick to the paths in our Git repo, as they’re set up to work correctly. As Anthony mentioned, just copy the provided images into test/input, and you should see the output in test/output.

Also, there’s no need to load all the image series, as this can consume unnecessary time and memory.

Best, Ezequiel P.S. Thanks Anthony for the support!