FastSurferCNN.utils.lta

class FastSurferCNN.utils.lta.LTADict[source]

Typed dictionary containing all the information from an LTA transform file.

Attributes

type: int

nxforms: int

mean: list[float]

sigma: float

lta: AffineMatrix4x4

src_valid: int

src_filename: str

src_volume: list[int]

src_voxelsize: list[float]

src_xras: list[float]

src_yras: list[float]

src_zras: list[float]

src_cras: list[float]

dst_valid: int

dst_filename: str

dst_volume: list[int]

dst_voxelsize: list[float]

dst_xras: list[float]

dst_yras: list[float]

dst_zras: list[float]

dst_cras: list[float]

src: AffineMatrix4x4

dst: AffineMatrix4x4

Methods

clear()

copy()

fromkeys(iterable[, value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

keys()

pop(key[, default])

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem(/)

Remove and return a (key, value) pair as a 2-tuple.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

FastSurferCNN.utils.lta.read_lta(file)[source]

Read the LTA info.

FastSurferCNN.utils.lta.write_lta(filename, affine, src_fname, src_header, dst_fname, dst_header)[source]

Write linear transform array info to an .lta file.

Parameters:
filenamePath, str

File to write on.

affinenpt.ArrayLike

Linear transform array to be saved.

src_fnamePath, str

Source filename.

src_headerDict

Source header.

dst_fnamePath, str

Destination filename.

dst_headerDict

Destination header.

Raises:
ValueError

Header format missing field (Source or Destination).