Dictionary IO API

ImageDataIO.add_get_basename!Function
add_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!Function
change_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_dictFunction
write_dict(dict, out::AbstractString; kv_delimiter::AbstractString=" ", kk_delimiter::AbstractString="

")

Writes a dictionary to a file.

Arguments

  • dict: Dictionary to write
  • out::AbstractString: filename to write to
  • kv_delimiter::AbstractString (optional, default " ") delimiter between keys and values
  • kk_delimiter::AbstractString (optional, default "

") delimiter between subsequent keys

ImageDataIO.read_2d_dictFunction
read_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 file
  • outer_key_dtype::Type: data type of outer keys
  • inner_key_dtype::Type: data type of inner keys
  • val_dtype::Type: data type of values of inner dict
ImageDataIO.parse_1d_tupleFunction
parse_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_dictFunction
parse_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 parse
  • key_dtype::Type: element data type of dictionary keys
  • val_dtype::Type: element data type of dictionary values
ImageDataIO.split_arraysFunction
split_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 starts
  • back_delimiters: list of characters to delineate when an array ends
  • val_delimiters: list of characters to delineate separating values of the array
  • ignore_chars: list of characters to ignore and not put in the final array
ImageDataIO.multi_index_arrayFunction
multi_index_array(array, index)

Indexes a nested array at index as though the array was a mulit-dimensional array.

ImageDataIO.extract_keyFunction
extract_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 on
  • key: Key to interact with
  • n::Integer: The layer of the dictionary to interact with
  • extract::Bool: If true, extracts the key from the dictionary; if false, adds the key to the dictionary instead.