class_docstr: A utility class to create organized filenames within ``output_dir``. The
  ``filename`` method could be used to create a filename following the folder structure.
  
  Example:
  
  .. code-block:: python
  
      from monai.data import FolderLayout
  
      layout = FolderLayout(
          output_dir="/test_run_1/",
          postfix="seg",
          extension="nii",
          makedirs=False)
      layout.filename(subject="Sub-A", idx="00", modality="T1")
      # return value: "/test_run_1/Sub-A_seg_00_modality-T1.nii"
  
  The output filename is a string starting with a ``subject`` ID, and
  includes additional information about a customized index and image
  modality.  This utility class doesn't alter the underlying image data, but
  provides a convenient way to create filenames.
class_docstr_tok: ["A","utility","class","to","create","organized","filenames","within","``","output_dir","``",".","The","``","filename","``","method","could","be","used","to","create","a","filename","following","the","folder","structure",".","Example",":","..","code-block",":",":","python","from","monai.data","import","FolderLayout","layout","=","FolderLayout","(","output_dir=","''","\/test_run_1\/","''",",","postfix=","''","seg","''",",","extension=","''","nii","''",",","makedirs=False",")","layout.filename","(","subject=","''","Sub-A","''",",","idx=","''","00","''",",","modality=","''","T1","''",")","#","return","value",":","``","\/test_run_1\/Sub-A_seg_00_modality-T1.nii","''","The","output","filename","is","a","string","starting","with","a","``","subject","``","ID",",","and","includes","additional","information","about","a","customized","index","and","image","modality",".","This","utility","class","does","n't","alter","the","underlying","image","data",",","but","provides","a","convenient","way","to","create","filenames","."]
docstr: Args:
      output_dir: output directory.
      postfix: a postfix string for output file name appended to ``subject``.
      extension: output file extension to be appended to the end of an output filename.
      parent: whether to add a level of parent folder to contain each image to the output filename.
      makedirs: whether to create the output parent directories if they do not exist.
      data_root_dir: an optional `PathLike` object to preserve the folder structure of the input `subject`.
          Please see :py:func:`monai.data.utils.create_file_basename` for more details.
docstr_tok: ["Args",":","output_dir",":","output","directory",".","postfix",":","a","postfix","string","for","output","file","name","appended","to","``","subject","``",".","extension",":","output","file","extension","to","be","appended","to","the","end","of","an","output","filename",".","parent",":","whether","to","add","a","level","of","parent","folder","to","contain","each","image","to","the","output","filename",".","makedirs",":","whether","to","create","the","output","parent","directories","if","they","do","not","exist",".","data_root_dir",":","an","optional","`","PathLike","`","object","to","preserve","the","folder","structure","of","the","input","`","subject","`",".","Please","see",":","py",":","func",":","`","monai.data.utils.create_file_basename","`","for","more","details","."]
code: def __init__(
      self,
      output_dir: PathLike,
      postfix: str = "",
      extension: str = "",
      parent: bool = False,
      makedirs: bool = False,
      data_root_dir: PathLike = "",
  ):
      """
      Args:
          output_dir: output directory.
          postfix: a postfix string for output file name appended to ``subject``.
          extension: output file extension to be appended to the end of an output filename.
          parent: whether to add a level of parent folder to contain each image to the output filename.
          makedirs: whether to create the output parent directories if they do not exist.
          data_root_dir: an optional `PathLike` object to preserve the folder structure of the input `subject`.
              Please see :py:func:`monai.data.utils.create_file_basename` for more details.
      """
      self.output_dir = output_dir
      self.postfix = postfix
      self.ext = extension
      self.parent = parent
      self.makedirs = makedirs
      self.data_root_dir = data_root_dir
  
file_path: MONAI/monai/data/folder_layout.py
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  import monai
  from monai.config import PathLike
  from monai.data.utils import create_file_basename
label_desc: Use image node_id 1 to create a new FolderLayout object from inherited base classes: FolderLayoutBase with example: obj = FolderLayout(output_dir, postfix, extension, parent, makedirs, data_root_dir)