Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the SaveImage transform to support saving input-output mapping. #7557

Closed
binliunls opened this issue Mar 18, 2024 · 1 comment · Fixed by #7769
Closed

Update the SaveImage transform to support saving input-output mapping. #7557

binliunls opened this issue Mar 18, 2024 · 1 comment · Fixed by #7769

Comments

@binliunls
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When I run a segmentation bundle like spleen segmentation, I would like to have a new json/yaml/csv file to explicitly show the input-output mapping between images and labels. For example if the input and output folders are like:

--input
   --input_0.nii.gz
   --input_1.nii.gz
   -- ...
   --input_n.nii.gz

--output
   --input_0/input_0_seg.nii.gz
   --input_1/input_1_seg.nii.gz
   --...
   --input_n/input_n_seg.nii.gz

Describe the solution you'd like
A json file with content shown below should be generated if the parameter is specified:

[
    {image: ["/path/to/image/input/input_0.nii.gz"], label: ["/path/to/seg/output/input_0/input_0_seg.nii.gz"]},
    {image: ["/path/to/image/input/input_1.nii.gz"], label: ["/path/to/seg/output/input_1/input_1_seg.nii.gz"]},
    ...,
    {image: ["/path/to/image/input/input_n.nii.gz"], label: ["/path/to/seg/output/input_n/input_n_seg.nii.gz"]},
]

The image and label parameters are set to lists in case there are multiple inputs/outputs.

@staydelight

This comment was marked as off-topic.

staydelight pushed a commit to staydelight/MONAI that referenced this issue May 14, 2024
Add a function to create a JSON file that maps input and output paths.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue May 14, 2024
Remove changes unrelated to this issue.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue May 14, 2024
Remove changes unrelated to this issue.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue May 14, 2024
Remove changes unrelated to this issue.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 1, 2024
Add code for generating a mapping json file.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 1, 2024
Change mapping_json_path init way.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 3, 2024
Fixing unsuccessful checks.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 3, 2024
Fixes unseccessful ckecks. (if mapping_json_path is not None)

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 3, 2024
Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Add a function to create a JSON file that maps input and output paths.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Remove changes unrelated to this issue.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Remove changes unrelated to this issue.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Remove changes unrelated to this issue.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Add code for generating a mapping json file.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Change mapping_json_path init way.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Fixing unsuccessful checks.

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Fixes unseccessful ckecks. (if mapping_json_path is not None)

Signed-off-by: staydelight <[email protected]>
staydelight pushed a commit to staydelight/MONAI that referenced this issue Jun 13, 2024
Signed-off-by: staydelight <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants