Integration of new cell-organelle-types
The following lists the steps that need to be taken to integrate new types of cell organelles into the prediction and segmentation pipeline:
Choose a short but clear name for the cell-organelle-type which is supposed to be integrated, which in the following is used as an identifier for the cell-organelle-type.
Examples for implemented cell-organelle-types are: ‘mi’ for mitochondria, ‘er’ for the endoplasmic reticulum and ‘golgi’ for the golgi apparatus.
In the following, the exemplary cell-organelle-name ‘co’ is used. It will have to be replaced with the chosen name.In
syconn/exec/exec_dense_prediction.pyadd a functionpredict_co(), analogue to the other functions for prediction of cell organelles (e.g.predict_erorpredict_golgi).
Within this function make sure to replace the cell-organelle-name in the parameter values passed topredict_dense_to_kd()accordingly; in particularglobal_params.config.mpath_coandtarget_names=['co'].
The simplest case would be to choosen_channel=2, one for the background volume and one for the corresponding cell-organelle-volume. If different channels are supposed to be predicted in this step, these parameters will need to be adapted accordingly.In
syconn/handler/config.pyin classDynConfigadd property-methodkd_co_path, which returnsself.entries['paths']['kd_co'].Also in
syconn/handler/config.pyin classDynConfigadd property-methodmpath_co, which returnsself.model_dir + '/co/model.pts'.
Correspondingly in the model directory add a directory co, in which the corresponding model for the prediction is stored.Also in
syconn/handler/config.pygive the functiongenerate_default_conf()an additional parameterkd_cowith default valueNone.
Within the function, setkd_cotoworking_dir + 'knossosdatasets/co/'if it was passed asNone.
Within the function addentries['paths']['kd_er'] = kd_erto write the given path of the knossos_dataset into the config-file.In
syconn/handler/config.ymlmake the following changes:To the list
process_cell_organellesadd the elementco.Under
paths:with an indentation add the linekd_co:(include the:).Under
versions:with an indentation add the lineco: version_no, whereversion_notypically is 0.Under
cell_objects:, undermin_obj_vx:, with an indentation add the lineco: min_vx_no, wheremin_vx_nois an integer set in a sensible manner. It specifies the minimum number of voxels an object needs to have, to be identified as an example of the corresponding cell-organelle-type.
E.g. it is 500 for a large structure like the mitochondrion, but for a small structure like the synaptic vesicles, it is 1.Under
cell_objects:, underprobathresholds:, with an indentation add the lineco: thresh, wherethreshis the probability-threshold for the generation of a segmentation dataset from a probability dataset and needs to be set to a number. Without any extra information, a reasonable choice isthresh=0.5.Under
cell_objects:, undermin_seed_vx:, with an indentation add the lineco: min_seed, withmin_seedthe seed for the watershed-algorithm (see description in the file).Under
cell_objects:, underextract_morph_op:, with an indentation add the lineco: morph_ops, wheremorph_opsis a list of possible morphological operations. See explanation in file.Under
meshes:, underdownsampling:, with an indentation add the lineco: mesh_down, wheremesh_downis a list of length 3, describing the downsampling.
All the steps taken above are implemented analogously for er
and golgi already, which could be used as examples and
base for further organelles to be integrated.