bids_atlas.utils.check_output_path¶
- bids_atlas.utils.check_output_path(path, atlas)[source]¶
Check if the desired path to save the atlas exists and if not, create it.
- Parameters:
path (string) – Path where the atlas will be saved. If None, the file will be saved in the current working directory.
atlas (string) – Name of the atlas that should be obtained.
- Returns:
path – A PosixPath indicating the path to the atlas.
- Return type:
PosixPath
Examples
Check if the indicated directory exists in the current directory, for example, concerning the AAL atlas.
>>> check_output_path(os.curdir, 'AAL')
Check if the indicated directory exists in the user’s Desktop, for example, concerning the AAL atlas.
>>> check_output_path('/home/user/Desktop', 'AAL')