File IO#
- swick.read_swc()#
Reads an
.swc
file to create and return anSWC
object.- Parameters:
path – the path to the
.swc
file to be read- Returns:
an
SWC
object containing the loaded data- Raises:
SWCFormatError – if the file does not adhere to the SWC format
- swick.write_swc()#
Writes an
SWC
object into an.swc
file.- Parameters:
path – the path to the
.swc
file to be writtenswc – the
SWC
object to be written to a filedelimeter – separator for fields (tabs and spaces only)
decimal_places – number of decimal places written for floats; if
-1
, uses as many as necessary for each field
- Returns:
an
SWC
object containing the data to be written- Raises:
ValueError – if
delimeter
ordecimal_places
values are invalidSWCFormatError – if the
SWC
object is invalid