reference
labkit.image.normalizePaths
Normalize image file path inputs to a string column.
Syntax
paths = labkit.image.normalizePaths(paths)
paths = labkit.image.normalizePaths(paths, "AllowEmpty", false)Description
Converts the path forms commonly returned by MATLAB file selection into one string column. Leading and trailing whitespace is removed and blank entries are discarded. Order and duplicate paths are preserved. A single character vector is treated as one path rather than one path per row.
This function normalizes text only. It does not expand relative paths, validate extensions, remove duplicates, or test file existence.
Inputs
paths- Character vector, string array, cell array, or empty value.
Outputs
paths- String column containing the nonblank normalized paths.
Name-Value Arguments
AllowEmpty- Logical scalar controlling whether zero paths are accepted. The default is true. false throws labkit:image:NoPaths when normalization produces an empty result.
Errors
labkit:image:InvalidPaths- paths is not char, string, cell, or empty.
labkit:image:NoPaths- No path remains and AllowEmpty is false.
Example
paths = labkit.image.normalizePaths([" frame01.png "; ""; "frame02.JPG"]);Related APIs
labkit.image.assertSupportedPaths— Throw when any path has an unsupported image extension.labkit.image.isSupportedPath— Return true when a path has a supported image extension.labkit.image.readFiles— Read image files into path/name/image records.labkit.image.adjustBrightnessContrast— Apply simple brightness and contrast adjustment.labkit.image.adjustHueSaturation— Apply HSV hue and saturation adjustment.labkit.image.displayName— Return a short image-file display name.labkit.image.ensureRgb— Return image data with exactly three color channels.labkit.image.fileDialogFilter— Return a file-chooser-compatible image filter.
Source
This page is generated from the MATLAB help text in +labkit/+image/normalizePaths.m.