Dictionary IO API
ImageDataIO.add_get_basename! — Functionadd_get_basename!(param_path::Dict)Adds get_basename key to the dictionary param_path.
add_get_basename!(param_path::Dict, param::Dict)Adds get_basename key to the dictionary param_path, given information about multiple dataset timing in param.
ImageDataIO.change_rootpath! — Functionchange_rootpath!(param_path::Dict, new_rootpath::String)Updates a dictionary of paths param_path by changing the old rootpath to the new_rootpath
ImageDataIO.write_dict — Functionwrite_dict(dict, out::AbstractString; kv_delimiter::AbstractString=" ", kk_delimiter::AbstractString="")
Writes a dictionary to a file.
Arguments
dict: Dictionary to writeout::AbstractString: filename to write tokv_delimiter::AbstractString(optional, default " ") delimiter between keys and valueskk_delimiter::AbstractString(optional, default "
") delimiter between subsequent keys
ImageDataIO.read_2d_dict — Functionread_2d_dict(input::AbstractString, outer_key_dtype::Type, inner_key_dtype::Type, val_dtype::Type)Reads 2D dictionary (dictionary of dictionaries) from a file.
Arguments
input::AbstractString: input fileouter_key_dtype::Type: data type of outer keysinner_key_dtype::Type: data type of inner keysval_dtype::Type: data type of values of inner dict
ImageDataIO.parse_1d_tuple — Functionparse_1d_tuple(tuple_str::AbstractString, dtype::Type)Parses one-dimensional string tuple tuple_str::AbstractString into a tuple of the specified dtype::Type
ImageDataIO.parse_1d_dict — Functionparse_1d_dict(dict_str::AbstractString, key_dtype::Type, val_dtype::Type)Parses a 1D dictionary; the keys and values must be at most 1D arrays. Arguments:
dict_str::AbstractString: string representation of dictionary to parsekey_dtype::Type: element data type of dictionary keysval_dtype::Type: element data type of dictionary values
ImageDataIO.split_arrays — Functionsplit_arrays(arrays::AbstractString; fwd_delimiters=['[', '('], back_delimiters=[')', ']'], val_delimiters=[','], ignore_chars=[' ', ''])
Parses a string multi-dimensional array or list of arrays arrays::AbstractString into its component arrays.
Arguments
arrays::AbstractString: string of arrays to parse
Optional keyword arguments
fwd_delimiters: list of characters to delineate when an array startsback_delimiters: list of characters to delineate when an array endsval_delimiters: list of characters to delineate separating values of the arrayignore_chars: list of characters to ignore and not put in the final array
ImageDataIO.multi_index_array — Functionmulti_index_array(array, index)Indexes a nested array at index as though the array was a mulit-dimensional array.
ImageDataIO.extract_key — Functionextract_key(dict, key, n::Integer, extract::Bool)Adds or retrieves a key from a given layer of a nested dictionary.
Arguments
dict: Dictionary to operate onkey: Key to interact withn::Integer: The layer of the dictionary to interact withextract::Bool: If true, extracts the key from the dictionary; if false, adds the key to the dictionary instead.