MorphoNet.Plot Documentation

class morphonet.plot.Annotation(value, date=None, active=True)

Bases: object

Annotation of the properties

class morphonet.plot.Dataset(parent, begin=0, end=0, raw=None, segment=None, raw_dict=None, seg_dict=None, log=True, background=0, xml_file=None, temp_path='.temp', segname=None)

Bases: object

Dataset class automatically created when you specify your dataset path in the seDataset function from Plot()

Parameters:
  • begin (int) – minimal time point

  • end (int) – maximal time point

  • raw (string) – path to raw data file where time digits are in standard format (ex: (:03d) for 3 digits )(accept .gz)

  • segment (string) – path to segmented data file where time digits are in standard format (accept .gz)

  • log (bool) – keep the log

  • background (int) – the pixel value of the background inside the segmented image

  • xml_file (string) – path to the xml properties files (.xml)

  • temp_path (string) – temporary path to store all termporary data (but also curration)

add_daughter(c, d)

Create a temporal FUTUR link in the lineage

Parameters:
  • c (MorphoObject) – the cell

  • d (MorphoObject) – the daughter cell

Examples

mc.add_daughter(c,d)

Create a temporal link in the lineage between two object

Parameters:
  • c1 (MorphoObject) – the cell

  • c2 (MorphoObject) – the other cell

Examples

mc.add_link(c,m)

add_mother(c, m)

Create a temporal PAST link in the lineage

Parameters:
  • c (MorphoObject) – the cell

  • m (MorphoObject) – the mother cell

Examples

mc.add_mother(c,m)

add_seed(seed)

Add a seed in the seed list

Parameters:

seed (numpy array) – the coordinate of a seed

Examples

dataset.add_seed(np.int32([23,34,45]),1)

ask_regionprop(property)

Unity ask for a specific region to plot

cancel(skip_restart=False)

Cancel the last action (by put the STEP back)

compute_lineage_distance(filename=None)

Compare symetrical lineage tree (needs name propery)

copy_previous_vtk(t, channel, cells_updated)

Recopy the vtk files from the previous step in order to avoid recomputing cells_updated=None #All Cells to update cells_updated=[] #No Cells to update cells_updated=[1,2] #Sepcifc cells to update

del_cell_from_properties(cell)

Delete a cell from properties

Parameters:

cell (MorphoObject) – the cell

del_daughter(c, d)

Create a temporal PAST link in the lineage

Parameters:
  • c (MorphoObject) – the cell

  • d (MorphoObject) – the daughter cell

Examples

mc.del_daughter(c,d)

Delete any temporal link between c1 and c2

Parameters:
  • c1 (MorphoObject) – the cell

  • c2 (MorphoObject) – the pther cell

Examples

mc.del_link(c,d)

del_mother(c, m)

Remove a temporal FUTUR link in the lineage

Parameters:
  • c (MorphoObject) – the cell

  • m (MorphoObject) – the mother cell

Examples

mc.del_mother(c,m)

end_step()

Save the lineage after performing an action

export(export_path, image_file_type='nii.gz', export_temp=False, export_prop=None, export_skprop=None)

Export all the dataset with the last version of each file

get_actions()

Return all actions in order

get_center(data=None, txt=False)

Get the barycenter of a matrix passed in argument

Parameters:

data (numpy matrix) – the 3D image (could be segmented or rawdata)

Returns:

the barycenter of the image

Return type:

list of coordinates

Examples

center=dataset.get_center(seg)

get_channels(objects)

Return the order list of channels corresponding to the list of objects

get_last_step()

Return the last step version

get_last_version(filename, step_only=False, before=None)

Return the last file is exist in order of last steps first

get_last_version_glob_channels(filename)

Return the last file is exist in order of last steps first

get_mask_cell(mo, border)

Return a given property for a specific cell at a specific time point

get_mesh(t, channel)

Return the full mesh at t

get_mesh_object(mo)

Return the specific mesh of the object

get_object(*args)

Get an MorphoObject from a list of arguments (times, id, … )

Parameters:

*args (list of arugemnts) – the arguments which define the object, with at least 1 argument (object id with time =0 )

Return type:

MorphoObject class

Examples

dataset.get_object(1,2)

get_objects(objects)

Return the list of objects from string format

get_objects_at(objects, t)

Return the list of objects at a specific time point

get_property(property_name, property_type=None, reload=False, create=True)

Return the property for the dataset

get_raw(t, channel=0)

Get the rawdata data at a specitic time point

Parameters:

t (int) – the time point

Returns:

the raw data

Return type:

numpy matrix

Examples

dataset.get_raw(1)

get_regionprop_at(property, t, channel, ordered=False, recompute=False)

Return a given property for all cells at a specific time point Returns a dictionnary of cell - propertu value

get_regionprops_at(t, channel, recompute=False)

Load or compute (if not exist) all region properties for at a given time point and a given channel

get_seeds()

Return the list of seeds as string

Examples

seeds=mc.get_seeds()

get_seg(t, channel=0, filename=None)

Get the segmented data at a specitic time point

Parameters:
  • t (int) – the time point

  • channel (int) – the channel

Returns:

the segmented image

Return type:

numpy matrix

Examples

dataset.get_seg(1,0)

get_times(objects)

Return the order list of time points corresponding to the list of objects

init_regionprop(name, required=False)

Create an object of property

init_regionprops()

Initialize region properties object

np_where(mo)

is equal to np.where(data==mo.id)

read_first_txt(filename)

Read txt property file when initializing dataset (must be temporal) :param filename: :type filename: path to the property file

read_last_properties()

Read the last version of eacch property from the various step folder (FOR CELL LINEAGE)

read_properties()

Read the properties from the property folder

restart(plug, label=None)

Restart the curation mode after execution of a specific plugin

Parameters:

plug (MorphoPlug) – the plugin just executed

Examples

dataset.restart(fuse)

set_seg(t, data, channel=0, cells_updated=None)

Define the segmented data at a specitic time point (Used in the plugins ) Call this function when you modifiy something in the data

Parameters:
  • t (int) – the time point

  • data (numpy matrix) – the segmented image

  • channel (int) – channel of the seg to set

  • cells_updated ((optional) list) – list of cell just udpated by the plugin (in order to compute faster) None #All Cells to update [] #No Cells to update =[1,2] #Sepcifc cells to update

Examples

dataset.set_seg(1,data)

start_step(command, exec_time)

Prepare the step folder and save the command to the log file system

update_cells_at(t, channel)

We update the list of cells based on the last region version

update_properties(t, channel=0)

Update properties with deleted cells

class morphonet.plot.Object(t, id, channel=0)

Bases: object

class morphonet.plot.ScikitProperty(dataset, name)

Bases: object

Quantitative Information extract from Regions Properties from scikit image :param name: the name of the info :type name: string