celldetective 1.1.1.post1__py3-none-any.whl → 1.1.1.post3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -148,6 +148,7 @@ def segment_index(indices):
148
148
  model.config.use_gpu = use_gpu
149
149
  model.use_gpu = use_gpu
150
150
  print(f"StarDist model {modelname} successfully loaded.")
151
+ scale_model = scale
151
152
 
152
153
  elif model_type=='cellpose':
153
154
 
@@ -60,17 +60,10 @@ batch_size = training_instructions['batch_size']
60
60
 
61
61
  # Load dataset
62
62
  print(f'Datasets: {datasets}')
63
- X,Y = load_image_dataset(datasets, target_channels, train_spatial_calibration=spatial_calibration,
63
+ X,Y,filenames = load_image_dataset(datasets, target_channels, train_spatial_calibration=spatial_calibration,
64
64
  mask_suffix='labelled')
65
65
  print('Dataset loaded...')
66
66
 
67
- # Normalize images
68
- # X = normalize_per_channel(X,
69
- # normalization_percentile_mode=normalization_percentile,
70
- # normalization_values=normalization_values,
71
- # normalization_clipping=normalization_clip
72
- # )
73
-
74
67
  values = []
75
68
  percentiles = []
76
69
  for k in range(len(normalization_percentile)):
@@ -88,17 +81,6 @@ for k in range(len(X)):
88
81
  x_interp = np.moveaxis([interpolate_nan(x[:,:,c].copy()) for c in range(x.shape[-1])],0,-1)
89
82
  X[k] = x_interp
90
83
 
91
- # for x in X[:10]:
92
- # plt.imshow(x[:,:,0])
93
- # plt.colorbar()
94
- # plt.pause(2)
95
- # plt.close()
96
-
97
- # plt.imshow(x[:,:,1])
98
- # plt.colorbar()
99
- # plt.pause(2)
100
- # plt.close()
101
-
102
84
  Y = [fill_label_holes(y) for y in tqdm(Y)]
103
85
 
104
86
  assert len(X) > 1, "not enough training data"
@@ -107,7 +89,11 @@ ind = rng.permutation(len(X))
107
89
  n_val = max(1, int(round(validation_split * len(ind))))
108
90
  ind_train, ind_val = ind[:-n_val], ind[-n_val:]
109
91
  X_val, Y_val = [X[i] for i in ind_val] , [Y[i] for i in ind_val]
110
- X_trn, Y_trn = [X[i] for i in ind_train], [Y[i] for i in ind_train]
92
+ X_trn, Y_trn = [X[i] for i in ind_train], [Y[i] for i in ind_train]
93
+
94
+ files_train = [filenames[i] for i in ind_train]
95
+ files_val = [filenames[i] for i in ind_val]
96
+
111
97
  print('number of images: %3d' % len(X))
112
98
  print('- training: %3d' % len(X_trn))
113
99
  print('- validation: %3d' % len(X_val))
@@ -134,7 +120,10 @@ if model_type=='cellpose':
134
120
  import torch
135
121
 
136
122
  if not use_gpu:
123
+ print('Using CPU for training...')
137
124
  device = torch.device("cpu")
125
+ else:
126
+ print('Using GPU for training...')
138
127
 
139
128
  logger, log_file = logger_setup()
140
129
  print(f'Pretrained model: ',pretrained)
@@ -163,7 +152,7 @@ if model_type=='cellpose':
163
152
  config_inputs = {"channels": target_channels, "diameter": standard_diameter, 'cellprob_threshold': 0., 'flow_threshold': 0.4,
164
153
  'normalization_percentile': normalization_percentile, 'normalization_clip': normalization_clip,
165
154
  'normalization_values': normalization_values, 'model_type': 'cellpose',
166
- 'spatial_calibration': input_spatial_calibration}
155
+ 'spatial_calibration': input_spatial_calibration, 'dataset': {'train': files_train, 'validation': files_val}}
167
156
  json_input_config = json.dumps(config_inputs, indent=4)
168
157
  with open(os.sep.join([target_directory, model_name, "config_input.json"]), "w") as outfile:
169
158
  outfile.write(json_input_config)
@@ -234,7 +223,7 @@ elif model_type=='stardist':
234
223
 
