Commit b77ba1f6 authored by Félix Hartmann's avatar Félix Hartmann
Browse files

When skeleton detection is relaunched, all dictionaries with previously

computed values are now deleted.
parent f6eb65b3
......@@ -1024,6 +1024,11 @@ def launch_process():
for i in range(len(base_tiges)):
hdf5_tigeid = get_hdf5_tigeid(hdf5file, i)
# Delete all organ-related dictionaries in the hdf5 file
for dict_name in ('growth_data', 'B_data', 'beta_data', 'gamma_data'):
h5store.delete_tige_dict_in_hdf(hdf5file, hdf5_tigeid, dict_name)
if hdf5_tigeid in hdf_tiges_seuil_offset:
# On regarde si la valeur enregistrée est pas None et
# si c'est le cas on met la valeur de l'offset à 0
......@@ -575,6 +575,19 @@ def save_tige_dict_to_hdf(hdf5file, tige_id, dict_data):
mode='a', create_dataset_args=hdf5_create_args)
def delete_tige_dict_in_hdf(hdf5file, tige_id, dict_name):
Delete an organ-related data dictionnary from an hdf5 file.
The dictionnary is supposed to be in /data/tige{tige_id}/postprocessing/...
dict_group = '/data/tige%i/postprocessing/%s' % (tige_id, dict_name)
# Test whether the group
with h5py.File(hdf5file, 'a') as f:
if dict_group in f:
del f[dict_group]
def save_pixelscale(hdf5file, scale_cmpix):
Fonction pour sauvegarder l'échelle pixels centimètre de l'image
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment