File IO#
- swick.read_swc()#
Reads an
.swcfile to create and return anSWCobject.- Parameters:
path – the path to the
.swcfile to be read- Returns:
an
SWCobject containing the loaded data- Raises:
SWCFormatError – if the file does not adhere to the SWC format
- swick.write_swc()#
Writes an
SWCobject into an.swcfile.- Parameters:
path – the path to the
.swcfile to be writtenswc – the
SWCobject 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
SWCobject containing the data to be written- Raises:
ValueError – if
delimeterordecimal_placesvalues are invalidSWCFormatError – if the
SWCobject is invalid