DataProperty

class morphonet.data.dataproperty.DataProperty(dataset, name, temp_path, prop_type)

Bases: object

The DataProperty is the class with which you manipulate MorphoNet Properties in the data module

clean_at(time)

Remove all elements from the property at time point given in parameter. Used to update scikit properties

Parameters:

time (int) – Time point to remove

generate_txt(added_comments=None)

Generate the txt version of the property, adding comments from added_comments

Parameters:

added_comments (list) – Added comments, list of strings, optional

Returns:

txt version of the property, as a list of line

Return type:

list of str

generate_xml(tree)

Generate the XML node for the current property

Parameters:

tree (xml.etree.ElementTree.Element) – XML tree to load the property in

Returns:

XML node for the complete property

Return type:

xml.etree.ElementTree.Element

get_float_values_at(time=-1)

Retrieve the list of values in the property for a given time point. :param time: Time point to list :type time: int :return: List of values in the property :rtype: list

get_keys()

Return all the keys of the property (objects_names)

Returns:

List all keys of the property

get_object_ids_at(time)

Retrieve the list of object ids in the property for a given time point.

Parameters:

time (int) – Time point to list

Returns:

List of object ids in the property

Return type:

list

get_object_value(t, idc, ch)

Retrieve value of cell in property

Parameters:
  • t (int) – Time point of the object

  • ch (int) – Channel of the object

  • idc (int) – Object ID in the segmentation

Returns:

Value of the object in the property, or None if not found

get_path(time)

Return path for given time :param time: Time to load the property :type time: int

get_step(time)

Return the step found for time point

Parameters:

time (int) – Time

get_values()

Return all the values of the property

Returns:

List all values of the property

Return type:

list

get_values_at(time=-1)

Retrieve the list of values in the property for a given time point. :param time: Time point to list :type time: int :return: List of values in the property :rtype: list

load_from_scikit(temp_path, time)

Load the property from a scikit properties file, at a specific time

Parameters:
  • temp_path (str) – Path to the txt file to load in temp

  • time (int) – Time to load the property

load_from_txt(temp_path, time=-1, min_time=-1, max_time=-1)

Load the property from a text file, already with morphonet format

Parameters:
  • temp_path (str) – Path to the txt file to load in temp

  • time (int) – Time to load the property, -1 for all times

remove_from_property(t, idc, ch)

Remove a specific cell from the property

Parameters:
  • t (int) – Time point of the object

  • ch (int) – Channel of the object

  • idc (int) – Object ID in the segmentation

set_object_value(t, idc, ch, value)

Change value of cell in the property

Parameters:
  • t (int) – Time point of the object

  • ch (int) – Channel of the object

  • idc (int) – Object ID in the segmentation

  • value – Value of the object in the property

set_path(path, time)

Set the current property path for time :param path: Path to the property :type path: str :param time: Time to load the property :type time: int

set_step(step, time)

Set the current step used to load the property

Parameters:
  • step (int) – Step to load the property

  • time (int) – Time