Skip to content

I'm having some issues understanding SaveImage and SaveImaged output path and filename configuration #6188

Discussion options

You must be logged in to vote

I've found a solution, but it feels very convoluted, and prone to breaking on any future updates in MONAI. In the current version, V1.1.0, I can do the following.

First, I make a CustomFolderLayout, based on monai.data.folder_layout.FolderLayout:

class CustomFolderLayout:
    def __init__(
        self,
        output_dir: Path,
        extension: str = "",
        makedirs: bool = True,
        **kwargs: dict
    ):
        self.output_dir: Path = output_dir

        if not extension:
            self.ext = ""
        elif extension.startswith("."):
            self.ext = extension
        else:
            self.ext = f".{extension}"

        self.makedirs = makedirs

    def filename(self

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@KumoLiu
Comment options

@MathijsdeBoer
Comment options

@KumoLiu
Comment options

Answer selected by wyli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants