celldetective 1.3.0__py3-none-any.whl → 1.3.0.post1__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.
- celldetective/_version.py +1 -1
- celldetective/gui/classifier_widget.py +9 -4
- celldetective/io.py +4 -1
- celldetective/measure.py +5 -5
- {celldetective-1.3.0.dist-info → celldetective-1.3.0.post1.dist-info}/METADATA +1 -1
- {celldetective-1.3.0.dist-info → celldetective-1.3.0.post1.dist-info}/RECORD +10 -10
- {celldetective-1.3.0.dist-info → celldetective-1.3.0.post1.dist-info}/LICENSE +0 -0
- {celldetective-1.3.0.dist-info → celldetective-1.3.0.post1.dist-info}/WHEEL +0 -0
- {celldetective-1.3.0.dist-info → celldetective-1.3.0.post1.dist-info}/entry_points.txt +0 -0
- {celldetective-1.3.0.dist-info → celldetective-1.3.0.post1.dist-info}/top_level.txt +0 -0
celldetective/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.3.0"
|
|
1
|
+
__version__ = "1.3.0.post1"
|
|
@@ -242,18 +242,20 @@ class ClassifierWidget(QWidget, Styles):
|
|
|
242
242
|
|
|
243
243
|
def update_props_scatter(self, feature_changed=True):
|
|
244
244
|
|
|
245
|
+
class_name = self.class_name
|
|
246
|
+
|
|
245
247
|
try:
|
|
246
248
|
|
|
247
249
|
if not self.project_times:
|
|
248
250
|
self.scat_props.set_offsets(self.df.loc[self.df['FRAME']==self.currentFrame,[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
|
|
249
|
-
colors = [color_from_status(c) for c in self.df.loc[self.df['FRAME']==self.currentFrame,
|
|
251
|
+
colors = [color_from_status(c) for c in self.df.loc[self.df['FRAME']==self.currentFrame,class_name].to_numpy()]
|
|
250
252
|
self.scat_props.set_facecolor(colors)
|
|
251
253
|
self.scat_props.set_alpha(self.currentAlpha)
|
|
252
254
|
self.ax_props.set_xlabel(self.features_cb[1].currentText())
|
|
253
255
|
self.ax_props.set_ylabel(self.features_cb[0].currentText())
|
|
254
256
|
else:
|
|
255
257
|
self.scat_props.set_offsets(self.df[[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
|
|
256
|
-
colors = [color_from_status(c) for c in self.df[
|
|
258
|
+
colors = [color_from_status(c) for c in self.df[class_name].to_numpy()]
|
|
257
259
|
self.scat_props.set_facecolor(colors)
|
|
258
260
|
self.scat_props.set_alpha(self.currentAlpha)
|
|
259
261
|
self.ax_props.set_xlabel(self.features_cb[1].currentText())
|
|
@@ -282,7 +284,8 @@ class ClassifierWidget(QWidget, Styles):
|
|
|
282
284
|
def apply_property_query(self):
|
|
283
285
|
|
|
284
286
|
query = self.property_query_le.text()
|
|
285
|
-
self.df = classify_cells_from_query(self.df, self.
|
|
287
|
+
self.df = classify_cells_from_query(self.df, self.name_le.text(), query)
|
|
288
|
+
self.class_name = "status_"+self.name_le.text()
|
|
286
289
|
if self.df is None:
|
|
287
290
|
msgBox = QMessageBox()
|
|
288
291
|
msgBox.setIcon(QMessageBox.Warning)
|
|
@@ -292,7 +295,6 @@ class ClassifierWidget(QWidget, Styles):
|
|
|
292
295
|
returnValue = msgBox.exec()
|
|
293
296
|
if returnValue == QMessageBox.Ok:
|
|
294
297
|
return None
|
|
295
|
-
|
|
296
298
|
self.update_props_scatter()
|
|
297
299
|
|
|
298
300
|
def set_frame(self, value):
|
|
@@ -351,6 +353,7 @@ class ClassifierWidget(QWidget, Styles):
|
|
|
351
353
|
return None
|
|
352
354
|
|
|
353
355
|
name_map = {self.class_name: self.class_name_user}
|
|
356
|
+
print(f"{name_map=}")
|
|
354
357
|
self.df = self.df.drop(list(set(name_map.values()) & set(self.df.columns)), axis=1).rename(columns=name_map)
|
|
355
358
|
self.df.reset_index(inplace=True, drop=True)
|
|
356
359
|
|
|
@@ -379,6 +382,8 @@ class ClassifierWidget(QWidget, Styles):
|
|
|
379
382
|
#self.df[self.group_name_user] = self.df[self.group_name_user].replace({0: 1, 1: 0})
|
|
380
383
|
self.df.reset_index(inplace=True, drop=True)
|
|
381
384
|
|
|
385
|
+
if 'custom' in list(self.df.columns):
|
|
386
|
+
self.df = self.df.drop(['custom'],axis=1)
|
|
382
387
|
|
|
383
388
|
for pos,pos_group in self.df.groupby('position'):
|
|
384
389
|
pos_group.to_csv(pos+os.sep.join(['output', 'tables', f'trajectories_{self.mode}.csv']), index=False)
|
celldetective/io.py
CHANGED
|
@@ -766,6 +766,9 @@ def locate_stack_and_labels(position, prefix='Aligned', population="target"):
|
|
|
766
766
|
position = position.replace('\\', '/')
|
|
767
767
|
labels = locate_labels(position, population=population)
|
|
768
768
|
stack = locate_stack(position, prefix=prefix)
|
|
769
|
+
if len(labels) < len(stack):
|
|
770
|
+
fix_missing_labels(position, population=population, prefix=prefix)
|
|
771
|
+
labels = locate_labels(position, population=population)
|
|
769
772
|
assert len(stack) == len(
|
|
770
773
|
labels), f"The shape of the stack {stack.shape} does not match with the shape of the labels {labels.shape}"
|
|
771
774
|
|
|
@@ -1272,7 +1275,7 @@ def view_on_napari_btrack(data, properties, graph, stack=None, labels=None, rela
|
|
|
1272
1275
|
if stack is not None:
|
|
1273
1276
|
viewer.add_image(stack, channel_axis=-1, colormap=["gray"] * stack.shape[-1])
|
|
1274
1277
|
if labels is not None:
|
|
1275
|
-
viewer.add_labels(labels, name='segmentation', opacity=0.4)
|
|
1278
|
+
viewer.add_labels(labels.astype(int), name='segmentation', opacity=0.4)
|
|
1276
1279
|
viewer.add_points(vertices, size=4, name='points', opacity=0.3)
|
|
1277
1280
|
if data.shape[1]==4:
|
|
1278
1281
|
viewer.add_tracks(data, properties=properties, graph=graph, name='tracks')
|
celldetective/measure.py
CHANGED
|
@@ -1338,10 +1338,11 @@ def classify_cells_from_query(df, status_attr, query):
|
|
|
1338
1338
|
if not status_attr.startswith('status_'):
|
|
1339
1339
|
status_attr = 'status_'+status_attr
|
|
1340
1340
|
|
|
1341
|
-
df
|
|
1341
|
+
df = df.copy()
|
|
1342
|
+
df.loc[:,status_attr] = 0
|
|
1343
|
+
|
|
1342
1344
|
cols = extract_cols_from_query(query)
|
|
1343
1345
|
cols_in_df = np.all([c in list(df.columns) for c in cols], axis=0)
|
|
1344
|
-
|
|
1345
1346
|
if query=='':
|
|
1346
1347
|
print('The provided query is empty...')
|
|
1347
1348
|
else:
|
|
@@ -1354,11 +1355,10 @@ def classify_cells_from_query(df, status_attr, query):
|
|
|
1354
1355
|
df.loc[selection, status_attr] = 1
|
|
1355
1356
|
else:
|
|
1356
1357
|
df.loc[:, status_attr] = np.nan
|
|
1357
|
-
|
|
1358
1358
|
except Exception as e:
|
|
1359
|
-
print("The query could not be understood. No filtering was applied. {e}...")
|
|
1359
|
+
print(f"The query could not be understood. No filtering was applied. {e}...")
|
|
1360
1360
|
return None
|
|
1361
|
-
return df
|
|
1361
|
+
return df.copy()
|
|
1362
1362
|
|
|
1363
1363
|
def classify_tracks_from_query(df, event_name, query, irreversible_event=True, unique_state=False, r2_threshold=0.5, percentile_recovery=50):
|
|
1364
1364
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
celldetective/__init__.py,sha256=bi3SGTMo6s2qQBsJAaKy-a4xaGcTQVW8zsqaiX5XKeY,139
|
|
2
2
|
celldetective/__main__.py,sha256=_H9B620ntENFx9RBvlV6ybxpvtHzCbv5NnIPmDBr9Z0,1127
|
|
3
|
-
celldetective/_version.py,sha256=
|
|
3
|
+
celldetective/_version.py,sha256=psRKPA5pfVLLl8tIZkft2nS2RjrlphliNDLiwS7_UEA,28
|
|
4
4
|
celldetective/events.py,sha256=hPnGSeQtQEwLM7Ks9_7AnuXgEVjQXD_LZeoayE4v7x0,4847
|
|
5
5
|
celldetective/extra_properties.py,sha256=8DkxTvVs7gASsnnGurVZ3_zt6uR0pvvJhBKO2LC6hGk,5118
|
|
6
6
|
celldetective/filters.py,sha256=b0qKwHor1fvNA_dHovP17nQz8EsW5YlyhT2TJnayn08,3615
|
|
7
|
-
celldetective/io.py,sha256=
|
|
8
|
-
celldetective/measure.py,sha256=
|
|
7
|
+
celldetective/io.py,sha256=erGKB0ALcLe5ffuo7pkuACDBC2DR-ZBmJHUcKfCLkrM,86442
|
|
8
|
+
celldetective/measure.py,sha256=S2aEhAAdwNk2p2d8rGG78MoN1g19zTUxYQhCQ-febQI,56328
|
|
9
9
|
celldetective/neighborhood.py,sha256=GjF_fTmtcU8jq5XZT-DnDSp28VDTrsaHjIGJG7W2Ppk,52799
|
|
10
10
|
celldetective/preprocessing.py,sha256=iV5or20s8XPJXQZDsWzis7OBaqzPDyAo_cwcDVDuX5A,38188
|
|
11
11
|
celldetective/relative_measurements.py,sha256=qPHC6gtUaICNGKh6Qfh8y6NA4OUJauGcaj9_TUbrswg,24998
|
|
@@ -20,7 +20,7 @@ celldetective/gui/__init__.py,sha256=2_r2xfOj4_2xj0yBkCTIfzlF94AHKm-j6Pvpd7DddQc
|
|
|
20
20
|
celldetective/gui/about.py,sha256=FJZrj6C-p6uqp_3UaprKosuW-Sw9_HPNQAvFbis9Gdk,1749
|
|
21
21
|
celldetective/gui/analyze_block.py,sha256=sat8RECEeZxlaconZZIxI0IrIjwJo121PcBXqJmA1-o,24756
|
|
22
22
|
celldetective/gui/btrack_options.py,sha256=OrvbG5coZhLRk5jtXiLFJu34z1hWHN9kHkBiZ7XMZoI,39269
|
|
23
|
-
celldetective/gui/classifier_widget.py,sha256=
|
|
23
|
+
celldetective/gui/classifier_widget.py,sha256=cjCuBGvNPI9OQeBeLlLI2h9mDUHHslWkJRjn4JIuVOw,16098
|
|
24
24
|
celldetective/gui/configure_new_exp.py,sha256=Eyr-M4FH-4xrUJbIGNdKXAtXb_ULr8lCol26JSzXEww,20125
|
|
25
25
|
celldetective/gui/control_panel.py,sha256=JbS47IFeVHc1D2olWiUB_Lo9Bn20QJCPVwhXnRdlFec,18990
|
|
26
26
|
celldetective/gui/generic_signal_plot.py,sha256=OzlFr2RxspkyxW1YIhl_c3q63RXAngMPouYPhEtk0S0,29509
|
|
@@ -92,9 +92,9 @@ tests/test_segmentation.py,sha256=k1b_zIZdlytEdJcHjAUQEO3gTBAHtv5WvrwQN2xD4kc,34
|
|
|
92
92
|
tests/test_signals.py,sha256=No4cah6KxplhDcKXnU8RrA7eDla4hWw6ccf7xGnBokU,3599
|
|
93
93
|
tests/test_tracking.py,sha256=8hebWSqEIuttD1ABn-6dKCT7EXKRR7-4RwyFWi1WPFo,8800
|
|
94
94
|
tests/test_utils.py,sha256=NKRCAC1d89aBK5cWjTb7-pInYow901RrT-uBlIdz4KI,3692
|
|
95
|
-
celldetective-1.3.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
96
|
-
celldetective-1.3.0.dist-info/METADATA,sha256=
|
|
97
|
-
celldetective-1.3.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
98
|
-
celldetective-1.3.0.dist-info/entry_points.txt,sha256=2NU6_EOByvPxqBbCvjwxlVlvnQreqZ3BKRCVIKEv3dg,62
|
|
99
|
-
celldetective-1.3.0.dist-info/top_level.txt,sha256=6rsIKKfGMKgud7HPuATcpq6EhdXwcg_yknBVWn9x4C4,20
|
|
100
|
-
celldetective-1.3.0.dist-info/RECORD,,
|
|
95
|
+
celldetective-1.3.0.post1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
96
|
+
celldetective-1.3.0.post1.dist-info/METADATA,sha256=QzPTXc4_K4xgHDJ60xC7CaHbejQ9wjSXGwOEGj1LYrc,9971
|
|
97
|
+
celldetective-1.3.0.post1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
98
|
+
celldetective-1.3.0.post1.dist-info/entry_points.txt,sha256=2NU6_EOByvPxqBbCvjwxlVlvnQreqZ3BKRCVIKEv3dg,62
|
|
99
|
+
celldetective-1.3.0.post1.dist-info/top_level.txt,sha256=6rsIKKfGMKgud7HPuATcpq6EhdXwcg_yknBVWn9x4C4,20
|
|
100
|
+
celldetective-1.3.0.post1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|