Elastix controller

class library.controller.elastix_controller.ElastixController

Bases: object

Controller class for the elastix table

Args:

Controller (Class): Parent class of sqalchemy session

add_elastix_row(animal, section, rotation, xshift, yshift, metric, iteration)

adding a row in the elastix table

Parameters:
  • animal – (str) Animal ID

  • section – (str) Section Number

  • rotation – float

  • xshift – float

  • yshift – float

check_elastix_metric_row(animal, section, iteration=0)

checks that a given elastix row exists in the database

Parameters:
  • (str) (animal) – Animal ID

  • (int) (section) – Section Number

Return bool:

if the row in question exists

check_elastix_row(animal, section, iteration=0)

checks that a given elastix row exists in the database

Parameters:

animal – (str): Animal ID

Section (int):

Section Number

Return boolean:

if the row in question exists

delete_elastix_iteration(animal, iteration=1)

Deletes a specific iteration of Elastix transformation for a given animal.

Args:

animal (str): The identifier for the animal. iteration (int, optional): The iteration number of the Elastix transformation to delete. Defaults to 1.

Returns:

None

get_elastix_count(animal, iteration)
get_elastix_row(animal, section, iteration)

Retrieve a specific row from the ElastixTransformation table based on the given animal, section, and iteration. :param animal (str): The identifier for the animal. :param section (int): The section number. :param iteration (int, optional): The iteration number. Defaults to 0. :return ElastixTransformation: The first matching row from the ElastixTransformation table, or None if no match is found. :raises NoResultFound: If no matching row is found in the database.

update_elastix_row(animal, section, updates, iteration)

Update a row

Parameters:
  • animal – (str) Animal ID

  • section – (str) Section Number

  • updates – dictionary of column:values to update