235
224
  config_inputs = {"channels": target_channels, 'normalization_percentile': normalization_percentile,
236
225
  'normalization_clip': normalization_clip, 'normalization_values': normalization_values,
237
- 'model_type': 'stardist', 'spatial_calibration': spatial_calibration}
226
+ 'model_type': 'stardist', 'spatial_calibration': spatial_calibration, 'dataset': {'train': files_train, 'validation': files_val}}
238
227
 
239
228
  json_input_config = json.dumps(config_inputs, indent=4)
240
229
  with open(os.sep.join([target_directory, model_name, "config_input.json"]), "w") as outfile:
celldetective/utils.py CHANGED
@@ -2046,7 +2046,7 @@ def load_image_dataset(datasets, channels, train_spatial_calibration=None, mask_
2046
2046
 
2047
2047
  assert isinstance(channels, list),'Please provide a list of channels. Abort.'
2048
2048
 
2049
- X = []; Y = [];
2049
+ X = []; Y = []; files = [];
2050
2050
 
2051
2051
  for ds in datasets:
2052
2052
  print(f'Loading data from dataset {ds}...')
@@ -2101,9 +2101,10 @@ def load_image_dataset(datasets, channels, train_spatial_calibration=None, mask_
2101
2101
 
2102
2102
  X.append(image)
2103
2103
  Y.append(mask)
2104
+ files.append(im)
2104
2105
 
2105
2106
  assert len(X)==len(Y),'The number of images does not match with the number of masks... Abort.'
2106
- return X,Y
2107
+ return X,Y,files
2107
2108
 
2108
2109
 
2109
2110
  def download_url_to_file(url, dst, progress=True):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: celldetective
3
- Version: 1.1.1.post1
3
+ Version: 1.1.1.post3
4
4
  Summary: description
5
5
  Home-page: http://github.com/remyeltorro/celldetective
6
6
  Author: Rémy Torro
@@ -6,11 +6,11 @@ celldetective/filters.py,sha256=b0qKwHor1fvNA_dHovP17nQz8EsW5YlyhT2TJnayn08,3615
6
6
  celldetective/io.py,sha256=ptaX4GadWuf0zOQ3ZWSLCzihEID-YAalPfxW1nqvgIU,80889
7
7
  celldetective/measure.py,sha256=HDQZfSRx3daOCV5Snu1paYU5JYkwu8engO2qZqhTAUo,48089
8
8
  celldetective/neighborhood.py,sha256=QCuhesMHGyr3c3ys9wWcNR1HM6CHdHe51R8upoolgPw,49514
9
- celldetective/preprocessing.py,sha256=psCs4CAI7gG3YlKvxkXKnpClFL4SjWm5TToXq2ZwL-s,37137
9
+ celldetective/preprocessing.py,sha256=dpor6ry6RChzd-rdH98SQc0zvLZv95YZB5KIGym1mEY,37388
10
10
  celldetective/segmentation.py,sha256=Hu4-lOJ4UhPw2o0Hn_NPOCHsa6Iwsw5A3PR6X3Tzbb8,29196
11
11
  celldetective/signals.py,sha256=P7eiDZGGIAYCFBKjGCBi8gMBvJYywxlxZNzyGgw-26Y,102783
12
12
  celldetective/tracking.py,sha256=A0mhdF4uq4m8OX1-rhtuhG69rlh_6Pb34Aebu7hIeKM,37601
13
- celldetective/utils.py,sha256=00jBr_Ur6wX3xeFQzwgpFv9XDhnt_VCh-e2usFdrfo4,77543
13
+ celldetective/utils.py,sha256=f0VvWv5ZgndZiWsFFDs0O6tJlRXkRtPW0xEKM_R90yo,77581
14
14
  celldetective/datasets/segmentation_annotations/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  celldetective/datasets/signal_annotations/blank,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  celldetective/gui/__init__.py,sha256=y2dvrUdJi17QMgPjl8WN3XFHYzJpu2ul4_8y7MQV1Bk,941
@@ -22,22 +22,22 @@ celldetective/gui/configure_new_exp.py,sha256=ANJ-Zn4sjBphtj_aoJu6m1PFEKyv9gxeh9
22
22
  celldetective/gui/control_panel.py,sha256=wcDqe4XaDJRMmPmWKJpxd0D9V4_DrdRGnEH6D7B_IK0,17557
23
23
  celldetective/gui/gui_utils.py,sha256=PidFfdc8XASeIzZO5pfKgwqe4vROG7-KpYMcBZ42jdw,22673
24
24
  celldetective/gui/json_readers.py,sha256=fTrNrlxv9NCae8ZJexBEHxI3yCLRqt6F0Yo1OeDycfA,3686
25
- celldetective/gui/layouts.py,sha256=gC24lyA48hzOo2oabYF1vXTFh5r7WcQFVkqjAXXo5g0,26997
25
+ celldetective/gui/layouts.py,sha256=sHTWXsKdRoHYYrPELEW7djNetevcQ-RKW9aQQ2FvWoc,37644
26
26
  celldetective/gui/measurement_options.py,sha256=i0CdAfupHJAqhOT7RsufEK919sAzQnFBkQO4IAMYZL0,47704
27
27
  celldetective/gui/neighborhood_options.py,sha256=sdKxVRliZtuKSpcPfnFxqkW4V8rN2tzjhDxOPVmElyE,20191
28
28
  celldetective/gui/plot_measurements.py,sha256=xUoGxV6uXcen-t4yWtAmcGTUayICI-FxTVKPrWMNlfg,51799
29
29
  celldetective/gui/plot_signals_ui.py,sha256=TwWU2u3_mkRNsM8er0kI_kwr5EoZ29YEzlr0cQzyW4A,43732
30
30
  celldetective/gui/process_block.py,sha256=7n9glZ1ojEi1bObqwIj4giNhrteT69X1EPMQ1hK63aU,53565
31
- celldetective/gui/retrain_segmentation_model_options.py,sha256=-rkuUzI_vFFlZC3LAAYEELoJUKcz6PmkpCrxKZindhg,27218
32
- celldetective/gui/retrain_signal_model_options.py,sha256=uHZy3FGsGMHfZL_nYnuFiXF57XaAMVzjYxVF2OXhYnY,24184
31
+ celldetective/gui/retrain_segmentation_model_options.py,sha256=VixtKZTjoJFJy8X6aDbAf0zgK46aXj3I6oPP_92yqhA,22457
32
+ celldetective/gui/retrain_signal_model_options.py,sha256=gdK1ITuaTPNvnQWXYuUBcP_pH5cvaEEns5XejjTi_Eo,17854
33
33
  celldetective/gui/seg_model_loader.py,sha256=uKp8oab-4QdTGqb-tb6bOD-FLD_154GOvgWFYz97BwY,17350
34
34
  celldetective/gui/signal_annotator.py,sha256=4ymMpo_GjSBsJSRkyNKrWRLy0EFXHINbFtp9ykDqfGE,84864
35
35
  celldetective/gui/signal_annotator_options.py,sha256=-Q7f8eCwniqbgLJqMCa91Wc-V3VHAZidwt7LPd4Z5yU,10879
36
36
  celldetective/gui/styles.py,sha256=Vw4wr6MQ4iBwhOY-ZWAxFDZZ3CNohmEnuPPazwhJaho,4129
37
37
  celldetective/gui/survival_ui.py,sha256=2JGLC5m6D_gVLwnBAM7uEvuCKw1Cli8nM9i5s7TIpGg,33612
38
- celldetective/gui/tableUI.py,sha256=QRYlXc7751Ka5qbUHSGbE_nXTiiezAVfEWXiRKRmuRM,32188
38
+ celldetective/gui/tableUI.py,sha256=7QSvkvVpglcluLxqhKjehmYDwHoyZs0R7uLcJK_9fhs,34268
39
39
  celldetective/gui/thresholds_gui.py,sha256=b8SkG4DlfxBRjacKTe1NSNkq7rJm8lnSLifH-mg846k,49529
40
- celldetective/gui/viewers.py,sha256=G8uNb0U_4tJiZkcAWX9BbCSBIUbF4tjedZD-5o4WKxY,27734
40
+ celldetective/gui/viewers.py,sha256=buBholjAieaVVb6YinVhxPshEHxBEU3er_N0UrkwAew,27734
41
41
  celldetective/icons/logo-large.png,sha256=FXSwV3u6zEKcfpuSn4unnqB0oUnN9cHqQ9BCKWytrpg,36631
42
42
  celldetective/icons/logo.png,sha256=wV2OS8_dU5Td5cgdPbCOU3JpMpTwNuYLnfVcnQX0tJA,2437
43
43
  celldetective/icons/signals_icon.png,sha256=vEiKoqWTtN0-uJgVqtAlwCuP-f4QeWYOlO3sdp2tg2w,3969
@@ -60,10 +60,10 @@ celldetective/models/tracking_configs/ricm.json,sha256=L-vmwCR1f89U-qnH2Ms0cBfPF
60
60
  celldetective/models/tracking_configs/ricm2.json,sha256=DDjJ6ScYcDWvlsy7ujPID8v8H28vcNcMuZmNR8XmGxo,2718
61
61
  celldetective/scripts/analyze_signals.py,sha256=23TXGNw-j5xT3ss4mXlnKdBgFLnQ50JUEQOC6_H7Q_0,2203
62
62
  celldetective/scripts/measure_cells.py,sha256=4uRG6Dg0WsO-N8ZaBJ4loWOvX6FdHaCblIFXq6Dtirc,11000
63
- celldetective/scripts/segment_cells.py,sha256=OSP52sPPHyhfXEjiXXdezkDY4MiFXLBWTb2_umRBD-M,8269
63
+ celldetective/scripts/segment_cells.py,sha256=55hM3JbMoW5TB43uENgtvADL8BziI17B3GjG4axsj6s,8291
64
64
  celldetective/scripts/segment_cells_thresholds.py,sha256=GbWXa6xoO8s4PinJPZIxAuosw4vpzyJ7FiFYpSURojk,4998
65
65
  celldetective/scripts/track_cells.py,sha256=AaNiYEW4osYKKR2kbdVLOUnQEBbcZIA-D0mkhcxPWTY,7985
66
- celldetective/scripts/train_segmentation_model.py,sha256=UY493QK7_FhS9uHYl2eeEYx7t0kw1jhvc0YMY12YZpI,8614
66
+ celldetective/scripts/train_segmentation_model.py,sha256=rw5LD70PrE_SCBvaFt0ri1uSa-YI5DM5exH_BGVlw5Y,8515
67
67
  celldetective/scripts/train_signal_model.py,sha256=9-dmPCLKJ9ypjsV9AwFd-Sb6B6YaHS0QGT218H5hUPo,1861
68
68
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
69
  tests/test_events.py,sha256=eLFwwEEJfQAdwhews3-fn1HSvzozcNNFN_Qn0gOvQkE,685
@@ -76,9 +76,9 @@ tests/test_segmentation.py,sha256=-3b7o_fUVMYxfVwX5VHFqRF0dDXObSTtylf5XQGcq1A,34
76
76
  tests/test_signals.py,sha256=No4cah6KxplhDcKXnU8RrA7eDla4hWw6ccf7xGnBokU,3599
77
77
  tests/test_tracking.py,sha256=8hebWSqEIuttD1ABn-6dKCT7EXKRR7-4RwyFWi1WPFo,8800
78
78
  tests/test_utils.py,sha256=NKRCAC1d89aBK5cWjTb7-pInYow901RrT-uBlIdz4KI,3692
79
- celldetective-1.1.1.post1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
80
- celldetective-1.1.1.post1.dist-info/METADATA,sha256=MItn6uMJhqWHbN0urj8068yO8xcUoc9c3kUsYTVre10,12418
81
- celldetective-1.1.1.post1.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
82
- celldetective-1.1.1.post1.dist-info/entry_points.txt,sha256=2NU6_EOByvPxqBbCvjwxlVlvnQreqZ3BKRCVIKEv3dg,62
83
- celldetective-1.1.1.post1.dist-info/top_level.txt,sha256=6rsIKKfGMKgud7HPuATcpq6EhdXwcg_yknBVWn9x4C4,20
84
- celldetective-1.1.1.post1.dist-info/RECORD,,
79
+ celldetective-1.1.1.post3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
80
+ celldetective-1.1.1.post3.dist-info/METADATA,sha256=r2-IaTUiO4VxRyIFdQJbsYx_MJltOPt76Emkf8XqAtk,12418
81
+ celldetective-1.1.1.post3.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
82
+ celldetective-1.1.1.post3.dist-info/entry_points.txt,sha256=2NU6_EOByvPxqBbCvjwxlVlvnQreqZ3BKRCVIKEv3dg,62
83
+ celldetective-1.1.1.post3.dist-info/top_level.txt,sha256=6rsIKKfGMKgud7HPuATcpq6EhdXwcg_yknBVWn9x4C4,20
84
+ celldetective-1.1.1.post3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.1)
2
+ Generator: setuptools (70.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5