Skip to content

2562 Add support to not save data in a separate folder #2576

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

Merged
merged 7 commits into from
Jul 12, 2021

Conversation

Nic-Ma
Copy link
Contributor

@Nic-Ma Nic-Ma commented Jul 12, 2021

Fixes #2562 .

Description

According to user's feedback, this PR enhanced the nifti_saver and png_saver to optionally save every image in a separate folder or not.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Nic-Ma Nic-Ma requested review from wyli, ericspod and rijobro July 12, 2021 10:09
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Jul 12, 2021

/black

@ericspod
Copy link
Member

I would suggest the default value should be False for this option to preserve existing behaviour, I personally would probably tend not to use this feature.

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Jul 12, 2021

I would suggest the default value should be False for this option to preserve existing behaviour, I personally would probably tend not to use this feature.

Hi @ericspod ,

Thanks for your review and comments!
Actually, the current existing behavior in MONAI v0.6 equals True here, that's why users asked to support saving all images in the same folder.

Thanks.

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Jul 12, 2021

/black

@Nic-Ma Nic-Ma requested a review from ericspod July 12, 2021 11:05
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Jul 12, 2021

Hi @ericspod ,

Thanks for your review.
I updated the PR according to your comments.
Could you please help review again?

Thanks in advance.

else:
output = os.path.join(subfolder_path, filename)
if separate_folder:
output = os.path.join(output, filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this filename should also have the postfix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will be used in the next lines for the subfolders that go in the folder referred to as output here.

Copy link
Contributor Author

@Nic-Ma Nic-Ma Jul 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @wyli @ericspod ,

I think you mean to save as: "output/image_seg/image_seg.nii", right? The existing bahvior in MONAI is "output/image/image_seg.nii".
Maybe let me change the original logic to "output/image_seg/image_seg.nii"? Seems there is not drawback?

Thanks.

@ericspod ericspod merged commit daf2c4f into Project-MONAI:dev Jul 12, 2021
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 this pull request may close these issues.

Save segmentation results in the same folder
3 participants