kaveh commited on
Commit
b74cd3b
·
2 Parent(s): 8f0c0aedc31c70

Merge branch 'main' of github.com:Angione-Lab/Shape2Force

Browse files
.gitattributes CHANGED
@@ -36,4 +36,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
36
  *.tiff filter=lfs diff=lfs merge=lfs -text
37
  *.tif filter=lfs diff=lfs merge=lfs -text
38
  *.tiff filter=lfs diff=lfs merge=lfs -text
39
- *.png filter=lfs diff=lfs merge=lfs -text
 
 
36
  *.tiff filter=lfs diff=lfs merge=lfs -text
37
  *.tif filter=lfs diff=lfs merge=lfs -text
38
  *.tiff filter=lfs diff=lfs merge=lfs -text
39
+ *.png filter=lfs diff=lfs merge=lfs -text
40
+ *.csv text eol=lf
.gitignore CHANGED
@@ -14,3 +14,6 @@ S2FApp/*.docx
14
 
15
  # experiments: trained ablation checkpoints (large)
16
  experiments/runs*/
 
 
 
 
14
 
15
  # experiments: trained ablation checkpoints (large)
16
  experiments/runs*/
17
+
18
+ outputs/*
19
+ !outputs/.gitkeep
S2FApp/.streamlit/config.toml CHANGED
@@ -6,12 +6,36 @@ enableXsrfProtection = false
6
  # [client]
7
  # toolbarMode = "minimal"
8
 
 
 
 
9
  [theme]
10
  primaryColor = "#0d9488"
 
 
 
11
  backgroundColor = "#ffffff"
12
  secondaryBackgroundColor = "#f8fafc"
13
  textColor = "#1e293b"
14
- font = "sans serif"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  [logger]
17
  level = "error"
 
6
  # [client]
7
  # toolbarMode = "minimal"
8
 
9
+ # Shared accent. Light and dark palettes live in [theme.light] / [theme.dark]
10
+ # (Streamlit ≥1.51). With both set, the app follows the system setting and
11
+ # can still be overridden from the app menu (Settings).
12
  [theme]
13
  primaryColor = "#0d9488"
14
+ font = "sans serif"
15
+
16
+ [theme.light]
17
  backgroundColor = "#ffffff"
18
  secondaryBackgroundColor = "#f8fafc"
19
  textColor = "#1e293b"
20
+ borderColor = "#e2e8f0"
21
+
22
+ [theme.light.sidebar]
23
+ backgroundColor = "#f8fafc"
24
+ secondaryBackgroundColor = "#ffffff"
25
+ textColor = "#1e293b"
26
+
27
+ [theme.dark]
28
+ backgroundColor = "#0b1220"
29
+ secondaryBackgroundColor = "#111827"
30
+ textColor = "#e2e8f0"
31
+ borderColor = "#334155"
32
+ primaryColor = "#2dd4bf"
33
+
34
+ [theme.dark.sidebar]
35
+ backgroundColor = "#111827"
36
+ secondaryBackgroundColor = "#0b1220"
37
+ textColor = "#e2e8f0"
38
+ primaryColor = "#2dd4bf"
39
 
40
  [logger]
41
  level = "error"
S2FApp/Dockerfile CHANGED
@@ -18,9 +18,14 @@ COPY requirements.txt requirements-docker.txt ./
18
  # Install Python dependencies - CPU-only PyTorch to fit Space memory limits (avoids OOM)
19
  # (psutil removed from requirements-docker.txt — optional CPU/RAM widget not used in app)
20
  # PyTorch 2.2 + torchvision 0.17 (CPU) - match requirements.txt torch>=2.0
21
- # Install numpy first with compatible version (<2) so torch.from_numpy works
 
 
 
 
22
  RUN pip install --no-cache-dir "numpy>=1.20.0,<2.0" && \
23
- pip install --no-cache-dir torch==2.2.0 torchvision==0.17.0 --index-url https://download.pytorch.org/whl/cpu && \
 
24
  pip install --no-cache-dir -r requirements-docker.txt
25
 
26
  # Copy app code (chown for HF Spaces permissions)
 
18
  # Install Python dependencies - CPU-only PyTorch to fit Space memory limits (avoids OOM)
19
  # (psutil removed from requirements-docker.txt — optional CPU/RAM widget not used in app)
20
  # PyTorch 2.2 + torchvision 0.17 (CPU) - match requirements.txt torch>=2.0
21
+ # Install numpy first with compatible version (<2) so torch.from_numpy works.
22
+ # Pin the +cpu local version and use --extra-index-url (not --index-url) so pip
23
+ # still uses PyPI for dependencies. --index-url hides PyPI; the PyTorch index then
24
+ # serves typing-extensions/jinja2 wheels that current pip rejects ("inconsistent
25
+ # Name"), and the source fallback cannot find flit_core.
26
  RUN pip install --no-cache-dir "numpy>=1.20.0,<2.0" && \
27
+ pip install --no-cache-dir "torch==2.2.0+cpu" "torchvision==0.17.0+cpu" \
28
+ --extra-index-url https://download.pytorch.org/whl/cpu && \
29
  pip install --no-cache-dir -r requirements-docker.txt
30
 
31
  # Copy app code (chown for HF Spaces permissions)
S2FApp/README.md CHANGED
@@ -29,13 +29,31 @@ Checkpoints are downloaded automatically from the [Shape2Force model repo](https
29
 
30
  ## Usage
31
 
32
- 1. Choose **Model type**: Single cell or Spheroid
33
- 2. Select a **Checkpoint** from `ckp/`
34
- 3. For single-cell: pick **Conditions** (e.g. Fibroblasts_Fibronectin_6KPa)
35
- 4. Upload an image or pick from `samples/`
36
- 5. Click **Run prediction**
37
-
38
- Output: heatmap, cell force (sum), and basic stats.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  ## Full Project
41
 
 
29
 
30
  ## Usage
31
 
32
+ 1. Choose **Model type**: Single cell or Spheroid.
33
+ 2. Select a **Checkpoint** from `ckp/`. The architecture is read from the checkpoint. For spheroids the default is
34
+ `ckp_spheroid_FN.pth`, a smaller supervised model (11.8 M parameters) with smoother maps and similar accuracy;
35
+ `ckp_spheroid_GN.pth` is the adversarial S2F model (77 M parameters).
36
+ 3. Single cell: keep the **Substrate setting** at *Reference (6 kPa)*. The released model is most accurate with this
37
+ setting for every image, including cells on 1 or 10 kPa gels; presets and manual values are for exploration.
38
+ 4. Enter the **Image pixel size** (µm/px) of your bright-field image, for the scale bar, area and total force
39
+ (0.325 µm/px for the single-cell training images).
40
+ 5. Upload an image or pick one from `samples/`, then click **Run prediction**.
41
+
42
+ ## Output and units
43
+
44
+ - The model predicts a normalised map in [0, 1] that converts to **traction stress** as
45
+ T = 500 Pa x value (single cells) or 50 Pa x value (spheroids), the fixed colour limits of the TFM ground-truth
46
+ maps used for training. All maps carry a colourbar in Pa and a µm scale bar.
47
+ - Metrics: mean and maximum traction stress (Pa), area (µm²) and total force (nN = Σ stress x pixel area). By default
48
+ (*Measure force region only*) they are computed inside the region of high predicted stress (red contour), estimated
49
+ from the predicted map, so that the background does not dilute them; switch it off for the whole image.
50
+ S2F predicts magnitude only, not direction.
51
+ - **Display range** narrows the colour window (e.g. 0–250 Pa); stresses above it saturate. Display only.
52
+ - **Downloads**: map PNG (scale bar + colourbar), CSV with metrics and parameters, and a PDF report that records the
53
+ input file, model, checkpoint SHA-256, substrate setting, pixel size, display and force-region settings and app
54
+ version. Batch mode gives a PDF (summary table + one page per image), a CSV, and a ZIP with, per image, the PNG and a
55
+ TIFF whose pixel values are traction stress in Pa (for measurements in Fiji/ImageJ). Reports record the app version
56
+ (`APP_VERSION` in `config/constants.py`; bump it and tag the GitHub release on each deploy).
57
 
58
  ## Full Project
59
 
S2FApp/app.py CHANGED
@@ -17,18 +17,26 @@ S2F_ROOT = os.path.dirname(os.path.abspath(__file__))
17
  if S2F_ROOT not in sys.path:
18
  sys.path.insert(0, S2F_ROOT)
19
 
 
 
20
  from config.constants import (
 
21
  BATCH_INFERENCE_SIZE,
22
  BATCH_MAX_IMAGES,
23
  COLORMAPS,
 
24
  DEFAULT_SUBSTRATE,
25
  MODEL_TYPE_LABELS,
 
26
  SAMPLE_EXTENSIONS,
27
  SAMPLE_THUMBNAIL_LIMIT,
 
 
28
  )
29
  from utils.paths import get_ckp_base, get_ckp_folder, get_sample_folder, list_files_in_folder, model_subfolder
30
  from utils.segmentation import estimate_cell_mask
31
- from utils.substrate_settings import list_substrates
 
32
  from utils.display import apply_display_scale
33
  from ui.components import (
34
  build_original_vals,
@@ -98,7 +106,7 @@ def _get_measure_dialog_fn():
98
 
99
  def _populate_measure_session_state(heatmap, img, pixel_sum, force, key_img, colormap_name,
100
  display_mode, auto_cell_boundary, cell_mask=None,
101
- clip_min=0, clip_max=1, clamp_only=False):
102
  """Populate session state for the measure tool. If cell_mask is None and auto_cell_boundary, computes it."""
103
  if cell_mask is None and auto_cell_boundary:
104
  cell_mask = estimate_cell_mask(heatmap)
@@ -109,10 +117,10 @@ def _populate_measure_session_state(heatmap, img, pixel_sum, force, key_img, col
109
  st.session_state["measure_clamp_only"] = clamp_only
110
  st.session_state["measure_bf_img"] = img.copy()
111
  st.session_state["measure_input_filename"] = key_img or "image"
112
- st.session_state["measure_original_vals"] = build_original_vals(heatmap, pixel_sum, force)
113
  st.session_state["measure_colormap"] = colormap_name
114
  st.session_state["measure_auto_cell_on"] = auto_cell_boundary
115
- st.session_state["measure_cell_vals"] = build_cell_vals(heatmap, cell_mask, pixel_sum, force) if auto_cell_boundary else None
116
  st.session_state["measure_cell_mask"] = cell_mask if auto_cell_boundary else None
117
 
118
 
@@ -131,7 +139,7 @@ if os.path.exists(_css_path):
131
  st.markdown("""
132
  <div class="s2f-header">
133
  <h1>🦠 Shape2Force (S2F)</h1>
134
- <p>Predict traction force maps from bright-field microscopy images of cells or spheroids</p>
135
  </div>
136
  """, unsafe_allow_html=True)
137
 
@@ -221,19 +229,25 @@ with st.sidebar:
221
  ["single_cell", "spheroid"],
222
  format_func=lambda x: MODEL_TYPE_LABELS[x],
223
  horizontal=False,
224
- help="Single cell: substrate-aware force prediction. Spheroid: spheroid force maps.",
225
  )
226
 
227
  ckp_folder = get_ckp_folder(ckp_base, model_type)
228
  ckp_files = list_files_in_folder(ckp_folder, ".pth")
229
  ckp_subfolder_name = model_subfolder(model_type)
230
 
 
 
 
 
 
231
  if ckp_files:
232
  checkpoint = st.selectbox(
233
  "Checkpoint",
234
  ckp_files,
235
  key=f"checkpoint_{model_type}",
236
- help=f"Select a .pth file from ckp/{ckp_subfolder_name}/",
 
237
  )
238
  else:
239
  st.warning(f"No .pth files in ckp/{ckp_subfolder_name}/. Add checkpoints to load.")
@@ -241,38 +255,60 @@ with st.sidebar:
241
 
242
  substrate_config = None
243
  substrate_val = DEFAULT_SUBSTRATE
244
- use_manual = True
 
245
  if model_type == "single_cell":
246
  try:
247
  with st.container(border=False, key="s2f_grp_conditions"):
248
- st.markdown('<p class="s2f-form-label s2f-form-label--section">Conditions</p>', unsafe_allow_html=True)
249
  conditions_source = st.radio(
250
- "Conditions",
251
- ["From config", "Manually"],
252
  horizontal=True,
253
  label_visibility="collapsed",
 
 
 
254
  )
255
- from_config = conditions_source == "From config"
256
- if from_config:
257
- substrate_config = None
 
 
258
  substrates = list_substrates()
259
  substrate_val = st.selectbox(
260
- "Conditions (from config)",
261
- substrates,
262
- help="Select a preset from config/substrate_settings.json",
263
- label_visibility="collapsed",
264
  )
265
- use_manual = False
 
 
266
  else:
267
- manual_pixelsize = st.number_input("Pixel size (µm/px)", min_value=0.1, max_value=50.0,
268
- value=3.0769, step=0.1, format="%.4f")
269
- manual_young = st.number_input("Pascals", min_value=100.0, max_value=100000.0,
 
 
270
  value=6000.0, step=100.0, format="%.0f")
271
  substrate_config = {"pixelsize": manual_pixelsize, "young": manual_young}
272
  use_manual = True
 
 
273
  except FileNotFoundError:
274
  st.error("config/substrate_settings.json not found")
275
 
 
 
 
 
 
 
 
 
 
 
 
276
  batch_mode = st.toggle(
277
  "Batch mode",
278
  value=False,
@@ -280,18 +316,23 @@ with st.sidebar:
280
  )
281
 
282
  auto_cell_boundary = st.toggle(
283
- "Auto boundary",
284
- value=False,
285
- help="When on: estimate cell region from force map and use it for metrics (red contour). When off: use entire map.",
 
 
 
286
  )
287
 
 
288
  with st.container(border=False, key="s2f_grp_force"):
289
  force_scale_mode = st.radio(
290
- "Force scale",
291
  ["Default", "Range"],
292
  horizontal=True,
293
  key="s2f_force_scale",
294
- help="Default: display forces on the full 0–1 scale. Range: set a sub-range; values outside are zeroed and the rest is stretched to the colormap.",
 
295
  )
296
  if force_scale_mode == "Default":
297
  clip_min, clip_max = 0.0, 1.0
@@ -300,29 +341,14 @@ with st.sidebar:
300
  else:
301
  mn_col, mx_col = st.columns(2)
302
  with mn_col:
303
- clip_min = st.number_input(
304
- "Min",
305
- min_value=0.0,
306
- max_value=1.0,
307
- value=0.0,
308
- step=0.01,
309
- format="%.2f",
310
- key="s2f_clip_min",
311
- help="Lower bound of the display range (0–1).",
312
- )
313
  with mx_col:
314
- clip_max = st.number_input(
315
- "Max",
316
- min_value=0.0,
317
- max_value=1.0,
318
- value=1.0,
319
- step=0.01,
320
- format="%.2f",
321
- key="s2f_clip_max",
322
- help="Upper bound of the display range (0–1).",
323
- )
324
  if clip_min >= clip_max:
325
- st.warning("Min must be less than max. Using 0.00–1.00 for display.")
326
  clip_min, clip_max = 0.0, 1.0
327
  display_mode = "Range"
328
  clamp_only = False
@@ -336,7 +362,7 @@ with st.sidebar:
336
  list(COLORMAPS.keys()),
337
  key="s2f_colormap",
338
  label_visibility="collapsed",
339
- help="Color scheme for the force map. Viridis is often preferred for accessibility.",
340
  )
341
 
342
 
@@ -429,12 +455,40 @@ def _load_predictor(model_type, checkpoint, ckp_folder):
429
  )
430
 
431
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  def _prepare_and_render_cached_result(r, key_img, colormap_name, display_mode, auto_cell_boundary,
433
  clip_min, clip_max, clamp_only,
434
  download_key_suffix="", check_measure_dialog=False,
435
  show_success=False):
436
  """Prepare display from cached result and render. Used by both just_ran and has_cached paths."""
437
  img, heatmap, force, pixel_sum = r["img"], r["heatmap"], r["force"], r["pixel_sum"]
 
 
 
 
438
  display_heatmap = apply_display_scale(
439
  heatmap, display_mode,
440
  clip_min=clip_min,
@@ -445,7 +499,7 @@ def _prepare_and_render_cached_result(r, key_img, colormap_name, display_mode, a
445
  _populate_measure_session_state(
446
  heatmap, img, pixel_sum, force, key_img, colormap_name,
447
  display_mode, auto_cell_boundary, cell_mask=cell_mask,
448
- clip_min=clip_min, clip_max=clip_max, clamp_only=clamp_only,
449
  )
450
  if check_measure_dialog and st.session_state.pop("open_measure_dialog", False):
451
  measure_region_dialog()
@@ -460,9 +514,23 @@ def _prepare_and_render_cached_result(r, key_img, colormap_name, display_mode, a
460
  auto_cell_boundary=auto_cell_boundary,
461
  cell_mask=cell_mask,
462
  clip_min=clip_min, clip_max=clip_max, clamp_only=clamp_only,
 
463
  )
464
 
465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
466
  if just_ran_batch:
467
  st.session_state["prediction_result"] = None
468
  st.session_state["batch_results"] = None
@@ -484,6 +552,7 @@ if just_ran_batch:
484
  pred_results.extend(chunk_results)
485
  progress_bar.progress(min(start + len(chunk), n_images) / n_images,
486
  text=f"Predicting {len(pred_results)} / {n_images} images")
 
487
  batch_results = [
488
  {
489
  "img": img_b.copy(),
@@ -491,11 +560,13 @@ if just_ran_batch:
491
  "force": force,
492
  "pixel_sum": pixel_sum,
493
  "key_img": key_b,
 
494
  "cell_mask": estimate_cell_mask(heatmap) if auto_cell_boundary else None,
495
  }
496
  for (img_b, key_b), (heatmap, force, pixel_sum) in zip(imgs_batch, pred_results)
497
  ]
498
  st.session_state["batch_results"] = batch_results
 
499
  progress_bar.empty()
500
  st.success(f"Prediction complete for {len(batch_results)} image(s)!")
501
  render_batch_results(
@@ -514,6 +585,7 @@ if just_ran_batch:
514
  st.code(traceback.format_exc())
515
 
516
  elif batch_mode and st.session_state.get("batch_results"):
 
517
  render_batch_results(
518
  st.session_state["batch_results"],
519
  colormap_name=colormap_name,
@@ -542,6 +614,7 @@ elif just_ran:
542
  "force": force,
543
  "pixel_sum": pixel_sum,
544
  "cache_key": cache_key,
 
545
  }
546
  st.session_state["prediction_result"] = r
547
  _prepare_and_render_cached_result(
 
17
  if S2F_ROOT not in sys.path:
18
  sys.path.insert(0, S2F_ROOT)
19
 
20
+ from datetime import datetime, timezone
21
+
22
  from config.constants import (
23
+ APP_VERSION,
24
  BATCH_INFERENCE_SIZE,
25
  BATCH_MAX_IMAGES,
26
  COLORMAPS,
27
+ DEFAULT_IMAGE_UM_PER_PX,
28
  DEFAULT_SUBSTRATE,
29
  MODEL_TYPE_LABELS,
30
+ REFERENCE_SUBSTRATE,
31
  SAMPLE_EXTENSIONS,
32
  SAMPLE_THUMBNAIL_LIMIT,
33
+ SPHEROID_DEFAULT_CKP,
34
+ STRESS_MAX_PA,
35
  )
36
  from utils.paths import get_ckp_base, get_ckp_folder, get_sample_folder, list_files_in_folder, model_subfolder
37
  from utils.segmentation import estimate_cell_mask
38
+ from utils.substrate_settings import get_settings_of_category, list_substrates
39
+ from utils.units import make_scale
40
  from utils.display import apply_display_scale
41
  from ui.components import (
42
  build_original_vals,
 
106
 
107
  def _populate_measure_session_state(heatmap, img, pixel_sum, force, key_img, colormap_name,
108
  display_mode, auto_cell_boundary, cell_mask=None,
109
+ clip_min=0, clip_max=1, clamp_only=False, scale=None):
110
  """Populate session state for the measure tool. If cell_mask is None and auto_cell_boundary, computes it."""
111
  if cell_mask is None and auto_cell_boundary:
112
  cell_mask = estimate_cell_mask(heatmap)
 
117
  st.session_state["measure_clamp_only"] = clamp_only
118
  st.session_state["measure_bf_img"] = img.copy()
119
  st.session_state["measure_input_filename"] = key_img or "image"
120
+ st.session_state["measure_original_vals"] = build_original_vals(heatmap, pixel_sum, force, scale)
121
  st.session_state["measure_colormap"] = colormap_name
122
  st.session_state["measure_auto_cell_on"] = auto_cell_boundary
123
+ st.session_state["measure_cell_vals"] = build_cell_vals(heatmap, cell_mask, pixel_sum, force, scale) if auto_cell_boundary else None
124
  st.session_state["measure_cell_mask"] = cell_mask if auto_cell_boundary else None
125
 
126
 
 
139
  st.markdown("""
140
  <div class="s2f-header">
141
  <h1>🦠 Shape2Force (S2F)</h1>
142
+ <p>Predict traction-stress magnitude maps (Pa) from bright-field microscopy images of cells or spheroids</p>
143
  </div>
144
  """, unsafe_allow_html=True)
145
 
 
229
  ["single_cell", "spheroid"],
230
  format_func=lambda x: MODEL_TYPE_LABELS[x],
231
  horizontal=False,
232
+ help="Single cell: substrate-aware force prediction. Spheroid: spheroid traction stress maps.",
233
  )
234
 
235
  ckp_folder = get_ckp_folder(ckp_base, model_type)
236
  ckp_files = list_files_in_folder(ckp_folder, ".pth")
237
  ckp_subfolder_name = model_subfolder(model_type)
238
 
239
+ if model_type == "spheroid" and SPHEROID_DEFAULT_CKP in ckp_files:
240
+ ckp_files = [SPHEROID_DEFAULT_CKP] + [f for f in ckp_files if f != SPHEROID_DEFAULT_CKP]
241
+ _ckp_notes = {"ckp_spheroid_FN.pth": "recommended: smoother maps, 11.8 M parameters",
242
+ "ckp_spheroid_GN.pth": "S2F adversarial model, 77 M parameters",
243
+ "ckp_singlecell_GN.pth": "S2F, as in the paper"}
244
  if ckp_files:
245
  checkpoint = st.selectbox(
246
  "Checkpoint",
247
  ckp_files,
248
  key=f"checkpoint_{model_type}",
249
+ format_func=lambda f: f"{f} ({_ckp_notes[f]})" if f in _ckp_notes else f,
250
+ help=f"Select a .pth file from ckp/{ckp_subfolder_name}/. The architecture is read from the checkpoint.",
251
  )
252
  else:
253
  st.warning(f"No .pth files in ckp/{ckp_subfolder_name}/. Add checkpoints to load.")
 
255
 
256
  substrate_config = None
257
  substrate_val = DEFAULT_SUBSTRATE
258
+ use_manual = False
259
+ substrate_mode_label = "reference"
260
  if model_type == "single_cell":
261
  try:
262
  with st.container(border=False, key="s2f_grp_conditions"):
263
+ st.markdown('<p class="s2f-form-label s2f-form-label--section">Substrate setting (model input)</p>', unsafe_allow_html=True)
264
  conditions_source = st.radio(
265
+ "Substrate setting",
266
+ ["Reference (6 kPa)", "Preset", "Manual"],
267
  horizontal=True,
268
  label_visibility="collapsed",
269
+ help="The released model is most accurate with the 6 kPa reference setting for all images, "
270
+ "including cells on 1 or 10 kPa gels (sensitivity analysis in the paper). Other settings "
271
+ "rescale the prediction and are provided for exploration only.",
272
  )
273
+ if conditions_source == "Reference (6 kPa)":
274
+ substrate_val = REFERENCE_SUBSTRATE
275
+ st.caption("Recommended. Used for all results in the paper.")
276
+ elif conditions_source == "Preset":
277
+ substrate_mode_label = "preset"
278
  substrates = list_substrates()
279
  substrate_val = st.selectbox(
280
+ "Preset", substrates,
281
+ index=substrates.index(REFERENCE_SUBSTRATE) if REFERENCE_SUBSTRATE in substrates else 0,
282
+ help="Presets from config/substrate_settings.json", label_visibility="collapsed",
 
283
  )
284
+ if get_settings_of_category(substrate_val) != get_settings_of_category(REFERENCE_SUBSTRATE):
285
+ st.warning("Settings other than the 6 kPa reference reduce accuracy (e.g. the 1 kPa setting "
286
+ "makes predictions about 5 times smaller). Use for exploration only.")
287
  else:
288
+ substrate_mode_label = "manual"
289
+ manual_pixelsize = st.number_input("Pixel-size setting (TFM units, as in training)", min_value=0.1,
290
+ max_value=50.0, value=3.0769, step=0.1, format="%.4f",
291
+ help="Training used 3.0769 (fibroblasts) to 9.8138.")
292
+ manual_young = st.number_input("Young's modulus (Pa)", min_value=100.0, max_value=100000.0,
293
  value=6000.0, step=100.0, format="%.0f")
294
  substrate_config = {"pixelsize": manual_pixelsize, "young": manual_young}
295
  use_manual = True
296
+ if (abs(manual_pixelsize - 3.0769) > 1e-3) or manual_young != 6000.0:
297
+ st.warning("Settings other than the 6 kPa reference reduce accuracy. Use for exploration only.")
298
  except FileNotFoundError:
299
  st.error("config/substrate_settings.json not found")
300
 
301
+ with st.container(border=False, key="s2f_grp_pixel"):
302
+ _def_px = DEFAULT_IMAGE_UM_PER_PX.get(model_type) or 0.0
303
+ image_um_per_px = st.number_input(
304
+ "Image pixel size (µm/px)",
305
+ min_value=0.0, max_value=100.0, value=float(_def_px), step=0.005, format="%.4f",
306
+ key=f"s2f_um_per_px_{model_type}",
307
+ help="Pixel size of the uploaded bright-field image, for the scale bar, area (µm²) and total force (nN). "
308
+ "0 = unknown (only traction stress in Pa is reported). The single-cell training images "
309
+ "(2048 x 2048 px) have 0.325 µm/px.",
310
+ ) or None
311
+
312
  batch_mode = st.toggle(
313
  "Batch mode",
314
  value=False,
 
316
  )
317
 
318
  auto_cell_boundary = st.toggle(
319
+ "Measure force region only",
320
+ value=True,
321
+ help="On (recommended): the metrics are computed inside the region where the predicted traction stress is "
322
+ "high (red contour), so the empty background does not dilute the mean stress or the area. The region is "
323
+ "estimated automatically from the predicted map, not from the cell outline in the bright-field image. "
324
+ "Off: the metrics cover the whole image. For your own regions, use the Measure tool.",
325
  )
326
 
327
+ _smax = STRESS_MAX_PA["spheroid" if model_type == "spheroid" else "single_cell"]
328
  with st.container(border=False, key="s2f_grp_force"):
329
  force_scale_mode = st.radio(
330
+ "Display range",
331
  ["Default", "Range"],
332
  horizontal=True,
333
  key="s2f_force_scale",
334
+ help=f"Default: 0–{_smax:.0f} Pa (the full output scale of this model). Range: show a narrower window, "
335
+ "e.g. 0–250 Pa; stresses above the window are shown in the top colour. Display only.",
336
  )
337
  if force_scale_mode == "Default":
338
  clip_min, clip_max = 0.0, 1.0
 
341
  else:
342
  mn_col, mx_col = st.columns(2)
343
  with mn_col:
344
+ lo_pa = st.number_input("Min (Pa)", min_value=0.0, max_value=_smax, value=0.0, step=_smax / 50,
345
+ format="%.0f", key=f"s2f_clip_min_pa_{model_type}")
 
 
 
 
 
 
 
 
346
  with mx_col:
347
+ hi_pa = st.number_input("Max (Pa)", min_value=0.0, max_value=_smax, value=_smax, step=_smax / 50,
348
+ format="%.0f", key=f"s2f_clip_max_pa_{model_type}")
349
+ clip_min, clip_max = lo_pa / _smax, hi_pa / _smax
 
 
 
 
 
 
 
350
  if clip_min >= clip_max:
351
+ st.warning(f"Min must be less than max. Using 0–{_smax:.0f} Pa.")
352
  clip_min, clip_max = 0.0, 1.0
353
  display_mode = "Range"
354
  clamp_only = False
 
362
  list(COLORMAPS.keys()),
363
  key="s2f_colormap",
364
  label_visibility="collapsed",
365
+ help="Color scheme for the traction stress map. Viridis is often preferred for accessibility.",
366
  )
367
 
368
 
 
455
  )
456
 
457
 
458
+ def _build_info(predictor, key_img, img, pred_time, image_um_per_px, display_mode, clip_min, clip_max, colormap_name,
459
+ auto_cell_boundary):
460
+ """Provenance of one prediction (shown in the app and written to CSV/PDF)."""
461
+ smax = STRESS_MAX_PA["spheroid" if predictor.model_type == "spheroid" else "single_cell"]
462
+ sub = None
463
+ if predictor.model_type == "single_cell":
464
+ settings = substrate_config if (use_manual and substrate_config) else get_settings_of_category(sub_val_for_info)
465
+ sub = {"mode": substrate_mode_label if substrate_mode_label != "reference" else "preset",
466
+ "name": None if use_manual else (sub_val_for_info + (" (reference)" if substrate_mode_label == "reference" else "")),
467
+ "pixelsize": float(settings["pixelsize"]), "young": float(settings["young"]),
468
+ **predictor.substrate_channels(sub_val_for_info, substrate_config if use_manual else None)}
469
+ rng = (clip_min * smax, clip_max * smax) if display_mode == "Range" else (0.0, smax)
470
+ return {
471
+ "input_file": key_img or "image", "time": pred_time, "model": predictor.describe(), "substrate": sub,
472
+ "image_shape": tuple(img.shape[:2]), "image_um_per_px": image_um_per_px, "stress_max_pa": smax,
473
+ "display": {"mode": display_mode, "range_pa": rng, "colormap": colormap_name},
474
+ "auto_boundary": bool(auto_cell_boundary), "app_version": APP_VERSION,
475
+ "app_commit": os.environ.get("S2F_APP_COMMIT", ""),
476
+ }
477
+
478
+
479
+ sub_val_for_info = substrate_val if (model_type == "single_cell" and not use_manual) else DEFAULT_SUBSTRATE
480
+
481
+
482
  def _prepare_and_render_cached_result(r, key_img, colormap_name, display_mode, auto_cell_boundary,
483
  clip_min, clip_max, clamp_only,
484
  download_key_suffix="", check_measure_dialog=False,
485
  show_success=False):
486
  """Prepare display from cached result and render. Used by both just_ran and has_cached paths."""
487
  img, heatmap, force, pixel_sum = r["img"], r["heatmap"], r["force"], r["pixel_sum"]
488
+ predictor = _load_predictor(model_type, checkpoint, ckp_folder)
489
+ scale = make_scale(model_type, image_um_per_px, img.shape[:2], heatmap.shape)
490
+ info = _build_info(predictor, key_img, img, r.get("time", "–"), image_um_per_px, display_mode, clip_min, clip_max,
491
+ colormap_name, auto_cell_boundary)
492
  display_heatmap = apply_display_scale(
493
  heatmap, display_mode,
494
  clip_min=clip_min,
 
499
  _populate_measure_session_state(
500
  heatmap, img, pixel_sum, force, key_img, colormap_name,
501
  display_mode, auto_cell_boundary, cell_mask=cell_mask,
502
+ clip_min=clip_min, clip_max=clip_max, clamp_only=clamp_only, scale=scale,
503
  )
504
  if check_measure_dialog and st.session_state.pop("open_measure_dialog", False):
505
  measure_region_dialog()
 
514
  auto_cell_boundary=auto_cell_boundary,
515
  cell_mask=cell_mask,
516
  clip_min=clip_min, clip_max=clip_max, clamp_only=clamp_only,
517
+ scale=scale, info=info,
518
  )
519
 
520
 
521
+ def _attach_batch_info(results):
522
+ """Physical scale and provenance for each batch result (depends on current sidebar settings)."""
523
+ predictor = _load_predictor(model_type, checkpoint, ckp_folder)
524
+ for r in results:
525
+ r["scale"] = make_scale(model_type, image_um_per_px, r["img"].shape[:2], r["heatmap"].shape)
526
+ r["info"] = _build_info(predictor, r["key_img"], r["img"], r.get("time", "–"), image_um_per_px, display_mode,
527
+ clip_min, clip_max, colormap_name, auto_cell_boundary)
528
+
529
+
530
+ def _utc_now():
531
+ return datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
532
+
533
+
534
  if just_ran_batch:
535
  st.session_state["prediction_result"] = None
536
  st.session_state["batch_results"] = None
 
552
  pred_results.extend(chunk_results)
553
  progress_bar.progress(min(start + len(chunk), n_images) / n_images,
554
  text=f"Predicting {len(pred_results)} / {n_images} images")
555
+ pred_time = _utc_now()
556
  batch_results = [
557
  {
558
  "img": img_b.copy(),
 
560
  "force": force,
561
  "pixel_sum": pixel_sum,
562
  "key_img": key_b,
563
+ "time": pred_time,
564
  "cell_mask": estimate_cell_mask(heatmap) if auto_cell_boundary else None,
565
  }
566
  for (img_b, key_b), (heatmap, force, pixel_sum) in zip(imgs_batch, pred_results)
567
  ]
568
  st.session_state["batch_results"] = batch_results
569
+ _attach_batch_info(batch_results)
570
  progress_bar.empty()
571
  st.success(f"Prediction complete for {len(batch_results)} image(s)!")
572
  render_batch_results(
 
585
  st.code(traceback.format_exc())
586
 
587
  elif batch_mode and st.session_state.get("batch_results"):
588
+ _attach_batch_info(st.session_state["batch_results"])
589
  render_batch_results(
590
  st.session_state["batch_results"],
591
  colormap_name=colormap_name,
 
614
  "force": force,
615
  "pixel_sum": pixel_sum,
616
  "cache_key": cache_key,
617
+ "time": _utc_now(),
618
  }
619
  st.session_state["prediction_result"] = r
620
  _prepare_and_render_cached_result(
S2FApp/config/constants.py CHANGED
@@ -6,8 +6,36 @@ import cv2
6
  # Model & paths
7
  MODEL_INPUT_SIZE = 1024
8
 
9
- # Default substrate (used when config lookup fails or manual mode fallback)
 
 
 
 
10
  DEFAULT_SUBSTRATE = "Fibroblasts_Fibronectin_6KPa"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  # UI
13
  CANVAS_SIZE = 320
 
6
  # Model & paths
7
  MODEL_INPUT_SIZE = 1024
8
 
9
+ APP_VERSION = "1.1.0" # shown in reports; the git commit is added from S2F_APP_COMMIT if set
10
+
11
+ # Default substrate (used when config lookup fails or manual mode fallback).
12
+ # 6 kPa reference setting: the released single-cell model is most accurate with it for every image
13
+ # (sensitivity analysis in the paper's revision, Fig. S4), so it is the recommended input.
14
  DEFAULT_SUBSTRATE = "Fibroblasts_Fibronectin_6KPa"
15
+ REFERENCE_SUBSTRATE = DEFAULT_SUBSTRATE
16
+
17
+ # Normalisation of the two substrate channels: the ranges used in training (S2F config/substrate_settings.json).
18
+ # Fixed here so that the model input does not depend on which presets the app lists.
19
+ SETTINGS_NORMALIZATION = {"pixelsize": {"min": 3.0769, "max": 9.8138}, "young": {"min": 1000.0, "max": 10000.0}}
20
+
21
+ # Physical scale of the output: the ground-truth maps were exported on a fixed colour scale,
22
+ # so a normalised value of 1 corresponds to this traction stress.
23
+ STRESS_MAX_PA = {"single_cell": 500.0, "spheroid": 50.0}
24
+
25
+ # Default pixel size of the bright-field image (µm/px) offered in the sidebar; None = ask the user.
26
+ # 0.325 µm/px is the pixel size of the 2048 x 2048 single-cell training images (TFM setting 3.0769 px/µm).
27
+ DEFAULT_IMAGE_UM_PER_PX = {"single_cell": 0.325, "spheroid": None}
28
+
29
+ # Spheroid checkpoints: default = the smaller supervised model (FN), which gives smoother maps and similar accuracy
30
+ # (validation, 28 spheroids: pixel r 0.88 vs 0.88, RME 0.44 vs 0.47, MS-SSIM 0.79 vs 0.74 for the S2F/GN model)
31
+ SPHEROID_DEFAULT_CKP = "ckp_spheroid_FN.pth"
32
+ ARCH_LABELS = {
33
+ "s2f": "S2F generator (attention U-Net + PatchGAN training), 77.0 M parameters",
34
+ "s2f_spheroid": "Supervised attention U-Net (no discriminator), 11.8 M parameters",
35
+ }
36
+
37
+ # Auto-boundary parameters (utils/segmentation.estimate_cell_mask defaults), recorded in reports
38
+ AUTO_BOUNDARY_DESCRIPTION = "high-stress region from the predicted map: Otsu threshold x 0.85 after Gaussian smoothing (sigma 2 px), dilated by 4 px"
39
 
40
  # UI
41
  CANVAS_SIZE = 320
S2FApp/download_ckp.py CHANGED
@@ -14,12 +14,8 @@ if not has_any:
14
  repo = os.environ.get("HF_MODEL_REPO", "Angione-Lab/Shape2Force")
15
  files = list_repo_files(repo)
16
  pth_files = [f for f in files if f.startswith("ckp/") and f.endswith(".pth")]
17
- # For spheroid: only download ckp_spheroid_FN.pth (not ckp_spheroid_GN.pth or others)
18
- def should_download(f):
19
- if "spheroid" in f and "ckp_spheroid_FN.pth" not in f:
20
- return False
21
- return True
22
- pth_files = [f for f in pth_files if should_download(f)]
23
  for f in pth_files:
24
  hf_hub_download(repo_id=repo, filename=f, local_dir="/app")
25
  print("Downloaded checkpoints from", repo)
 
14
  repo = os.environ.get("HF_MODEL_REPO", "Angione-Lab/Shape2Force")
15
  files = list_repo_files(repo)
16
  pth_files = [f for f in files if f.startswith("ckp/") and f.endswith(".pth")]
17
+ # All checkpoints: single cell (S2F), spheroid S2F (ckp_spheroid_GN.pth, the model reported in the paper)
18
+ # and the smaller supervised spheroid model (ckp_spheroid_FN.pth, the app default).
 
 
 
 
19
  for f in pth_files:
20
  hf_hub_download(repo_id=repo, filename=f, local_dir="/app")
21
  print("Downloaded checkpoints from", repo)
S2FApp/predictor.py CHANGED
@@ -2,6 +2,7 @@
2
  Core inference logic for S2F (Shape2Force).
3
  Predicts force maps from bright field microscopy images.
4
  """
 
5
  import os
6
  import sys
7
  import cv2
@@ -77,9 +78,34 @@ def create_settings_channels_single(substrate_name, device, height, width, confi
77
  return torch.cat([pixelsize_ch, young_ch], dim=1)
78
 
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  class S2FPredictor:
81
  """
82
  Shape2Force predictor for single-cell or spheroid force map prediction.
 
 
83
  """
84
 
85
  def __init__(self, model_type="single_cell", checkpoint_path=None, ckp_folder=None, device=None):
@@ -97,37 +123,58 @@ class S2FPredictor:
97
  ckp_dir = ckp_folder if ckp_folder else os.path.join(ckp_base, subfolder)
98
  if not os.path.isdir(ckp_dir):
99
  ckp_dir = ckp_base # fallback if subfolders not used
100
-
101
- in_channels = 3 if model_type == "single_cell" else 1
102
- s2f_model_type = "s2f" if model_type == "single_cell" else "s2f_spheroid"
103
- generator, _ = create_s2f_model(in_channels=in_channels, model_type=s2f_model_type)
104
- self.generator = generator
105
-
106
- if checkpoint_path:
107
- full_path = checkpoint_path
108
- if not os.path.isabs(checkpoint_path):
109
- full_path = os.path.join(ckp_dir, checkpoint_path)
110
- if not os.path.exists(full_path):
111
- full_path = os.path.join(ckp_base, checkpoint_path) # try base folder
112
- if not os.path.exists(full_path):
113
- raise FileNotFoundError(f"Checkpoint not found: {full_path}")
114
-
115
- if model_type == "single_cell":
116
- self.generator.load_checkpoint_with_expansion(full_path, strict=True)
117
- else:
118
- checkpoint = torch.load(full_path, map_location="cpu", weights_only=False)
119
- state = checkpoint.get("generator_state_dict") or checkpoint.get("model_state_dict") or checkpoint
120
- self.generator.load_state_dict(state, strict=True)
121
- if hasattr(self.generator, "set_output_mode"):
122
- self.generator.set_output_mode(use_tanh=False) # sigmoid [0,1] for inference
123
-
124
- self.generator = self.generator.to(self.device)
125
- self.generator.eval()
126
-
 
 
127
  self.norm_params = compute_settings_normalization() if model_type == "single_cell" else None
128
- self._use_tanh_output = model_type == "single_cell" # single_cell uses tanh, spheroid uses sigmoid
129
  self.config_path = os.path.join(S2F_ROOT, "config", "substrate_settings.json")
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  def predict(self, image_path=None, image_array=None, substrate=None,
132
  substrate_config=None):
133
  """
@@ -171,7 +218,7 @@ class S2FPredictor:
171
 
172
  if self._use_tanh_output:
173
  pred = (pred + 1.0) / 2.0 # Tanh [-1,1] to [0, 1]
174
- # else: spheroid already outputs sigmoid [0, 1]
175
  heatmap = pred[0, 0].cpu().numpy()
176
  force = sum_force_map(pred).item()
177
  pixel_sum = float(np.sum(heatmap))
 
2
  Core inference logic for S2F (Shape2Force).
3
  Predicts force maps from bright field microscopy images.
4
  """
5
+ import hashlib
6
  import os
7
  import sys
8
  import cv2
 
78
  return torch.cat([pixelsize_ch, young_ch], dim=1)
79
 
80
 
81
+ def file_sha256(path, chunk=1 << 20):
82
+ """SHA-256 of a file (recorded in reports so a prediction can be traced to its checkpoint)."""
83
+ h = hashlib.sha256()
84
+ with open(path, "rb") as f:
85
+ for block in iter(lambda: f.read(chunk), b""):
86
+ h.update(block)
87
+ return h.hexdigest()
88
+
89
+
90
+ def detect_architecture(state_dict):
91
+ """
92
+ Generator architecture from the checkpoint keys:
93
+ 's2f' S2FGenerator (multi-scale input 'scale_pyramid.*'); tanh output -> (y + 1) / 2
94
+ 's2f_spheroid' supervised attention U-Net ('encoder1.*'); sigmoid output in [0, 1]
95
+ """
96
+ keys = list(state_dict.keys())
97
+ if any(k.startswith("scale_pyramid.") or k.startswith("initial_conv.") for k in keys):
98
+ return "s2f"
99
+ if any(k.startswith("encoder1.") for k in keys):
100
+ return "s2f_spheroid"
101
+ raise ValueError("Unrecognised checkpoint: neither S2FGenerator nor the supervised spheroid model")
102
+
103
+
104
  class S2FPredictor:
105
  """
106
  Shape2Force predictor for single-cell or spheroid force map prediction.
107
+ The generator architecture is selected from the checkpoint itself, so both spheroid checkpoints
108
+ (ckp_spheroid_GN.pth = S2F generator as in the paper, ckp_spheroid_FN.pth = smaller supervised model) load.
109
  """
110
 
111
  def __init__(self, model_type="single_cell", checkpoint_path=None, ckp_folder=None, device=None):
 
123
  ckp_dir = ckp_folder if ckp_folder else os.path.join(ckp_base, subfolder)
124
  if not os.path.isdir(ckp_dir):
125
  ckp_dir = ckp_base # fallback if subfolders not used
126
+ if not checkpoint_path:
127
+ raise ValueError("checkpoint_path is required")
128
+
129
+ full_path = checkpoint_path
130
+ if not os.path.isabs(checkpoint_path):
131
+ full_path = os.path.join(ckp_dir, checkpoint_path)
132
+ if not os.path.exists(full_path):
133
+ full_path = os.path.join(ckp_base, checkpoint_path) # try base folder
134
+ if not os.path.exists(full_path):
135
+ raise FileNotFoundError(f"Checkpoint not found: {full_path}")
136
+
137
+ checkpoint = torch.load(full_path, map_location="cpu", weights_only=False)
138
+ state = checkpoint.get("generator_state_dict") or checkpoint.get("model_state_dict") or checkpoint
139
+ self.architecture = detect_architecture(state)
140
+ self.in_channels = 3 if model_type == "single_cell" else 1
141
+ generator, _ = create_s2f_model(in_channels=self.in_channels, model_type=self.architecture)
142
+ if model_type == "single_cell":
143
+ generator.load_checkpoint_with_expansion(full_path, strict=True)
144
+ else:
145
+ generator.load_state_dict(state, strict=True)
146
+ if self.architecture == "s2f_spheroid" and hasattr(generator, "set_output_mode"):
147
+ generator.set_output_mode(use_tanh=False) # trained with sigmoid output in [0, 1]
148
+ self._use_tanh_output = self.architecture == "s2f" # S2FGenerator: tanh in [-1, 1]
149
+
150
+ self.generator = generator.to(self.device).eval()
151
+ self.checkpoint_name = os.path.basename(full_path)
152
+ self.checkpoint_sha256 = file_sha256(full_path)
153
+ self.checkpoint_epoch = checkpoint.get("epoch") if isinstance(checkpoint, dict) else None
154
+ self.n_params = sum(p.numel() for p in self.generator.parameters())
155
  self.norm_params = compute_settings_normalization() if model_type == "single_cell" else None
 
156
  self.config_path = os.path.join(S2F_ROOT, "config", "substrate_settings.json")
157
 
158
+ def describe(self):
159
+ """Model information for reports."""
160
+ return {
161
+ "model_type": self.model_type,
162
+ "architecture": self.architecture,
163
+ "checkpoint": self.checkpoint_name,
164
+ "checkpoint_sha256": self.checkpoint_sha256,
165
+ "checkpoint_epoch": self.checkpoint_epoch,
166
+ "n_params_M": round(self.n_params / 1e6, 1),
167
+ "device": str(self.device),
168
+ }
169
+
170
+ def substrate_channels(self, substrate=None, substrate_config=None):
171
+ """Values of the two substrate input channels (normalised pixel-size and Young's-modulus settings)."""
172
+ if self.model_type != "single_cell":
173
+ return None
174
+ ch = create_settings_channels_single(substrate if substrate is not None else DEFAULT_SUBSTRATE, "cpu", 1, 1,
175
+ config_path=self.config_path, substrate_config=substrate_config)
176
+ return {"pixelsize_norm": float(ch[0, 0, 0, 0]), "young_norm": float(ch[0, 1, 0, 0])}
177
+
178
  def predict(self, image_path=None, image_array=None, substrate=None,
179
  substrate_config=None):
180
  """
 
218
 
219
  if self._use_tanh_output:
220
  pred = (pred + 1.0) / 2.0 # Tanh [-1,1] to [0, 1]
221
+ # else: the supervised spheroid model already outputs sigmoid [0, 1]
222
  heatmap = pred[0, 0].cpu().numpy()
223
  force = sum_force_map(pred).item()
224
  pixel_sum = float(np.sum(heatmap))
S2FApp/requirements-docker.txt CHANGED
@@ -4,7 +4,7 @@ numpy>=1.20.0,<2.0
4
  opencv-python>=4.5.0
5
  scipy>=1.7.0
6
  scikit-image>=0.19.0,<0.26
7
- streamlit>=1.29.0
8
  streamlit-drawable-canvas-fix>=0.9.8
9
  matplotlib>=3.5.0
10
  Pillow>=9.0.0
 
4
  opencv-python>=4.5.0
5
  scipy>=1.7.0
6
  scikit-image>=0.19.0,<0.26
7
+ streamlit>=1.51.0
8
  streamlit-drawable-canvas-fix>=0.9.8
9
  matplotlib>=3.5.0
10
  Pillow>=9.0.0
S2FApp/requirements.txt CHANGED
@@ -5,7 +5,7 @@ numpy>=1.20.0
5
  opencv-python>=4.5.0
6
  scipy>=1.7.0
7
  scikit-image>=0.19.0
8
- streamlit>=1.29.0
9
  streamlit-drawable-canvas-fix>=0.9.8
10
  matplotlib>=3.5.0
11
  Pillow>=9.0.0
 
5
  opencv-python>=4.5.0
6
  scipy>=1.7.0
7
  scikit-image>=0.19.0
8
+ streamlit>=1.51.0
9
  streamlit-drawable-canvas-fix>=0.9.8
10
  matplotlib>=3.5.0
11
  Pillow>=9.0.0
S2FApp/static/s2f_styles.css CHANGED
@@ -6,13 +6,43 @@
6
  --s2f-primary-rgb: 13, 148, 136;
7
  /* Space for Streamlit’s fixed top toolbar (Deploy / menu). Set when header exists (see below). */
8
  --s2f-streamlit-header-offset: 0px;
9
- /* Sidebar grouped blocks: faint surface, no heavy chrome */
10
- --s2f-sidebar-panel-bg: rgba(255, 255, 255, 0.42);
11
- --s2f-sidebar-panel-border: rgba(203, 213, 225, 0.34);
12
  /* Match Streamlit’s sidebar horizontal padding so panels can full-bleed the track */
13
  --s2f-sidebar-inline-inset: 1rem;
14
  --s2f-sidebar-width: 360px;
15
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  /* Streamlit renders a fixed header; without this offset, the sidebar and first main block sit underneath it. */
17
  .stApp:has(header[data-testid="stHeader"]) {
18
  --s2f-streamlit-header-offset: 2rem;
@@ -42,9 +72,9 @@ html, body {
42
  overflow: hidden !important;
43
  display: flex !important;
44
  flex-direction: column !important;
45
- background-color: #fafbfc !important;
46
  background-image:
47
- radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.12) 1px, transparent 0);
48
  background-size: 28px 28px !important;
49
  background-position: 0 0, 0 0 !important;
50
  }
@@ -64,8 +94,8 @@ html, body {
64
  right: 0;
65
  bottom: 0;
66
  background:
67
- radial-gradient(ellipse 80% 50% at 70% -20%, rgba(var(--s2f-primary-rgb), 0.06) 0%, transparent 50%),
68
- radial-gradient(ellipse 60% 40% at 0% 100%, rgba(var(--s2f-primary-rgb), 0.04) 0%, transparent 50%);
69
  pointer-events: none;
70
  z-index: 0;
71
  }
@@ -143,16 +173,16 @@ section[data-testid="stSidebar"] {
143
  overflow-y: auto !important;
144
  scrollbar-gutter: stable !important;
145
  background:
146
- linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%),
147
  /* Subtle vertical rhythm */
148
  repeating-linear-gradient(
149
  90deg,
150
  transparent,
151
  transparent 89px,
152
- rgba(203, 213, 225, 0.25) 89px,
153
- rgba(203, 213, 225, 0.25) 90px
154
  ) !important;
155
- border-right: 1px solid #e2e8f0 !important;
156
  }
157
  @media (max-width: 768px) {
158
  section[data-testid="stSidebar"] { width: 100% !important; max-width: 100% !important; }
@@ -165,7 +195,7 @@ section[data-testid="stSidebar"] [data-testid="stWidgetLabel"],
165
  section[data-testid="stSidebar"] [data-testid="stWidgetLabel"] p {
166
  font-size: 0.9rem !important;
167
  font-weight: 500 !important;
168
- color: #334155 !important;
169
  }
170
  .sidebar-brand {
171
  display: flex;
@@ -177,7 +207,7 @@ section[data-testid="stSidebar"] [data-testid="stWidgetLabel"] p {
177
  .sidebar-brand .brand-text {
178
  font-size: 1.1rem;
179
  font-weight: 700;
180
- color: var(--s2f-primary-dark);
181
  letter-spacing: -0.01em;
182
  }
183
 
@@ -213,8 +243,8 @@ section[data-testid="stSidebar"] .st-key-s2f_grp_force > div {
213
 
214
  /* === Metric cards === */
215
  [data-testid="stMetric"] {
216
- background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
217
- border: 1px solid #e2e8f0;
218
  border-radius: 12px;
219
  padding: 0.85rem 1rem !important;
220
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
@@ -227,14 +257,14 @@ section[data-testid="stSidebar"] .st-key-s2f_grp_force > div {
227
  [data-testid="stMetric"] label {
228
  font-size: 0.75rem !important;
229
  font-weight: 600 !important;
230
- color: #64748b !important;
231
  text-transform: uppercase;
232
  letter-spacing: 0.04em;
233
  }
234
  [data-testid="stMetric"] [data-testid="stMetricValue"] {
235
  font-size: 1.25rem !important;
236
  font-weight: 700 !important;
237
- color: var(--s2f-primary-dark) !important;
238
  }
239
 
240
  /* === Buttons === */
@@ -255,7 +285,7 @@ section[data-testid="stSidebar"] .st-key-s2f_grp_force > div {
255
  .stButton > button:not([kind="primary"]) {
256
  border-radius: 10px !important;
257
  font-weight: 500 !important;
258
- border: 1px solid #cbd5e1 !important;
259
  transition: all 0.2s ease !important;
260
  }
261
  .stButton > button:not([kind="primary"]):hover {
@@ -275,8 +305,8 @@ section[data-testid="stSidebar"] .st-key-s2f_grp_force > div {
275
 
276
  /* === Action buttons row (measure + downloads) === */
277
  div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([data-testid="stButton"]) {
278
- background: #f8fafc;
279
- border: 1px solid #e2e8f0;
280
  border-radius: 14px;
281
  padding: 0.65rem 0.6rem !important;
282
  margin-top: 0.5rem;
@@ -307,22 +337,22 @@ div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([
307
  transform: translateY(-1px) !important;
308
  }
309
  div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([data-testid="stButton"]) [data-testid="stDownloadButton"] button {
310
- background: white !important;
311
- border: 1px solid #e2e8f0 !important;
312
- color: #334155 !important;
313
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
314
  }
315
  div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([data-testid="stButton"]) [data-testid="stDownloadButton"] button:hover {
316
  background: rgba(var(--s2f-primary-rgb), 0.06) !important;
317
  border-color: var(--s2f-primary) !important;
318
- color: var(--s2f-primary-dark) !important;
319
  box-shadow: 0 2px 6px rgba(var(--s2f-primary-rgb), 0.12) !important;
320
  transform: translateY(-1px) !important;
321
  }
322
 
323
  /* === Expanders === */
324
  .stExpander {
325
- border: 1px solid #e2e8f0 !important;
326
  border-radius: 12px !important;
327
  overflow: hidden;
328
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
@@ -330,7 +360,7 @@ div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([
330
 
331
  /* === File uploader === */
332
  [data-testid="stFileUploader"] section {
333
- border: 2px dashed #cbd5e1 !important;
334
  border-radius: 12px !important;
335
  transition: border-color 0.2s ease;
336
  }
@@ -345,7 +375,7 @@ div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([
345
  gap: 8px;
346
  font-size: 0.92rem;
347
  font-weight: 600;
348
- color: #334155;
349
  padding: 0.4rem 0;
350
  }
351
  .result-badge {
@@ -356,12 +386,12 @@ div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([
356
  letter-spacing: 0.06em;
357
  }
358
  .result-badge.input {
359
- background: #e2e8f0;
360
- color: #475569;
361
  }
362
  .result-badge.output {
363
  background: rgba(var(--s2f-primary-rgb), 0.15);
364
- color: var(--s2f-primary-dark);
365
  }
366
 
367
  /* === Run prediction info bar === */
@@ -371,29 +401,30 @@ div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([
371
  gap: 10px;
372
  height: 42px;
373
  font-size: 0.85rem;
374
- color: #64748b;
375
  }
376
  .run-info-tag {
377
  background: rgba(var(--s2f-primary-rgb), 0.1);
378
- color: var(--s2f-primary-dark);
379
  font-weight: 600;
380
  font-size: 0.78rem;
381
  padding: 3px 10px;
382
  border-radius: 6px;
383
  }
384
  .run-info code {
385
- background: #f1f5f9;
386
  padding: 2px 8px;
387
  border-radius: 4px;
388
  font-size: 0.8rem;
389
- color: #475569;
390
  }
391
 
392
  /* === Messages === */
393
  .stSuccess {
394
- background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
395
  border-left: 4px solid #10b981 !important;
396
  border-radius: 8px !important;
 
397
  }
398
  .stWarning { border-radius: 8px !important; }
399
  .stInfo { border-radius: 8px !important; }
@@ -402,19 +433,19 @@ div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([
402
  [data-testid="stSelectbox"] > div > div,
403
  [data-testid="stSelectbox"] input,
404
  [data-testid="stMultiSelect"] > div > div {
405
- color: #1e293b !important;
406
- background-color: #ffffff !important;
407
  }
408
  /* Multiselect input: transparent so it doesn't show as a white block before the tags */
409
  [data-testid="stMultiSelect"] input {
410
  background-color: transparent !important;
411
- color: #1e293b !important;
412
  min-width: 2ch !important;
413
  }
414
  [data-testid="stSelectbox"] > div > div,
415
  [data-testid="stMultiSelect"] > div > div {
416
  border-radius: 8px !important;
417
- border: 1px solid #cbd5e1 !important;
418
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
419
  }
420
  section[data-testid="stSidebar"] [data-testid="stSelectbox"] > div > div:focus-within,
@@ -428,7 +459,7 @@ section[data-testid="stSidebar"] [data-testid="stMultiSelect"] > div > div:focus
428
  }
429
  /* Toggle: on state uses --s2f-primary */
430
  [data-testid="stToggle"] [data-baseweb="toggleTrack"] {
431
- background-color: #cbd5e1 !important;
432
  }
433
  [data-testid="stToggle"] [data-baseweb="toggleTrack"][aria-checked="true"] {
434
  background-color: var(--s2f-primary) !important;
@@ -437,27 +468,27 @@ section[data-testid="stSidebar"] [data-testid="stMultiSelect"] > div > div:focus
437
  background-color: var(--s2f-primary) !important;
438
  }
439
  [data-testid="stToggle"] [data-baseweb="toggleTrack"][data-state="unchecked"] {
440
- background-color: #cbd5e1 !important;
441
  }
442
  /* Newer Streamlit may render a switch button instead of Base Web track */
443
  [data-testid="stToggle"] button[role="switch"][aria-checked="true"] {
444
  background-color: var(--s2f-primary) !important;
445
  }
446
  [data-testid="stToggle"] button[role="switch"][aria-checked="false"] {
447
- background-color: #cbd5e1 !important;
448
  }
449
- /* Dropdown options: ensure visible text on light background */
450
  [role="listbox"] [role="option"],
451
  [data-baseweb="menu"] li,
452
  ul[role="listbox"] li {
453
- color: #1e293b !important;
454
- background-color: #ffffff !important;
455
  }
456
  /* Sidebar / form labels (colormap row, section titles) */
457
  .s2f-form-label {
458
  font-size: 0.95rem;
459
  font-weight: 500;
460
- color: #334155;
461
  line-height: 1.2;
462
  margin: 0;
463
  }
@@ -492,7 +523,7 @@ ul[role="listbox"] li {
492
  padding: 0 1px;
493
  font-size: 0.65rem;
494
  font-weight: 600;
495
- color: #64748b;
496
  letter-spacing: 0.03em;
497
  }
498
  .colorbar-ticks .cb-tick {
@@ -508,7 +539,7 @@ ul[role="listbox"] li {
508
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
509
  }
510
  /* === Divider === */
511
- hr { border-color: #cbd5e1 !important; opacity: 0.7; }
512
 
513
  /* === Plotly chart === */
514
  .stPlotlyChart { border-radius: 12px; overflow: hidden; }
@@ -521,10 +552,10 @@ hr { border-color: #cbd5e1 !important; opacity: 0.7; }
521
  right: 0;
522
  z-index: 999;
523
  padding: 0.5rem 1rem 0.55rem;
524
- background: #f1f5f9;
525
- border-top: 1px solid #e2e8f0;
526
  font-size: 0.7rem;
527
- color: #64748b;
528
  text-align: center;
529
  line-height: 1.45;
530
  }
@@ -561,19 +592,33 @@ section[data-testid="stSidebar"] > div:first-child {
561
  /* Measure tool: value panel (replaces inline styles in measure_tool.py) */
562
  .s2f-measure-vals-heading {
563
  font-weight: 400;
564
- color: #334155;
565
  font-size: 0.95rem;
566
  margin: 0 20px 4px 4px;
567
  }
568
  .s2f-measure-vals-panel {
569
  width: 100%;
570
  box-sizing: border-box;
571
- border: 1px solid #e2e8f0;
572
  border-radius: 10px;
573
  padding: 10px 12px;
574
  margin: 0 10px 20px 10px;
575
- background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
576
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
  }
578
  .s2f-measure-vals-grid {
579
  display: flex;
 
6
  --s2f-primary-rgb: 13, 148, 136;
7
  /* Space for Streamlit’s fixed top toolbar (Deploy / menu). Set when header exists (see below). */
8
  --s2f-streamlit-header-offset: 0px;
 
 
 
9
  /* Match Streamlit’s sidebar horizontal padding so panels can full-bleed the track */
10
  --s2f-sidebar-inline-inset: 1rem;
11
  --s2f-sidebar-width: 360px;
12
  }
13
+ /*
14
+ * Surfaces follow the active Streamlit theme. light-dark() uses the color-scheme
15
+ * Streamlit sets from the system setting (or from Settings → Light / Dark).
16
+ */
17
+ .stApp {
18
+ --s2f-page-bg: light-dark(#fafbfc, #0b1220);
19
+ --s2f-page-dot: light-dark(rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.18));
20
+ --s2f-glow: light-dark(rgba(13, 148, 136, 0.06), rgba(45, 212, 191, 0.08));
21
+ --s2f-glow-2: light-dark(rgba(13, 148, 136, 0.04), rgba(45, 212, 191, 0.05));
22
+ --s2f-sidebar-start: light-dark(#f8fafc, #111827);
23
+ --s2f-sidebar-end: light-dark(#f1f5f9, #0f172a);
24
+ --s2f-sidebar-rule: light-dark(rgba(203, 213, 225, 0.25), rgba(51, 65, 85, 0.55));
25
+ --s2f-sidebar-panel-bg: light-dark(rgba(255, 255, 255, 0.42), rgba(15, 23, 42, 0.55));
26
+ --s2f-sidebar-panel-border: light-dark(rgba(203, 213, 225, 0.34), rgba(51, 65, 85, 0.75));
27
+ --s2f-text: light-dark(#1e293b, #e2e8f0);
28
+ --s2f-text-secondary: light-dark(#334155, #cbd5e1);
29
+ --s2f-text-muted: light-dark(#64748b, #94a3b8);
30
+ --s2f-text-faint: light-dark(#475569, #94a3b8);
31
+ --s2f-accent-text: light-dark(#0f766e, #5eead4);
32
+ --s2f-surface: light-dark(#ffffff, #111827);
33
+ --s2f-surface-2: light-dark(#f8fafc, #1e293b);
34
+ --s2f-surface-3: light-dark(#f1f5f9, #1e293b);
35
+ --s2f-border: light-dark(#e2e8f0, #334155);
36
+ --s2f-border-strong: light-dark(#cbd5e1, #475569);
37
+ --s2f-badge-bg: light-dark(#e2e8f0, #334155);
38
+ --s2f-code-bg: light-dark(#f1f5f9, #1e293b);
39
+ --s2f-footer-bg: light-dark(#f1f5f9, #0f172a);
40
+ --s2f-success-start: light-dark(#ecfdf5, #064e3b);
41
+ --s2f-success-end: light-dark(#d1fae5, #065f46);
42
+ --s2f-success-text: light-dark(#065f46, #d1fae5);
43
+ --s2f-shadow: light-dark(rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.35));
44
+ --s2f-shadow-hover: light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45));
45
+ }
46
  /* Streamlit renders a fixed header; without this offset, the sidebar and first main block sit underneath it. */
47
  .stApp:has(header[data-testid="stHeader"]) {
48
  --s2f-streamlit-header-offset: 2rem;
 
72
  overflow: hidden !important;
73
  display: flex !important;
74
  flex-direction: column !important;
75
+ background-color: var(--s2f-page-bg) !important;
76
  background-image:
77
+ radial-gradient(circle at 1px 1px, var(--s2f-page-dot) 1px, transparent 0);
78
  background-size: 28px 28px !important;
79
  background-position: 0 0, 0 0 !important;
80
  }
 
94
  right: 0;
95
  bottom: 0;
96
  background:
97
+ radial-gradient(ellipse 80% 50% at 70% -20%, var(--s2f-glow) 0%, transparent 50%),
98
+ radial-gradient(ellipse 60% 40% at 0% 100%, var(--s2f-glow-2) 0%, transparent 50%);
99
  pointer-events: none;
100
  z-index: 0;
101
  }
 
173
  overflow-y: auto !important;
174
  scrollbar-gutter: stable !important;
175
  background:
176
+ linear-gradient(180deg, var(--s2f-sidebar-start) 0%, var(--s2f-sidebar-end) 100%),
177
  /* Subtle vertical rhythm */
178
  repeating-linear-gradient(
179
  90deg,
180
  transparent,
181
  transparent 89px,
182
+ var(--s2f-sidebar-rule) 89px,
183
+ var(--s2f-sidebar-rule) 90px
184
  ) !important;
185
+ border-right: 1px solid var(--s2f-border) !important;
186
  }
187
  @media (max-width: 768px) {
188
  section[data-testid="stSidebar"] { width: 100% !important; max-width: 100% !important; }
 
195
  section[data-testid="stSidebar"] [data-testid="stWidgetLabel"] p {
196
  font-size: 0.9rem !important;
197
  font-weight: 500 !important;
198
+ color: var(--s2f-text-secondary) !important;
199
  }
200
  .sidebar-brand {
201
  display: flex;
 
207
  .sidebar-brand .brand-text {
208
  font-size: 1.1rem;
209
  font-weight: 700;
210
+ color: var(--s2f-accent-text);
211
  letter-spacing: -0.01em;
212
  }
213
 
 
243
 
244
  /* === Metric cards === */
245
  [data-testid="stMetric"] {
246
+ background: linear-gradient(145deg, var(--s2f-surface) 0%, var(--s2f-surface-2) 100%);
247
+ border: 1px solid var(--s2f-border);
248
  border-radius: 12px;
249
  padding: 0.85rem 1rem !important;
250
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
 
257
  [data-testid="stMetric"] label {
258
  font-size: 0.75rem !important;
259
  font-weight: 600 !important;
260
+ color: var(--s2f-text-muted) !important;
261
  text-transform: uppercase;
262
  letter-spacing: 0.04em;
263
  }
264
  [data-testid="stMetric"] [data-testid="stMetricValue"] {
265
  font-size: 1.25rem !important;
266
  font-weight: 700 !important;
267
+ color: var(--s2f-accent-text) !important;
268
  }
269
 
270
  /* === Buttons === */
 
285
  .stButton > button:not([kind="primary"]) {
286
  border-radius: 10px !important;
287
  font-weight: 500 !important;
288
+ border: 1px solid var(--s2f-border-strong) !important;
289
  transition: all 0.2s ease !important;
290
  }
291
  .stButton > button:not([kind="primary"]):hover {
 
305
 
306
  /* === Action buttons row (measure + downloads) === */
307
  div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([data-testid="stButton"]) {
308
+ background: var(--s2f-surface-2);
309
+ border: 1px solid var(--s2f-border);
310
  border-radius: 14px;
311
  padding: 0.65rem 0.6rem !important;
312
  margin-top: 0.5rem;
 
337
  transform: translateY(-1px) !important;
338
  }
339
  div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([data-testid="stButton"]) [data-testid="stDownloadButton"] button {
340
+ background: var(--s2f-surface) !important;
341
+ border: 1px solid var(--s2f-border) !important;
342
+ color: var(--s2f-text-secondary) !important;
343
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
344
  }
345
  div[data-testid="stHorizontalBlock"]:has([data-testid="stDownloadButton"]):has([data-testid="stButton"]) [data-testid="stDownloadButton"] button:hover {
346
  background: rgba(var(--s2f-primary-rgb), 0.06) !important;
347
  border-color: var(--s2f-primary) !important;
348
+ color: var(--s2f-accent-text) !important;
349
  box-shadow: 0 2px 6px rgba(var(--s2f-primary-rgb), 0.12) !important;
350
  transform: translateY(-1px) !important;
351
  }
352
 
353
  /* === Expanders === */
354
  .stExpander {
355
+ border: 1px solid var(--s2f-border) !important;
356
  border-radius: 12px !important;
357
  overflow: hidden;
358
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
 
360
 
361
  /* === File uploader === */
362
  [data-testid="stFileUploader"] section {
363
+ border: 2px dashed var(--s2f-border-strong) !important;
364
  border-radius: 12px !important;
365
  transition: border-color 0.2s ease;
366
  }
 
375
  gap: 8px;
376
  font-size: 0.92rem;
377
  font-weight: 600;
378
+ color: var(--s2f-text-secondary);
379
  padding: 0.4rem 0;
380
  }
381
  .result-badge {
 
386
  letter-spacing: 0.06em;
387
  }
388
  .result-badge.input {
389
+ background: var(--s2f-badge-bg);
390
+ color: var(--s2f-text-faint);
391
  }
392
  .result-badge.output {
393
  background: rgba(var(--s2f-primary-rgb), 0.15);
394
+ color: var(--s2f-accent-text);
395
  }
396
 
397
  /* === Run prediction info bar === */
 
401
  gap: 10px;
402
  height: 42px;
403
  font-size: 0.85rem;
404
+ color: var(--s2f-text-muted);
405
  }
406
  .run-info-tag {
407
  background: rgba(var(--s2f-primary-rgb), 0.1);
408
+ color: var(--s2f-accent-text);
409
  font-weight: 600;
410
  font-size: 0.78rem;
411
  padding: 3px 10px;
412
  border-radius: 6px;
413
  }
414
  .run-info code {
415
+ background: var(--s2f-code-bg);
416
  padding: 2px 8px;
417
  border-radius: 4px;
418
  font-size: 0.8rem;
419
+ color: var(--s2f-text-faint);
420
  }
421
 
422
  /* === Messages === */
423
  .stSuccess {
424
+ background: linear-gradient(135deg, var(--s2f-success-start) 0%, var(--s2f-success-end) 100%) !important;
425
  border-left: 4px solid #10b981 !important;
426
  border-radius: 8px !important;
427
+ color: var(--s2f-success-text) !important;
428
  }
429
  .stWarning { border-radius: 8px !important; }
430
  .stInfo { border-radius: 8px !important; }
 
433
  [data-testid="stSelectbox"] > div > div,
434
  [data-testid="stSelectbox"] input,
435
  [data-testid="stMultiSelect"] > div > div {
436
+ color: var(--s2f-text) !important;
437
+ background-color: var(--s2f-surface) !important;
438
  }
439
  /* Multiselect input: transparent so it doesn't show as a white block before the tags */
440
  [data-testid="stMultiSelect"] input {
441
  background-color: transparent !important;
442
+ color: var(--s2f-text) !important;
443
  min-width: 2ch !important;
444
  }
445
  [data-testid="stSelectbox"] > div > div,
446
  [data-testid="stMultiSelect"] > div > div {
447
  border-radius: 8px !important;
448
+ border: 1px solid var(--s2f-border-strong) !important;
449
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
450
  }
451
  section[data-testid="stSidebar"] [data-testid="stSelectbox"] > div > div:focus-within,
 
459
  }
460
  /* Toggle: on state uses --s2f-primary */
461
  [data-testid="stToggle"] [data-baseweb="toggleTrack"] {
462
+ background-color: var(--s2f-border-strong) !important;
463
  }
464
  [data-testid="stToggle"] [data-baseweb="toggleTrack"][aria-checked="true"] {
465
  background-color: var(--s2f-primary) !important;
 
468
  background-color: var(--s2f-primary) !important;
469
  }
470
  [data-testid="stToggle"] [data-baseweb="toggleTrack"][data-state="unchecked"] {
471
+ background-color: var(--s2f-border-strong) !important;
472
  }
473
  /* Newer Streamlit may render a switch button instead of Base Web track */
474
  [data-testid="stToggle"] button[role="switch"][aria-checked="true"] {
475
  background-color: var(--s2f-primary) !important;
476
  }
477
  [data-testid="stToggle"] button[role="switch"][aria-checked="false"] {
478
+ background-color: var(--s2f-border-strong) !important;
479
  }
480
+ /* Dropdowns can render outside .stApp, so resolve colors here instead of inherited variables. */
481
  [role="listbox"] [role="option"],
482
  [data-baseweb="menu"] li,
483
  ul[role="listbox"] li {
484
+ color: light-dark(#1e293b, #e2e8f0) !important;
485
+ background-color: light-dark(#ffffff, #111827) !important;
486
  }
487
  /* Sidebar / form labels (colormap row, section titles) */
488
  .s2f-form-label {
489
  font-size: 0.95rem;
490
  font-weight: 500;
491
+ color: var(--s2f-text-secondary);
492
  line-height: 1.2;
493
  margin: 0;
494
  }
 
523
  padding: 0 1px;
524
  font-size: 0.65rem;
525
  font-weight: 600;
526
+ color: var(--s2f-text-muted);
527
  letter-spacing: 0.03em;
528
  }
529
  .colorbar-ticks .cb-tick {
 
539
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
540
  }
541
  /* === Divider === */
542
+ hr { border-color: var(--s2f-border-strong) !important; opacity: 0.7; }
543
 
544
  /* === Plotly chart === */
545
  .stPlotlyChart { border-radius: 12px; overflow: hidden; }
 
552
  right: 0;
553
  z-index: 999;
554
  padding: 0.5rem 1rem 0.55rem;
555
+ background: var(--s2f-footer-bg);
556
+ border-top: 1px solid var(--s2f-border);
557
  font-size: 0.7rem;
558
+ color: var(--s2f-text-muted);
559
  text-align: center;
560
  line-height: 1.45;
561
  }
 
592
  /* Measure tool: value panel (replaces inline styles in measure_tool.py) */
593
  .s2f-measure-vals-heading {
594
  font-weight: 400;
595
+ color: var(--s2f-text-secondary);
596
  font-size: 0.95rem;
597
  margin: 0 20px 4px 4px;
598
  }
599
  .s2f-measure-vals-panel {
600
  width: 100%;
601
  box-sizing: border-box;
602
+ border: 1px solid var(--s2f-border);
603
  border-radius: 10px;
604
  padding: 10px 12px;
605
  margin: 0 10px 20px 10px;
606
+ background: linear-gradient(145deg, var(--s2f-surface-2) 0%, var(--s2f-surface-3) 100%);
607
+ box-shadow: 0 1px 3px var(--s2f-shadow);
608
+ }
609
+ .s2f-region-table {
610
+ border-collapse: collapse;
611
+ width: 100%;
612
+ color: var(--s2f-text);
613
+ }
614
+ .s2f-region-table th,
615
+ .s2f-region-table td {
616
+ border: 1px solid var(--s2f-border);
617
+ padding: 8px;
618
+ text-align: left;
619
+ }
620
+ .s2f-region-table th {
621
+ background: var(--s2f-surface-2);
622
  }
623
  .s2f-measure-vals-grid {
624
  display: flex;
S2FApp/ui/heatmaps.py CHANGED
@@ -44,22 +44,32 @@ def _draw_region_overlay(annotated, mask, color, fill_alpha=0.3, stroke_width=2)
44
  cv2.drawContours(annotated, contours, -1, color, stroke_width)
45
 
46
 
47
- def render_horizontal_colorbar(colormap_name, clip_min=0, clip_max=1, is_rescale=False, caption=None):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  """
49
- Render a compact horizontal colorbar for batch mode, anchored above the table.
50
-
51
- When ``is_rescale`` is True (Force scale **Range** with a strict sub-interval), tick labels show
52
- model force values in ``[clip_min, clip_max]``. The gradient still spans the full colormap because
53
- the heatmap has already been **rescaled** so the lowest (highest) value in your range maps to
54
- the colormap minimum (maximum)—same convention as the main Plotly view.
55
  """
56
- ticks = [0, 0.25, 0.5, 0.75, 1]
57
- if is_rescale:
58
- rng = clip_max - clip_min
59
- labels = [f"{clip_min + t * rng:.2f}" for t in ticks]
60
- else:
61
- labels = [f"{t:.2f}" for t in ticks]
62
-
63
  data_url = _colormap_gradient_base64(colormap_name)
64
  labels_html = "".join(f'<span class="cb-tick">{l}</span>' for l in labels)
65
  html = f"""
@@ -69,8 +79,7 @@ def render_horizontal_colorbar(colormap_name, clip_min=0, clip_max=1, is_rescale
69
  </div>
70
  """
71
  st.markdown(html, unsafe_allow_html=True)
72
- if caption:
73
- st.caption(caption)
74
 
75
 
76
  def make_annotated_heatmap(heatmap_rgb, mask, fill_alpha=0.3, stroke_color=(0, 188, 212), stroke_width=2):
 
44
  cv2.drawContours(annotated, contours, -1, color, stroke_width)
45
 
46
 
47
+ def colorbar_ticks_pa(clip_min=0.0, clip_max=1.0, stress_max_pa=500.0, n=5):
48
+ """Tick positions (0-1 along the colormap) and labels in Pa at round values for the displayed window."""
49
+ lo, hi = float(clip_min), float(clip_max)
50
+ if not hi > lo:
51
+ lo, hi = 0.0, 1.0
52
+ lo_pa, hi_pa = lo * stress_max_pa, hi * stress_max_pa
53
+ span = hi_pa - lo_pa
54
+ raw = span / max(n - 1, 1)
55
+ k = 10 ** np.floor(np.log10(raw))
56
+ step = min((m * k for m in (1, 2, 2.5, 5, 10)), key=lambda st_: abs(st_ - raw))
57
+ first = np.ceil(lo_pa / step - 1e-9) * step
58
+ vals = np.arange(first, hi_pa + 1e-9, step) + 0.0 # +0.0 turns -0 into 0
59
+ pos = [float((v - lo_pa) / span) for v in vals]
60
+ labels = [f"{v:g}" for v in vals]
61
+ return pos, labels
62
+
63
+
64
+ def render_horizontal_colorbar(colormap_name, clip_min=0, clip_max=1, is_rescale=False, caption=None,
65
+ stress_max_pa=500.0):
66
  """
67
+ Compact horizontal colorbar (batch mode) labelled in Pa. With a display window (Range mode) the gradient
68
+ spans the window [clip_min, clip_max]; values above it are shown in the top colour.
 
 
 
 
69
  """
70
+ ticks, labels = colorbar_ticks_pa(clip_min, clip_max, stress_max_pa)
71
+ if not is_rescale:
72
+ ticks, labels = colorbar_ticks_pa(0.0, 1.0, stress_max_pa)
 
 
 
 
73
  data_url = _colormap_gradient_base64(colormap_name)
74
  labels_html = "".join(f'<span class="cb-tick">{l}</span>' for l in labels)
75
  html = f"""
 
79
  </div>
80
  """
81
  st.markdown(html, unsafe_allow_html=True)
82
+ st.caption(caption or "Traction stress (Pa)")
 
83
 
84
 
85
  def make_annotated_heatmap(heatmap_rgb, mask, fill_alpha=0.3, stroke_color=(0, 188, 212), stroke_width=2):
S2FApp/ui/measure_tool.py CHANGED
@@ -12,6 +12,7 @@ from PIL import Image
12
  from config.constants import CANVAS_SIZE, DRAW_TOOLS, TOOL_LABELS
13
  from utils.report import heatmap_to_rgb_with_contour, create_measure_pdf_report
14
  from ui.heatmaps import make_annotated_heatmap_multi_regions
 
15
 
16
  try:
17
  from streamlit_drawable_canvas import st_canvas
@@ -94,66 +95,32 @@ def parse_canvas_shapes_to_masks(json_data, canvas_h, canvas_w, heatmap_h, heatm
94
  return masks
95
 
96
 
97
- def build_original_vals(raw_heatmap, pixel_sum, force):
98
- """Build original_vals dict for measure tool (full map)."""
99
- return {
100
- "pixel_sum": pixel_sum,
101
- "force": force,
102
- "max": float(np.max(raw_heatmap)),
103
- "mean": float(np.mean(raw_heatmap)),
104
- }
105
 
106
 
107
- def _compute_cell_metrics(raw_heatmap, cell_mask, pixel_sum, force):
108
- """Compute metrics over estimated cell area only."""
109
- area_px = int(np.sum(cell_mask))
110
- if area_px == 0:
111
- return None, None, None
112
- region_values = raw_heatmap * cell_mask
113
- cell_pixel_sum = float(np.sum(region_values))
114
- cell_force = cell_pixel_sum * (force / pixel_sum) if pixel_sum > 0 else cell_pixel_sum
115
- cell_mean = cell_pixel_sum / area_px
116
- return cell_pixel_sum, cell_force, cell_mean
117
 
118
 
119
- def build_cell_vals(raw_heatmap, cell_mask, pixel_sum, force):
120
- """Build cell_vals dict for measure tool (estimated cell area). Returns None if invalid."""
121
- cell_pixel_sum, cell_force, cell_mean = _compute_cell_metrics(raw_heatmap, cell_mask, pixel_sum, force)
122
- if cell_pixel_sum is None:
123
  return None
124
- region_values = raw_heatmap * cell_mask
125
- region_nonzero = region_values[cell_mask > 0]
126
- cell_max = float(np.max(region_nonzero)) if len(region_nonzero) > 0 else 0
127
- return {
128
- "pixel_sum": cell_pixel_sum,
129
- "force": cell_force,
130
- "max": cell_max,
131
- "mean": cell_mean,
132
- }
133
 
134
 
135
  def compute_region_metrics(raw_heatmap, mask, original_vals=None):
136
- """Compute region metrics from mask."""
137
- area_px = int(np.sum(mask))
138
- region_values = raw_heatmap * mask
139
- region_nonzero = region_values[mask > 0]
140
- force_sum = float(np.sum(region_values))
141
- density = force_sum / area_px if area_px > 0 else 0
142
- region_max = float(np.max(region_nonzero)) if len(region_nonzero) > 0 else 0
143
- region_mean = float(np.mean(region_nonzero)) if len(region_nonzero) > 0 else 0
144
- region_force_scaled = (
145
- force_sum * (original_vals["force"] / original_vals["pixel_sum"])
146
- if original_vals and original_vals.get("pixel_sum", 0) > 0
147
- else force_sum
148
- )
149
- return {
150
- "area_px": area_px,
151
- "force_sum": force_sum,
152
- "density": density,
153
- "max": region_max,
154
- "mean": region_mean,
155
- "force_scaled": region_force_scaled,
156
- }
157
 
158
 
159
  def _draw_contour_on_image(img_rgb, mask, stroke_color=(255, 0, 0), stroke_width=3):
@@ -171,48 +138,32 @@ def render_region_metrics_and_downloads(metrics_list, masks, heatmap_rgb, input_
171
  first_region_label=None, bf_img=None, cell_mask=None, colormap_name="Jet"):
172
  """
173
  Render per-shape metrics table and download buttons.
174
- first_region_label: custom label for first row (e.g. 'Auto boundary').
175
  masks: list of region masks (user-drawn only; used for labeled heatmap with R1, R2...).
176
  """
177
  base_name = os.path.splitext(input_filename or "image")[0]
178
  st.markdown("**Regions (each selection = one row)**")
179
- if has_original_vals:
180
- headers = ["Region", "Area", "F.sum", "Force", "Max", "Mean"]
181
- csv_rows = [["image", "region"] + headers[1:]]
182
- else:
183
- headers = ["Region", "Area (px²)", "Force sum", "Mean"]
184
- csv_rows = [["image", "region", "Area", "Force sum", "Mean"]]
185
  table_rows = [headers]
186
  for i, metrics in enumerate(metrics_list, 1):
187
  region_label = first_region_label if (i == 1 and first_region_label) else f"Region {i - (1 if first_region_label else 0)}"
188
- if has_original_vals:
189
- row = [region_label, str(metrics["area_px"]), f"{metrics['force_sum']:.3f}", f"{metrics['force_scaled']:.1f}",
190
- f"{metrics['max']:.3f}", f"{metrics['mean']:.4f}"]
191
- csv_rows.append([base_name, region_label, metrics["area_px"], f"{metrics['force_sum']:.3f}",
192
- f"{metrics['force_scaled']:.1f}", f"{metrics['max']:.3f}", f"{metrics['mean']:.4f}"])
193
- else:
194
- row = [region_label, str(metrics["area_px"]), f"{metrics['force_sum']:.4f}", f"{metrics['mean']:.6f}"]
195
- csv_rows.append([base_name, region_label, metrics["area_px"], f"{metrics['force_sum']:.4f}",
196
- f"{metrics['mean']:.6f}"])
197
  table_rows.append(row)
198
  # Render as HTML table to avoid Streamlit's default row/column indices
199
  header = table_rows[0]
200
  body = table_rows[1:]
201
- th_cells = "".join(
202
- f'<th style="border: 1px solid #ddd; padding: 8px; text-align: left;">{html.escape(str(h))}</th>'
203
- for h in header
204
- )
205
  rows_html = [
206
  "<tr>"
207
- + "".join(
208
- f'<td style="border: 1px solid #ddd; padding: 8px;">{html.escape(str(c))}</td>'
209
- for c in row
210
- )
211
  + "</tr>"
212
  for row in body
213
  ]
214
  table_html = (
215
- f'<table style="border-collapse: collapse; width: 100%;">'
216
  f"<thead><tr>{th_cells}</tr></thead>"
217
  f"<tbody>{''.join(rows_html)}</tbody></table>"
218
  )
@@ -263,7 +214,7 @@ def render_region_canvas(display_heatmap, raw_heatmap=None, bf_img=None, origina
263
  left_col, right_col = st.columns(2, gap=None)
264
  with left_col:
265
  draw_mode = st.selectbox("Tool", DRAW_TOOLS, format_func=lambda x: TOOL_LABELS[x], key=f"draw_mode_region_{key_suffix}")
266
- st.caption("Left-click add, right-click close. \nForce map (draw region)")
267
  canvas_result = st_canvas(
268
  fill_color="rgba(0, 188, 212, 0.25)", stroke_width=2, stroke_color="#00bcd4",
269
  background_image=pil_bg, drawing_mode=draw_mode, update_streamlit=True,
@@ -273,14 +224,14 @@ def render_region_canvas(display_heatmap, raw_heatmap=None, bf_img=None, origina
273
  with right_col:
274
  vals = cell_vals if cell_vals else original_vals
275
  if vals:
276
- label = "Cell area" if cell_vals else "Full map"
277
  st.markdown(
278
  f'<p class="s2f-measure-vals-heading">{html.escape(label)}</p>'
279
  f'<div class="s2f-measure-vals-panel"><div class="s2f-measure-vals-grid">'
280
- f"<span><strong>Sum:</strong> {vals['pixel_sum']:.1f}</span>"
281
- f"<span><strong>Force:</strong> {vals['force']:.1f}</span>"
282
- f"<span><strong>Max:</strong> {vals['max']:.3f}</span>"
283
- f"<span><strong>Mean:</strong> {vals['mean']:.3f}</span>"
284
  f"</div></div>",
285
  unsafe_allow_html=True,
286
  )
@@ -311,6 +262,6 @@ def render_region_canvas(display_heatmap, raw_heatmap=None, bf_img=None, origina
311
  metrics_list = [cell_metrics] + metrics_list
312
  render_region_metrics_and_downloads(
313
  metrics_list, masks, heatmap_rgb, input_filename, key_suffix, original_vals is not None,
314
- first_region_label="Auto boundary" if (cell_mask is not None and np.any(cell_mask > 0)) else None,
315
  bf_img=bf_img, cell_mask=cell_mask, colormap_name=colormap_name,
316
  )
 
12
  from config.constants import CANVAS_SIZE, DRAW_TOOLS, TOOL_LABELS
13
  from utils.report import heatmap_to_rgb_with_contour, create_measure_pdf_report
14
  from ui.heatmaps import make_annotated_heatmap_multi_regions
15
+ from utils.units import fmt, make_scale, region_metrics
16
 
17
  try:
18
  from streamlit_drawable_canvas import st_canvas
 
95
  return masks
96
 
97
 
98
+ def build_original_vals(raw_heatmap, pixel_sum, force, scale=None):
99
+ """Whole-map values for the measure tool (physical units when `scale` is given; see utils/units.py)."""
100
+ scale = scale or make_scale("single_cell")
101
+ m = region_metrics(raw_heatmap, None, scale)
102
+ return {"pixel_sum": pixel_sum, "force": force, "scale": scale, **m}
 
 
 
103
 
104
 
105
+ def _compute_cell_metrics(raw_heatmap, cell_mask, pixel_sum, force, scale=None):
106
+ """Metrics over the estimated cell area: dict from utils.units.region_metrics, or None if the mask is empty."""
107
+ if cell_mask is None or int(np.sum(cell_mask)) == 0:
108
+ return None
109
+ return region_metrics(raw_heatmap, cell_mask, scale or make_scale("single_cell"))
 
 
 
 
 
110
 
111
 
112
+ def build_cell_vals(raw_heatmap, cell_mask, pixel_sum, force, scale=None):
113
+ """Values over the estimated cell area for the measure tool. Returns None if invalid."""
114
+ m = _compute_cell_metrics(raw_heatmap, cell_mask, pixel_sum, force, scale)
115
+ if m is None:
116
  return None
117
+ return {"scale": scale, **m}
 
 
 
 
 
 
 
 
118
 
119
 
120
  def compute_region_metrics(raw_heatmap, mask, original_vals=None):
121
+ """Region metrics in physical units (area µm², total force nN, mean/max traction stress Pa)."""
122
+ scale = (original_vals or {}).get("scale") or make_scale("single_cell")
123
+ return region_metrics(raw_heatmap, mask, scale)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
 
126
  def _draw_contour_on_image(img_rgb, mask, stroke_color=(255, 0, 0), stroke_width=3):
 
138
  first_region_label=None, bf_img=None, cell_mask=None, colormap_name="Jet"):
139
  """
140
  Render per-shape metrics table and download buttons.
141
+ first_region_label: custom label for first row (e.g. 'Force region').
142
  masks: list of region masks (user-drawn only; used for labeled heatmap with R1, R2...).
143
  """
144
  base_name = os.path.splitext(input_filename or "image")[0]
145
  st.markdown("**Regions (each selection = one row)**")
146
+ headers = ["Region", "Area (µm²)", "Total force (nN)", "Mean stress (Pa)", "Max stress (Pa)"]
147
+ csv_rows = [["image", "region", "area_um2", "total_force_nN", "mean_stress_Pa", "max_stress_Pa", "n_pixels"]]
 
 
 
 
148
  table_rows = [headers]
149
  for i, metrics in enumerate(metrics_list, 1):
150
  region_label = first_region_label if (i == 1 and first_region_label) else f"Region {i - (1 if first_region_label else 0)}"
151
+ row = [region_label, fmt(metrics["area_um2"], nd=0), fmt(metrics["total_force_nN"], nd=2),
152
+ fmt(metrics["mean_pa"], nd=1), fmt(metrics["max_pa"], nd=1)]
153
+ csv_rows.append([base_name, region_label] + row[1:] + [metrics["n_px"]])
 
 
 
 
 
 
154
  table_rows.append(row)
155
  # Render as HTML table to avoid Streamlit's default row/column indices
156
  header = table_rows[0]
157
  body = table_rows[1:]
158
+ th_cells = "".join(f"<th>{html.escape(str(h))}</th>" for h in header)
 
 
 
159
  rows_html = [
160
  "<tr>"
161
+ + "".join(f"<td>{html.escape(str(c))}</td>" for c in row)
 
 
 
162
  + "</tr>"
163
  for row in body
164
  ]
165
  table_html = (
166
+ '<table class="s2f-region-table">'
167
  f"<thead><tr>{th_cells}</tr></thead>"
168
  f"<tbody>{''.join(rows_html)}</tbody></table>"
169
  )
 
214
  left_col, right_col = st.columns(2, gap=None)
215
  with left_col:
216
  draw_mode = st.selectbox("Tool", DRAW_TOOLS, format_func=lambda x: TOOL_LABELS[x], key=f"draw_mode_region_{key_suffix}")
217
+ st.caption("Left-click add, right-click close. \nTraction stress map (draw region)")
218
  canvas_result = st_canvas(
219
  fill_color="rgba(0, 188, 212, 0.25)", stroke_width=2, stroke_color="#00bcd4",
220
  background_image=pil_bg, drawing_mode=draw_mode, update_streamlit=True,
 
224
  with right_col:
225
  vals = cell_vals if cell_vals else original_vals
226
  if vals:
227
+ label = "Force region" if cell_vals else "Full map"
228
  st.markdown(
229
  f'<p class="s2f-measure-vals-heading">{html.escape(label)}</p>'
230
  f'<div class="s2f-measure-vals-panel"><div class="s2f-measure-vals-grid">'
231
+ f"<span><strong>Mean:</strong> {fmt(vals.get('mean_pa'), 'Pa')}</span>"
232
+ f"<span><strong>Max:</strong> {fmt(vals.get('max_pa'), 'Pa')}</span>"
233
+ f"<span><strong>Area:</strong> {fmt(vals.get('area_um2'), 'µm²', 0)}</span>"
234
+ f"<span><strong>Force:</strong> {fmt(vals.get('total_force_nN'), 'nN', 2)}</span>"
235
  f"</div></div>",
236
  unsafe_allow_html=True,
237
  )
 
262
  metrics_list = [cell_metrics] + metrics_list
263
  render_region_metrics_and_downloads(
264
  metrics_list, masks, heatmap_rgb, input_filename, key_suffix, original_vals is not None,
265
+ first_region_label="Force region" if (cell_mask is not None and np.any(cell_mask > 0)) else None,
266
  bf_img=bf_img, cell_mask=cell_mask, colormap_name=colormap_name,
267
  )
S2FApp/ui/result_display.py CHANGED
@@ -1,4 +1,4 @@
1
- """Result display: single and batch prediction views."""
2
  import csv
3
  import io
4
  import os
@@ -11,21 +11,29 @@ import plotly.graph_objects as go
11
  from plotly.subplots import make_subplots
12
 
13
  from utils.display import apply_display_scale, cv_colormap_to_plotly_colorscale, is_display_range_remapped
14
- from utils.report import heatmap_to_rgb_with_contour, heatmap_to_png_bytes, create_pdf_report
 
15
  from utils.segmentation import estimate_cell_mask
16
- from ui.heatmaps import render_horizontal_colorbar, add_cell_contour_to_fig
 
17
  from ui.measure_tool import (
18
  build_original_vals,
19
  build_cell_vals,
20
  render_region_canvas,
21
- _compute_cell_metrics,
22
  HAS_DRAWABLE_CANVAS,
23
  )
24
 
25
  # Histogram bar color (matches static/s2f_styles.css accent)
26
  _HISTOGRAM_ACCENT = "#0d9488"
27
- _RESULT_FIG_HEIGHT = 320
28
  _HISTOGRAM_HEIGHT = 180
 
 
 
 
 
 
 
29
 
30
 
31
  def _result_banner(badge: str, badge_class: str, title: str) -> str:
@@ -35,284 +43,266 @@ def _result_banner(badge: str, badge_class: str, title: str) -> str:
35
  )
36
 
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  def render_batch_results(batch_results, colormap_name="Jet", display_mode="Default",
39
- clip_min=0, clip_max=1,
40
- auto_cell_boundary=False, clamp_only=False):
41
  """
42
- Render batch prediction results: summary table, bright-field row, heatmap row, and bulk download.
43
- batch_results: list of dicts with img, heatmap, force, pixel_sum, key_img, cell_mask.
44
- cell_mask is computed on-the-fly when auto_cell_boundary is True and not stored.
45
  """
46
  if not batch_results:
47
  return
48
 
49
- # Resolve cell_mask and precompute display_heatmap for each result
50
  for r in batch_results:
51
  if auto_cell_boundary and (r.get("cell_mask") is None or not np.any(r.get("cell_mask", 0) > 0)):
52
  r["_cell_mask"] = estimate_cell_mask(r["heatmap"])
53
  else:
54
  r["_cell_mask"] = r.get("cell_mask") if auto_cell_boundary else None
55
- r["_display_heatmap"] = apply_display_scale(
56
- r["heatmap"], display_mode,
57
- clip_min=clip_min, clip_max=clip_max, clamp_only=clamp_only,
58
- )
59
- # Build table rows - consistent column names for both modes
60
- headers = ["Image", "Force", "Sum", "Max", "Mean"]
61
  rows = []
62
- csv_rows = [["image"] + headers[1:]]
 
 
63
  for r in batch_results:
64
- heatmap = r["heatmap"]
65
- cell_mask = r.get("_cell_mask")
66
- key = r["key_img"] or "image"
67
- if auto_cell_boundary and cell_mask is not None and np.any(cell_mask > 0):
68
- vals = heatmap[cell_mask > 0]
69
- cell_pixel_sum = float(np.sum(vals))
70
- cell_force = cell_pixel_sum * (r["force"] / r["pixel_sum"]) if r["pixel_sum"] > 0 else cell_pixel_sum
71
- cell_mean = cell_pixel_sum / np.sum(cell_mask) if np.sum(cell_mask) > 0 else 0
72
- row = [key, f"{cell_force:.2f}", f"{cell_pixel_sum:.2f}",
73
- f"{np.max(heatmap):.4f}", f"{cell_mean:.4f}"]
74
- else:
75
- row = [key, f"{r['force']:.2f}", f"{r['pixel_sum']:.2f}",
76
- f"{np.max(heatmap):.4f}", f"{np.mean(heatmap):.4f}"]
77
- rows.append(row)
78
- csv_rows.append([os.path.splitext(key)[0]] + row[1:])
79
  st.markdown(_result_banner("INPUT", "input", "Bright-field images"), unsafe_allow_html=True)
80
  n_cols = min(5, len(batch_results))
81
  bf_cols = st.columns(n_cols)
82
  for i, r in enumerate(batch_results):
83
  img = r["img"]
84
- if img.ndim == 2:
85
- img_rgb = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB)
86
- else:
87
- img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
88
  with bf_cols[i % n_cols]:
89
  st.image(img_rgb, caption=r["key_img"], use_container_width=True)
90
  is_rescale_b = is_display_range_remapped(display_mode, clip_min, clip_max)
91
- st.markdown(_result_banner("OUTPUT", "output", "Predicted force maps"), unsafe_allow_html=True)
92
  hm_cols = st.columns(n_cols)
93
  for i, r in enumerate(batch_results):
94
- hm_rgb = heatmap_to_rgb_with_contour(
95
- r["_display_heatmap"], colormap_name,
96
- r.get("_cell_mask") if auto_cell_boundary else None,
97
- )
98
  with hm_cols[i % n_cols]:
99
  st.image(hm_rgb, caption=r["key_img"], use_container_width=True)
100
- render_horizontal_colorbar(colormap_name, clip_min, clip_max, is_rescale_b)
101
- # Table
102
- st.dataframe(
103
- {h: [r[i] for r in rows] for i, h in enumerate(headers)},
104
- use_container_width=True,
105
- hide_index=True,
106
- )
107
- # Histograms in accordion (one per row for visibility)
108
- with st.expander("Force distribution (histograms)", expanded=False):
109
  for i, r in enumerate(batch_results):
110
- heatmap = r["heatmap"]
111
  cell_mask = r.get("_cell_mask")
112
- vals = heatmap[cell_mask > 0] if (cell_mask is not None and np.any(cell_mask > 0) and auto_cell_boundary) else heatmap.flatten()
 
113
  vals = vals[vals > 0] if np.any(vals > 0) else vals
114
  st.markdown(f"**{r['key_img']}**")
115
  if len(vals) > 0:
116
  fig = go.Figure(data=[go.Histogram(x=vals, nbinsx=50, marker_color=_HISTOGRAM_ACCENT)])
117
- fig.update_layout(
118
- height=_HISTOGRAM_HEIGHT, margin=dict(l=40, r=20, t=10, b=40),
119
- xaxis_title="Force value", yaxis_title="Count",
120
- showlegend=False,
121
- )
122
  st.plotly_chart(fig, use_container_width=True, config={"displayModeBar": False})
123
  else:
124
  st.caption("No data")
125
  if i < len(batch_results) - 1:
126
  st.divider()
127
- # Bulk downloads: CSV and heatmaps (zip)
128
  buf_csv = io.StringIO()
129
  csv.writer(buf_csv).writerows(csv_rows)
 
130
  zip_buf = io.BytesIO()
131
  with zipfile.ZipFile(zip_buf, "w", zipfile.ZIP_DEFLATED) as zf:
132
  for r in batch_results:
133
- hm_bytes = heatmap_to_png_bytes(
134
- r["_display_heatmap"], colormap_name,
135
- r.get("_cell_mask") if auto_cell_boundary else None,
136
- )
137
  base = os.path.splitext(r["key_img"] or "image")[0]
138
- zf.writestr(f"{base}_heatmap.png", hm_bytes.getvalue())
 
 
 
 
139
  zip_buf.seek(0)
140
- dl_col1, dl_col2 = st.columns(2)
 
 
 
 
 
 
 
141
  with dl_col1:
142
- st.download_button(
143
- "Download all as CSV",
144
- data=buf_csv.getvalue(),
145
- file_name="s2f_batch_results.csv",
146
- mime="text/csv",
147
- key="download_batch_csv",
148
- icon=":material/download:",
149
- )
150
  with dl_col2:
151
- st.download_button(
152
- "Download all heatmaps",
153
- data=zip_buf.getvalue(),
154
- file_name="s2f_batch_heatmaps.zip",
155
- mime="application/zip",
156
- key="download_batch_heatmaps",
157
- icon=":material/image:",
158
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
 
160
 
161
  def render_result_display(img, raw_heatmap, display_heatmap, pixel_sum, force, key_img, download_key_suffix="",
162
- colormap_name="Jet", display_mode="Default", measure_region_dialog=None, auto_cell_boundary=True,
163
- cell_mask=None, clip_min=0.0, clip_max=1.0, clamp_only=False):
164
  """
165
- Render prediction result: plot, metrics, expander, and download/measure buttons.
166
- measure_region_dialog: callable to open measure dialog (when ST_DIALOG available).
167
- auto_cell_boundary: when True, use estimated cell area for metrics; when False, use entire map.
168
- cell_mask: optional precomputed cell mask; if None and auto_cell_boundary, will be computed.
169
  """
 
 
170
  if cell_mask is None and auto_cell_boundary:
171
  cell_mask = estimate_cell_mask(raw_heatmap)
172
  elif not auto_cell_boundary:
173
  cell_mask = None
174
- cell_pixel_sum, cell_force, cell_mean = _compute_cell_metrics(raw_heatmap, cell_mask, pixel_sum, force) if cell_mask is not None else (None, None, None)
175
- use_cell_metrics = auto_cell_boundary and cell_pixel_sum is not None and cell_force is not None and cell_mean is not None
176
-
177
  base_name = os.path.splitext(key_img or "image")[0]
178
- if use_cell_metrics:
179
- main_csv_rows = [
180
- ["image", "Cell sum", "Cell force (scaled)", "Heatmap max", "Heatmap mean"],
181
- [base_name, f"{cell_pixel_sum:.2f}", f"{cell_force:.2f}",
182
- f"{np.max(raw_heatmap):.4f}", f"{cell_mean:.4f}"],
183
- ]
184
- else:
185
- main_csv_rows = [
186
- ["image", "Sum of all pixels", "Force (scaled)", "Heatmap max", "Heatmap mean"],
187
- [base_name, f"{pixel_sum:.2f}", f"{force:.2f}",
188
- f"{np.max(raw_heatmap):.4f}", f"{np.mean(raw_heatmap):.4f}"],
189
- ]
190
- buf_main_csv = io.StringIO()
191
- csv.writer(buf_main_csv).writerows(main_csv_rows)
192
-
193
- buf_hm = heatmap_to_png_bytes(display_heatmap, colormap_name, cell_mask=cell_mask)
194
-
195
  is_rescale = is_display_range_remapped(display_mode, clip_min, clip_max)
 
196
 
197
  tit1, tit2 = st.columns(2)
198
  with tit1:
199
  st.markdown(_result_banner("INPUT", "input", "Bright-field image"), unsafe_allow_html=True)
200
  with tit2:
201
- st.markdown(_result_banner("OUTPUT", "output", "Predicted force map"), unsafe_allow_html=True)
202
  fig_pl = make_subplots(rows=1, cols=2)
203
- fig_pl.add_trace(go.Heatmap(z=img, colorscale="gray", showscale=False), row=1, col=1)
204
- plotly_colorscale = cv_colormap_to_plotly_colorscale(colormap_name)
205
- colorbar_cfg = dict(len=0.4, thickness=12, tickmode="array")
206
- tick_positions = [0, 0.25, 0.5, 0.75, 1]
207
- if is_rescale:
208
- rng = clip_max - clip_min
209
- colorbar_cfg["tickvals"] = tick_positions
210
- colorbar_cfg["ticktext"] = [f"{clip_min + t * rng:.2f}" for t in tick_positions]
211
- else:
212
- colorbar_cfg["tickvals"] = tick_positions
213
- colorbar_cfg["ticktext"] = [f"{t:.2f}" for t in tick_positions]
214
- fig_pl.add_trace(go.Heatmap(z=display_heatmap, colorscale=plotly_colorscale, zmin=0.0, zmax=1.0, showscale=True,
215
- colorbar=colorbar_cfg), row=1, col=2)
216
  add_cell_contour_to_fig(fig_pl, cell_mask, row=1, col=2)
217
- fig_pl.update_layout(
218
- height=_RESULT_FIG_HEIGHT,
219
- margin=dict(l=10, r=10, t=10, b=10),
220
- xaxis=dict(scaleanchor="y", scaleratio=1),
221
- xaxis2=dict(scaleanchor="y2", scaleratio=1),
222
- )
223
  fig_pl.update_xaxes(showticklabels=False, showgrid=False, zeroline=False)
224
  fig_pl.update_yaxes(showticklabels=False, autorange="reversed", showgrid=False, zeroline=False)
225
  st.plotly_chart(fig_pl, use_container_width=True, config={"displayModeBar": True, "responsive": True})
 
 
 
226
 
227
- col1, col2, col3, col4 = st.columns(4)
228
- if use_cell_metrics:
229
- with col1:
230
- st.metric("Cell sum", f"{cell_pixel_sum:.2f}", help="Sum over estimated cell area (background excluded)")
231
- with col2:
232
- st.metric("Cell force (scaled)", f"{cell_force:.2f}", help="Total traction force in physical units")
233
- with col3:
234
- st.metric("Heatmap max", f"{np.max(raw_heatmap):.4f}", help="Peak force intensity in the map")
235
- with col4:
236
- st.metric("Heatmap mean", f"{cell_mean:.4f}", help="Mean force over estimated cell area")
237
- else:
238
- with col1:
239
- st.metric("Sum of all pixels", f"{pixel_sum:.2f}", help="Raw sum of all pixel values in the force map")
240
- with col2:
241
- st.metric("Force (scaled)", f"{force:.2f}", help="Total traction force in physical units (full field of view)")
242
- with col3:
243
- st.metric("Heatmap max", f"{np.max(raw_heatmap):.4f}", help="Peak force intensity in the map")
244
- with col4:
245
- st.metric("Heatmap mean", f"{np.mean(raw_heatmap):.4f}", help="Average force intensity (full FOV)")
246
 
247
- # Statistics panel (mean, std, percentiles, histogram)
248
  with st.expander("Statistics"):
249
- vals = raw_heatmap[cell_mask > 0] if (cell_mask is not None and np.any(cell_mask > 0) and use_cell_metrics) else raw_heatmap.flatten()
 
250
  if len(vals) > 0:
251
- stat_col1, stat_col2, stat_col3 = st.columns(3)
252
- p25, p50, p75, p90 = (
253
- float(np.percentile(vals, 25)), float(np.percentile(vals, 50)),
254
- float(np.percentile(vals, 75)), float(np.percentile(vals, 90)),
255
- )
256
- with stat_col1:
257
- st.metric("Mean", f"{float(np.mean(vals)):.4f}")
258
- st.metric("Std", f"{float(np.std(vals)):.4f}")
259
- with stat_col2:
260
- st.metric("P25", f"{p25:.4f}")
261
- st.metric("P50 (median)", f"{p50:.4f}")
262
- with stat_col3:
263
- st.metric("P75", f"{p75:.4f}")
264
- st.metric("P90", f"{p90:.4f}")
265
- st.markdown("**Histogram**")
266
  hist_fig = go.Figure(data=[go.Histogram(x=vals, nbinsx=50, marker_color=_HISTOGRAM_ACCENT)])
267
- hist_fig.update_layout(
268
- height=_HISTOGRAM_HEIGHT, margin=dict(l=40, r=20, t=20, b=40),
269
- xaxis_title="Force value", yaxis_title="Count",
270
- showlegend=False,
271
- )
272
  st.plotly_chart(hist_fig, use_container_width=True, config={"displayModeBar": False})
273
  else:
274
- st.caption("No nonzero values to compute statistics.")
275
-
276
- with st.expander("How to read the results"):
277
- if use_cell_metrics:
278
- st.markdown("""
279
- **Input (left):** Bright-field microscopy image of a cell or spheroid on a substrate.
280
- This is the raw image you provided—it shows cell shape but not forces.
281
 
282
- **Output (right):** Predicted traction force map.
283
- - **Color** indicates force magnitude: blue = low, red = high
284
- - **Brighter/warmer colors** = stronger forces exerted by the cell on the substrate
285
- - **Red border = estimated cell area** (background excluded from metrics)
286
- - Values are normalized to [0, 1] for visualization
287
 
288
- **Metrics (auto cell boundary on):**
289
- - **Cell sum:** Sum over estimated cell area (background excluded)
290
- - **Cell force (scaled):** Total traction force in physical units
291
- - **Heatmap max:** Peak force intensity in the map
292
- - **Heatmap mean:** Mean force over the estimated cell area
293
- """)
294
- else:
295
- st.markdown("""
296
- **Input (left):** Bright-field microscopy image of a cell or spheroid on a substrate.
297
- This is the raw image you provided—it shows cell shape but not forces.
298
-
299
- **Output (right):** Predicted traction force map.
300
- - **Color** indicates force magnitude: blue = low, red = high
301
- - **Brighter/warmer colors** = stronger forces exerted by the cell on the substrate
302
- - Values are normalized to [0, 1] for visualization
303
 
304
- **Metrics (auto cell boundary off):**
305
- - **Sum of all pixels:** Raw sum over entire map
306
- - **Force (scaled):** Total traction force in physical units (full field of view)
307
- - **Heatmap max/mean:** Peak and average force intensity (full field of view)
308
- """)
 
 
 
309
 
310
- original_vals = build_original_vals(raw_heatmap, pixel_sum, force)
 
 
311
 
312
- pdf_bytes = create_pdf_report(
313
- img, display_heatmap, raw_heatmap, pixel_sum, force, base_name, colormap_name,
314
- cell_mask=cell_mask, cell_pixel_sum=cell_pixel_sum, cell_force=cell_force, cell_mean=cell_mean
315
- )
 
 
316
 
317
  btn_col1, btn_col2, btn_col3, btn_col4 = st.columns(4)
318
  with btn_col1:
@@ -322,48 +312,20 @@ This is the raw image you provided—it shows cell shape but not forces.
322
  st.rerun()
323
  elif HAS_DRAWABLE_CANVAS:
324
  with st.expander("Measure tool"):
325
- expander_cell_vals = build_cell_vals(raw_heatmap, cell_mask, pixel_sum, force) if (auto_cell_boundary and cell_mask is not None) else None
326
- expander_cell_mask = cell_mask if auto_cell_boundary else None
327
- render_region_canvas(
328
- display_heatmap,
329
- raw_heatmap=raw_heatmap,
330
- bf_img=img,
331
- original_vals=original_vals,
332
- cell_vals=expander_cell_vals,
333
- cell_mask=expander_cell_mask,
334
- key_suffix="expander",
335
- input_filename=key_img,
336
- colormap_name=colormap_name,
337
- )
338
  else:
339
  st.caption("Install `streamlit-drawable-canvas-fix` for region measurement: `pip install streamlit-drawable-canvas-fix`")
340
  with btn_col2:
341
- st.download_button(
342
- "Download heatmap",
343
- width="stretch",
344
- data=buf_hm.getvalue(),
345
- file_name="s2f_heatmap.png",
346
- mime="image/png",
347
- key=f"download_heatmap{download_key_suffix}",
348
- icon=":material/download:",
349
- )
350
  with btn_col3:
351
- st.download_button(
352
- "Download values",
353
- width="stretch",
354
- data=buf_main_csv.getvalue(),
355
- file_name=f"{base_name}_main_values.csv",
356
- mime="text/csv",
357
- key=f"download_main_values{download_key_suffix}",
358
- icon=":material/download:",
359
- )
360
  with btn_col4:
361
- st.download_button(
362
- "Download report",
363
- width="stretch",
364
- data=pdf_bytes,
365
- file_name=f"{base_name}_report.pdf",
366
- mime="application/pdf",
367
- key=f"download_pdf{download_key_suffix}",
368
- icon=":material/picture_as_pdf:",
369
- )
 
1
+ """Result display: single and batch prediction views (traction stress in Pa, areas in µm², forces in nN)."""
2
  import csv
3
  import io
4
  import os
 
11
  from plotly.subplots import make_subplots
12
 
13
  from utils.display import apply_display_scale, cv_colormap_to_plotly_colorscale, is_display_range_remapped
14
+ from utils.report import (create_batch_pdf_report, create_pdf_report, heatmap_figure_png_bytes,
15
+ heatmap_to_rgb_with_contour, info_rows)
16
  from utils.segmentation import estimate_cell_mask
17
+ from utils.units import fmt, make_scale, metric_rows, nice_scale_bar_um, region_metrics, to_pa
18
+ from ui.heatmaps import colorbar_ticks_pa, render_horizontal_colorbar, add_cell_contour_to_fig
19
  from ui.measure_tool import (
20
  build_original_vals,
21
  build_cell_vals,
22
  render_region_canvas,
 
23
  HAS_DRAWABLE_CANVAS,
24
  )
25
 
26
  # Histogram bar color (matches static/s2f_styles.css accent)
27
  _HISTOGRAM_ACCENT = "#0d9488"
28
+ _RESULT_FIG_HEIGHT = 340
29
  _HISTOGRAM_HEIGHT = 180
30
+ _METRIC_HELP = {
31
+ "Mean traction stress": "Mean predicted traction-stress magnitude over the region (Pa)",
32
+ "Max traction stress": "Peak predicted traction-stress magnitude (Pa)",
33
+ "Area": "Region area in µm² (needs the image pixel size)",
34
+ "Total force": "Sum of traction stress × pixel area, in nN (needs the image pixel size). Magnitudes only: "
35
+ "vector cancellation is not taken into account",
36
+ }
37
 
38
 
39
  def _result_banner(badge: str, badge_class: str, title: str) -> str:
 
43
  )
44
 
45
 
46
+ def _metrics_csv(base_name, metrics_full, metrics_cell, info):
47
+ """CSV: one row of metrics with units, then the parameters needed to reproduce the prediction."""
48
+ rows = [["image", "region", "mean_stress_Pa", "max_stress_Pa", "area_um2", "total_force_nN", "n_pixels"]]
49
+ for region, m in [("whole_field", metrics_full), ("force_region", metrics_cell)]:
50
+ if m:
51
+ rows.append([base_name, region, fmt(m["mean_pa"], nd=2), fmt(m["max_pa"], nd=2), fmt(m["area_um2"], nd=1),
52
+ fmt(m["total_force_nN"], nd=3), m["n_px"]])
53
+ rows += [[], ["parameter", "value"]] + [[k.strip(), v] for k, v in info_rows(info)]
54
+ buf = io.StringIO()
55
+ csv.writer(buf).writerows(rows)
56
+ return buf.getvalue()
57
+
58
+
59
+ def _add_scale_bar_to_fig(fig, width_px, height_px, um_per_px, row, col):
60
+ """Draw a µm scale bar (bottom right) on a Plotly image subplot whose axes are in pixels."""
61
+ if not um_per_px:
62
+ return
63
+ length_um = nice_scale_bar_um(width_px * um_per_px)
64
+ if not length_um:
65
+ return
66
+ length_px = length_um / um_per_px
67
+ m = 0.05 * width_px
68
+ x1, y = width_px - m, height_px - m
69
+ xref = "x" if (row, col) == (1, 1) else "x2"
70
+ yref = "y" if (row, col) == (1, 1) else "y2"
71
+ fig.add_shape(type="line", x0=x1 - length_px, x1=x1, y0=y, y1=y, xref=xref, yref=yref,
72
+ line=dict(color="white", width=4))
73
+ fig.add_annotation(x=x1 - length_px / 2, y=y - 0.03 * height_px, xref=xref, yref=yref, text=f"{length_um:g} µm",
74
+ showarrow=False, font=dict(color="white", size=11))
75
+
76
+
77
  def render_batch_results(batch_results, colormap_name="Jet", display_mode="Default",
78
+ clip_min=0, clip_max=1,
79
+ auto_cell_boundary=False, clamp_only=False):
80
  """
81
+ Render batch prediction results: summary table (units), bright-field row, heatmap row and bulk downloads.
82
+ batch_results: list of dicts with img, heatmap, key_img, cell_mask, scale, info.
 
83
  """
84
  if not batch_results:
85
  return
86
 
 
87
  for r in batch_results:
88
  if auto_cell_boundary and (r.get("cell_mask") is None or not np.any(r.get("cell_mask", 0) > 0)):
89
  r["_cell_mask"] = estimate_cell_mask(r["heatmap"])
90
  else:
91
  r["_cell_mask"] = r.get("cell_mask") if auto_cell_boundary else None
92
+ r["_display_heatmap"] = apply_display_scale(r["heatmap"], display_mode, clip_min=clip_min, clip_max=clip_max)
93
+ r["_metrics"] = region_metrics(r["heatmap"], r["_cell_mask"] if auto_cell_boundary else None, r["scale"])
94
+
95
+ region = "force region (red contour)" if auto_cell_boundary else "whole field"
96
+ headers = ["Image", "Mean stress (Pa)", "Max stress (Pa)", "Area (µm²)", "Total force (nN)"]
 
97
  rows = []
98
+ csv_rows = [["image", "region", "mean_stress_Pa", "max_stress_Pa", "area_um2", "total_force_nN", "n_pixels",
99
+ "model", "checkpoint", "checkpoint_sha256", "substrate_setting", "image_um_per_px", "stress_max_Pa",
100
+ "app_version"]]
101
  for r in batch_results:
102
+ m, key, info = r["_metrics"], r["key_img"] or "image", r.get("info", {})
103
+ rows.append([key, fmt(m["mean_pa"], nd=1), fmt(m["max_pa"], nd=1), fmt(m["area_um2"], nd=0),
104
+ fmt(m["total_force_nN"], nd=2)])
105
+ sub = info.get("substrate") or {}
106
+ csv_rows.append([os.path.splitext(key)[0], region, fmt(m["mean_pa"], nd=2), fmt(m["max_pa"], nd=2),
107
+ fmt(m["area_um2"], nd=1), fmt(m["total_force_nN"], nd=3), m["n_px"],
108
+ info.get("model", {}).get("architecture", ""), info.get("model", {}).get("checkpoint", ""),
109
+ info.get("model", {}).get("checkpoint_sha256", ""),
110
+ sub.get("name") or (f"manual {sub.get('pixelsize')}/{sub.get('young')}" if sub else ""),
111
+ info.get("image_um_per_px") or "", info.get("stress_max_pa", ""), info.get("app_version", "")])
 
 
 
 
 
112
  st.markdown(_result_banner("INPUT", "input", "Bright-field images"), unsafe_allow_html=True)
113
  n_cols = min(5, len(batch_results))
114
  bf_cols = st.columns(n_cols)
115
  for i, r in enumerate(batch_results):
116
  img = r["img"]
117
+ img_rgb = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB) if img.ndim == 2 else cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
 
 
 
118
  with bf_cols[i % n_cols]:
119
  st.image(img_rgb, caption=r["key_img"], use_container_width=True)
120
  is_rescale_b = is_display_range_remapped(display_mode, clip_min, clip_max)
121
+ st.markdown(_result_banner("OUTPUT", "output", "Predicted traction-stress maps"), unsafe_allow_html=True)
122
  hm_cols = st.columns(n_cols)
123
  for i, r in enumerate(batch_results):
124
+ hm_rgb = heatmap_to_rgb_with_contour(r["_display_heatmap"], colormap_name,
125
+ r.get("_cell_mask") if auto_cell_boundary else None)
 
 
126
  with hm_cols[i % n_cols]:
127
  st.image(hm_rgb, caption=r["key_img"], use_container_width=True)
128
+ smax = batch_results[0]["scale"]["stress_max_pa"]
129
+ render_horizontal_colorbar(colormap_name, clip_min, clip_max, is_rescale_b, stress_max_pa=smax)
130
+ st.dataframe({h: [row[i] for row in rows] for i, h in enumerate(headers)}, use_container_width=True, hide_index=True)
131
+ st.caption(f"Metrics over the {region}. Area and total force need the image pixel size (sidebar).")
132
+ with st.expander("Traction-stress distribution (histograms)", expanded=False):
 
 
 
 
133
  for i, r in enumerate(batch_results):
 
134
  cell_mask = r.get("_cell_mask")
135
+ vals = to_pa(r["heatmap"], r["scale"])
136
+ vals = vals[cell_mask > 0] if (cell_mask is not None and np.any(cell_mask > 0) and auto_cell_boundary) else vals.ravel()
137
  vals = vals[vals > 0] if np.any(vals > 0) else vals
138
  st.markdown(f"**{r['key_img']}**")
139
  if len(vals) > 0:
140
  fig = go.Figure(data=[go.Histogram(x=vals, nbinsx=50, marker_color=_HISTOGRAM_ACCENT)])
141
+ fig.update_layout(height=_HISTOGRAM_HEIGHT, margin=dict(l=40, r=20, t=10, b=40),
142
+ xaxis_title="Traction stress (Pa)", yaxis_title="Pixels", showlegend=False)
 
 
 
143
  st.plotly_chart(fig, use_container_width=True, config={"displayModeBar": False})
144
  else:
145
  st.caption("No data")
146
  if i < len(batch_results) - 1:
147
  st.divider()
 
148
  buf_csv = io.StringIO()
149
  csv.writer(buf_csv).writerows(csv_rows)
150
+ lo_b, hi_b = (clip_min, clip_max) if is_rescale_b else (0.0, 1.0)
151
  zip_buf = io.BytesIO()
152
  with zipfile.ZipFile(zip_buf, "w", zipfile.ZIP_DEFLATED) as zf:
153
  for r in batch_results:
 
 
 
 
154
  base = os.path.splitext(r["key_img"] or "image")[0]
155
+ png = heatmap_figure_png_bytes(r["_display_heatmap"], colormap_name,
156
+ r.get("_cell_mask") if auto_cell_boundary else None, r["scale"], lo_b, hi_b)
157
+ zf.writestr(f"{base}_traction_stress.png", png.getvalue())
158
+ zf.writestr(f"{base}_traction_stress_Pa.tif", _tiff_pa_bytes(r["heatmap"], r["scale"]))
159
+ zf.writestr("README.txt", _ZIP_README.format(smax=smax))
160
  zip_buf.seek(0)
161
+ pdf_items = [dict(img=r["img"], display_heatmap=r["_display_heatmap"], raw_heatmap=r["heatmap"],
162
+ base_name=os.path.splitext(r["key_img"] or "image")[0],
163
+ cell_mask=r.get("_cell_mask") if auto_cell_boundary else None,
164
+ metrics_full=region_metrics(r["heatmap"], None, r["scale"]),
165
+ metrics_cell=r["_metrics"] if auto_cell_boundary else None,
166
+ info=r.get("info"), scale=r["scale"]) for r in batch_results]
167
+ pdf_bytes = create_batch_pdf_report(pdf_items, colormap_name, lo_b, hi_b, auto_cell_boundary)
168
+ dl_col1, dl_col2, dl_col3 = st.columns(3)
169
  with dl_col1:
170
+ st.download_button("Download report (PDF)", data=pdf_bytes, file_name="s2f_batch_report.pdf",
171
+ mime="application/pdf", key="download_batch_pdf", icon=":material/picture_as_pdf:",
172
+ help="Summary table of all images, then one page per image with maps, metrics and parameters.")
 
 
 
 
 
173
  with dl_col2:
174
+ st.download_button("Download values (CSV)", data=buf_csv.getvalue(), file_name="s2f_batch_results.csv",
175
+ mime="text/csv", key="download_batch_csv", icon=":material/download:",
176
+ help="One row per image: metrics with units and the parameters used.")
177
+ with dl_col3:
178
+ st.download_button("Download maps (ZIP)", data=zip_buf.getvalue(), file_name="s2f_batch_maps.zip",
179
+ mime="application/zip", key="download_batch_heatmaps", icon=":material/image:",
180
+ help="For each image: a PNG to view (colourbar and scale bar) and a TIFF whose pixel "
181
+ "values are traction stress in Pa, for measurements in Fiji/ImageJ.")
182
+
183
+
184
+ _ZIP_README = """Shape2Force (S2F) - predicted traction-stress maps
185
+
186
+ For each image:
187
+ <name>_traction_stress.png picture of the map with colourbar (Pa) and scale bar, for viewing and figures
188
+ <name>_traction_stress_Pa.tif the same map as numbers: each pixel value is the predicted traction stress in Pa
189
+ (32-bit, 1024 x 1024). Open it in Fiji/ImageJ to measure regions yourself
190
+ (e.g. draw an ROI and use Analyze > Measure: Mean = mean traction stress in Pa).
191
+
192
+ Scale: model output 1.0 = {smax:.0f} Pa. S2F predicts the magnitude of the traction stress, not its direction.
193
+ The TIFF covers the whole image resized to 1024 x 1024 pixels; one TIFF pixel = (image width x pixel size / 1024) um.
194
+ """
195
+
196
+
197
+ def _tiff_pa_bytes(heatmap, scale):
198
+ """Traction-stress map in Pa as a 32-bit float TIFF (readable by Fiji/ImageJ)."""
199
+ ok, enc = cv2.imencode(".tif", to_pa(heatmap, scale).astype(np.float32))
200
+ return enc.tobytes() if ok else b""
201
 
202
 
203
  def render_result_display(img, raw_heatmap, display_heatmap, pixel_sum, force, key_img, download_key_suffix="",
204
+ colormap_name="Jet", display_mode="Default", measure_region_dialog=None, auto_cell_boundary=True,
205
+ cell_mask=None, clip_min=0.0, clip_max=1.0, clamp_only=False, scale=None, info=None):
206
  """
207
+ Render one prediction: bright field + traction-stress map (µm scale bars, colourbar in Pa), metrics with
208
+ units, statistics, and downloads (PNG with scale bar and colourbar, CSV and PDF report with all parameters).
209
+ scale: utils.units.make_scale(...); info: provenance dict (see app.py).
 
210
  """
211
+ scale = scale or make_scale("single_cell", image_shape=img.shape[:2])
212
+ smax = scale["stress_max_pa"]
213
  if cell_mask is None and auto_cell_boundary:
214
  cell_mask = estimate_cell_mask(raw_heatmap)
215
  elif not auto_cell_boundary:
216
  cell_mask = None
217
+ metrics_full = region_metrics(raw_heatmap, None, scale)
218
+ metrics_cell = region_metrics(raw_heatmap, cell_mask, scale) if (cell_mask is not None and np.any(cell_mask > 0)) else None
219
+ shown = metrics_cell if (auto_cell_boundary and metrics_cell) else metrics_full
220
  base_name = os.path.splitext(key_img or "image")[0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  is_rescale = is_display_range_remapped(display_mode, clip_min, clip_max)
222
+ lo, hi = (clip_min, clip_max) if is_rescale else (0.0, 1.0)
223
 
224
  tit1, tit2 = st.columns(2)
225
  with tit1:
226
  st.markdown(_result_banner("INPUT", "input", "Bright-field image"), unsafe_allow_html=True)
227
  with tit2:
228
+ st.markdown(_result_banner("OUTPUT", "output", "Predicted traction-stress map"), unsafe_allow_html=True)
229
  fig_pl = make_subplots(rows=1, cols=2)
230
+ fig_pl.add_trace(go.Heatmap(z=img, colorscale="gray", showscale=False, hoverinfo="skip"), row=1, col=1)
231
+ ticks, labels = colorbar_ticks_pa(lo, hi, smax)
232
+ colorbar_cfg = dict(len=0.8, thickness=12, tickmode="array", tickvals=ticks, ticktext=labels,
233
+ title=dict(text="Pa", side="top"))
234
+ fig_pl.add_trace(go.Heatmap(z=display_heatmap, colorscale=cv_colormap_to_plotly_colorscale(colormap_name),
235
+ zmin=0.0, zmax=1.0, showscale=True, colorbar=colorbar_cfg,
236
+ customdata=to_pa(raw_heatmap, scale),
237
+ hovertemplate="x %{x}, y %{y}<br>%{customdata:.1f} Pa<extra></extra>"), row=1, col=2)
 
 
 
 
 
238
  add_cell_contour_to_fig(fig_pl, cell_mask, row=1, col=2)
239
+ _add_scale_bar_to_fig(fig_pl, img.shape[1], img.shape[0], scale.get("image_um_per_px"), 1, 1)
240
+ _add_scale_bar_to_fig(fig_pl, display_heatmap.shape[1], display_heatmap.shape[0], scale.get("hm_um_per_px_x"), 1, 2)
241
+ fig_pl.update_layout(height=_RESULT_FIG_HEIGHT, margin=dict(l=10, r=10, t=10, b=10),
242
+ xaxis=dict(scaleanchor="y", scaleratio=1), xaxis2=dict(scaleanchor="y2", scaleratio=1))
 
 
243
  fig_pl.update_xaxes(showticklabels=False, showgrid=False, zeroline=False)
244
  fig_pl.update_yaxes(showticklabels=False, autorange="reversed", showgrid=False, zeroline=False)
245
  st.plotly_chart(fig_pl, use_container_width=True, config={"displayModeBar": True, "responsive": True})
246
+ if is_rescale:
247
+ st.caption(f"Display range {lo * smax:.0f}–{hi * smax:.0f} Pa; stresses above {hi * smax:.0f} Pa are shown "
248
+ "in the top colour. Metrics always use the full prediction.")
249
 
250
+ cols = st.columns(4)
251
+ for col, (label, value) in zip(cols, metric_rows(shown)):
252
+ with col:
253
+ st.metric(label, value, help=_METRIC_HELP[label])
254
+ st.caption(("Metrics inside the force region (red contour), estimated from the predicted map." if shown is metrics_cell else
255
+ "Metrics over the whole field of view.")
256
+ + ("" if scale.get("hm_px_area_um2") else " Enter the image pixel size in the sidebar to get area and total force."))
 
 
 
 
 
 
 
 
 
 
 
 
257
 
 
258
  with st.expander("Statistics"):
259
+ vals = to_pa(raw_heatmap, scale)
260
+ vals = vals[cell_mask > 0] if (shown is metrics_cell and cell_mask is not None) else vals.ravel()
261
  if len(vals) > 0:
262
+ c1, c2, c3 = st.columns(3)
263
+ p25, p50, p75, p90 = (float(np.percentile(vals, q)) for q in (25, 50, 75, 90))
264
+ with c1:
265
+ st.metric("Mean", f"{float(np.mean(vals)):.1f} Pa")
266
+ st.metric("Std", f"{float(np.std(vals)):.1f} Pa")
267
+ with c2:
268
+ st.metric("P25", f"{p25:.1f} Pa")
269
+ st.metric("P50 (median)", f"{p50:.1f} Pa")
270
+ with c3:
271
+ st.metric("P75", f"{p75:.1f} Pa")
272
+ st.metric("P90", f"{p90:.1f} Pa")
 
 
 
 
273
  hist_fig = go.Figure(data=[go.Histogram(x=vals, nbinsx=50, marker_color=_HISTOGRAM_ACCENT)])
274
+ hist_fig.update_layout(height=_HISTOGRAM_HEIGHT, margin=dict(l=40, r=20, t=20, b=40),
275
+ xaxis_title="Traction stress (Pa)", yaxis_title="Pixels", showlegend=False)
 
 
 
276
  st.plotly_chart(hist_fig, use_container_width=True, config={"displayModeBar": False})
277
  else:
278
+ st.caption("No values to compute statistics.")
 
 
 
 
 
 
279
 
280
+ with st.expander("Parameters of this prediction"):
281
+ st.table({"Parameter": [k for k, _ in info_rows(info)], "Value": [str(v) for _, v in info_rows(info)]})
 
 
 
282
 
283
+ with st.expander("How to read the results"):
284
+ st.markdown(f"""
285
+ **Input (left):** the bright-field image you provided (cell shape only, no force information).
 
 
 
 
 
 
 
 
 
 
 
 
286
 
287
+ **Output (right):** predicted **traction-stress magnitude** (Pa).
288
+ - The model output is normalised to 0–1, with 1 = **{smax:.0f} Pa**, the fixed colour limit of the
289
+ {'single-cell' if smax >= 500 else 'spheroid'} ground-truth TFM maps used for training. The colourbar shows Pa.
290
+ - S2F predicts the magnitude only, not the direction, and predictions tend to underestimate the highest stresses.
291
+ - **Range** (sidebar) narrows the displayed window, e.g. 0–250 Pa, to show low-stress patterns; stresses above the
292
+ window saturate. The metrics are always computed from the full prediction.
293
+ - **Red contour** ("Measure force region only", on by default): the region of high predicted stress, estimated from
294
+ the map (not the cell outline); the metrics refer to this region so the background does not dilute them.
295
 
296
+ **Metrics:** mean and maximum traction stress (Pa); area (µm²) and total force (nN = Σ stress × pixel area)
297
+ need the image pixel size. Total force sums magnitudes, so it is not the net force.
298
+ """)
299
 
300
+ original_vals = build_original_vals(raw_heatmap, pixel_sum, force, scale)
301
+ buf_hm = heatmap_figure_png_bytes(display_heatmap, colormap_name, cell_mask, scale, lo, hi)
302
+ csv_text = _metrics_csv(base_name, metrics_full, metrics_cell, info)
303
+ pdf_bytes = create_pdf_report(img, display_heatmap, raw_heatmap, base_name, colormap_name, cell_mask=cell_mask,
304
+ metrics_full=metrics_full, metrics_cell=metrics_cell, info=info, scale=scale,
305
+ clip_min=lo, clip_max=hi)
306
 
307
  btn_col1, btn_col2, btn_col3, btn_col4 = st.columns(4)
308
  with btn_col1:
 
312
  st.rerun()
313
  elif HAS_DRAWABLE_CANVAS:
314
  with st.expander("Measure tool"):
315
+ expander_cell_vals = build_cell_vals(raw_heatmap, cell_mask, pixel_sum, force, scale) if (auto_cell_boundary and cell_mask is not None) else None
316
+ render_region_canvas(display_heatmap, raw_heatmap=raw_heatmap, bf_img=img, original_vals=original_vals,
317
+ cell_vals=expander_cell_vals, cell_mask=cell_mask if auto_cell_boundary else None,
318
+ key_suffix="expander", input_filename=key_img, colormap_name=colormap_name)
 
 
 
 
 
 
 
 
 
319
  else:
320
  st.caption("Install `streamlit-drawable-canvas-fix` for region measurement: `pip install streamlit-drawable-canvas-fix`")
321
  with btn_col2:
322
+ st.download_button("Download map", width="stretch", data=buf_hm.getvalue(),
323
+ file_name=f"{base_name}_traction_stress.png", mime="image/png",
324
+ key=f"download_heatmap{download_key_suffix}", icon=":material/download:")
 
 
 
 
 
 
325
  with btn_col3:
326
+ st.download_button("Download values", width="stretch", data=csv_text, file_name=f"{base_name}_values.csv",
327
+ mime="text/csv", key=f"download_main_values{download_key_suffix}", icon=":material/download:")
 
 
 
 
 
 
 
328
  with btn_col4:
329
+ st.download_button("Download report", width="stretch", data=pdf_bytes, file_name=f"{base_name}_report.pdf",
330
+ mime="application/pdf", key=f"download_pdf{download_key_suffix}",
331
+ icon=":material/picture_as_pdf:")
 
 
 
 
 
 
S2FApp/utils/display.py CHANGED
@@ -32,30 +32,18 @@ def is_display_range_remapped(display_mode, clip_min, clip_max):
32
 
33
  def apply_display_scale(heatmap, mode, clip_min=0, clip_max=1, clamp_only=False):
34
  """
35
- Apply display scaling. Display only—does not change underlying values.
36
 
37
- Supports modes used by the app: ``Default`` (clip to [0, 1]) and ``Range``
38
- (window to [clip_min, clip_max]). Unknown ``mode`` is treated like ``Default``.
39
-
40
- Parameters
41
- ----------
42
- clamp_only : bool
43
- For ``mode == "Range"`` when ``clip_max > clip_min``:
44
-
45
- - **False** (default in the app for Range): pixels outside ``[clip_min, clip_max]`` are set
46
- to 0; values inside are linearly mapped to ``[0, 1]`` for the colormap.
47
- - **True**: values are clamped to ``[clip_min, clip_max]`` without rescaling to ``[0, 1]``.
48
  """
 
49
  if mode != "Range":
50
- return np.clip(heatmap, 0, 1).astype(np.float32)
51
- # Range
52
  vmin, vmax = float(clip_min), float(clip_max)
53
  if vmax > vmin:
54
- h = heatmap.astype(np.float32)
55
- if clamp_only:
56
- return np.clip(h, vmin, vmax).astype(np.float32)
57
- mask = (h >= vmin) & (h <= vmax)
58
- out = np.zeros_like(h)
59
- out[mask] = (h[mask] - vmin) / (vmax - vmin)
60
- return np.clip(out, 0, 1).astype(np.float32)
61
- return np.clip(heatmap, 0, 1).astype(np.float32)
 
32
 
33
  def apply_display_scale(heatmap, mode, clip_min=0, clip_max=1, clamp_only=False):
34
  """
35
+ Map the normalised prediction (0-1) to colormap positions. Display only; values are unchanged.
36
 
37
+ ``Default``: the full scale, 0-1 (= 0-500 Pa single cells, 0-50 Pa spheroids).
38
+ ``Range``: the window [clip_min, clip_max] is stretched over the whole colormap; values below the window
39
+ are shown as the lowest colour and values above it **saturate at the highest colour**. (Earlier versions set
40
+ values above the window to 0, which displayed the strongest stresses as zero.)
41
+ ``clamp_only`` is kept for backward compatibility and ignored.
 
 
 
 
 
 
42
  """
43
+ h = np.asarray(heatmap, dtype=np.float32)
44
  if mode != "Range":
45
+ return np.clip(h, 0, 1).astype(np.float32)
 
46
  vmin, vmax = float(clip_min), float(clip_max)
47
  if vmax > vmin:
48
+ return np.clip((h - vmin) / (vmax - vmin), 0, 1).astype(np.float32)
49
+ return np.clip(h, 0, 1).astype(np.float32)
 
 
 
 
 
 
S2FApp/utils/report.py CHANGED
@@ -1,5 +1,6 @@
1
  """Report and heatmap export utilities."""
2
  import io
 
3
  from datetime import datetime
4
 
5
  import cv2
@@ -10,7 +11,7 @@ from reportlab.lib.units import inch
10
  from reportlab.lib.utils import ImageReader
11
  from reportlab.pdfgen import canvas
12
 
13
- from config.constants import COLORMAPS
14
 
15
 
16
  def _draw_pdf_footer(c, margin=72, footer_y=40, include_web_app=False):
@@ -82,73 +83,243 @@ def heatmap_to_png_bytes(scaled_heatmap, colormap_name="Jet", cell_mask=None, zm
82
  return buf
83
 
84
 
85
- def create_pdf_report(img, display_heatmap, raw_heatmap, pixel_sum, force, base_name, colormap_name="Jet",
86
- cell_mask=None, cell_pixel_sum=None, cell_force=None, cell_mean=None, zmin=None, zmax=None):
87
- """Create a PDF report with input image, heatmap, and metrics."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  buf = io.BytesIO()
89
- c = canvas.Canvas(buf, pagesize=A4)
90
- c.setTitle("Shape2Force")
91
- c.setAuthor("Angione-Lab")
 
 
 
 
 
 
 
92
  page_w_pt, page_h_pt = A4[0], A4[1]
93
- margin = 72
94
  layout = _pdf_image_layout(page_w_pt, page_h_pt, margin)
95
- img_w = layout["img_w"]
96
- img_h = layout["img_h"]
97
- bf_x = layout["bf_x"]
98
- hm_x = layout["hm_x"]
99
  img_bottom = layout["img_bottom"]
100
- y_top = layout["y_top"]
101
 
102
  _draw_pdf_footer(c, margin=margin, include_web_app=True)
103
- c.setFont("Helvetica-Bold", 16)
104
  c.drawString(margin, y_top, "Shape2Force (S2F) - Prediction Report")
105
  c.setFont("Helvetica", 10)
106
- c.drawString(margin, y_top - 14, f"Image: {base_name}")
107
- y_top -= 35
108
 
109
- img_pil = Image.fromarray(img) if img.ndim == 2 else Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
110
- img_buf = io.BytesIO()
111
- img_pil.save(img_buf, format="PNG")
112
- img_buf.seek(0)
113
- c.drawImage(ImageReader(img_buf), bf_x, img_bottom, width=img_w, height=img_h, preserveAspectRatio=True)
 
 
 
 
 
 
114
  c.setFont("Helvetica", 9)
115
- bf_label_w = c.stringWidth("Bright-field", "Helvetica", 9)
116
- c.drawString(bf_x + (img_w - bf_label_w) / 2, img_bottom - 14, "Bright-field")
117
 
118
- heatmap_rgb = heatmap_to_rgb_with_contour(display_heatmap, colormap_name, cell_mask, zmin=zmin, zmax=zmax)
119
- hm_buf = io.BytesIO()
120
- Image.fromarray(heatmap_rgb).save(hm_buf, format="PNG")
121
- hm_buf.seek(0)
122
- c.drawImage(ImageReader(hm_buf), hm_x, img_bottom, width=img_w, height=img_h, preserveAspectRatio=True)
123
- hm_label = "Force map (red = estimated boundary)" if cell_mask is not None and np.any(cell_mask > 0) else "Force map"
124
- hm_label_w = c.stringWidth(hm_label, "Helvetica", 9)
125
- c.drawString(hm_x + (img_w - hm_label_w) / 2, img_bottom - 14, hm_label)
126
 
127
- # Metrics section with spacing
128
- row_height = 14
129
- y = img_bottom - 14 - row_height
130
  c.setFont("Helvetica-Bold", 10)
131
  c.drawString(margin, y, "Metrics")
 
132
  c.setFont("Helvetica", 9)
133
- y -= 18
134
- if cell_pixel_sum is not None and cell_force is not None and cell_mean is not None:
135
- metrics = [
136
- ("Cell sum (estimated boundary)", f"{cell_pixel_sum:.2f}"),
137
- ("Cell force (scaled)", f"{cell_force:.2f}"),
138
- ("Heatmap max", f"{np.max(raw_heatmap):.4f}"),
139
- ("Heatmap mean (estimated boundary)", f"{cell_mean:.4f}"),
140
- ]
141
- else:
142
- metrics = [
143
- ("Sum of all pixels", f"{pixel_sum:.2f}"),
144
- ("Cell force (scaled)", f"{force:.2f}"),
145
- ("Heatmap max", f"{np.max(raw_heatmap):.4f}"),
146
- ("Heatmap mean", f"{np.mean(raw_heatmap):.4f}"),
147
- ]
148
- for label, val in metrics:
149
- c.drawString(margin, y, f"{label}: {val}")
150
- y -= 16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  c.save()
153
  buf.seek(0)
154
  return buf.getvalue()
@@ -194,8 +365,8 @@ def create_measure_pdf_report(bf_img, heatmap_labeled_rgb, table_rows, base_name
194
  Image.fromarray(heatmap_labeled_rgb).save(hm_labeled_buf, format="PNG")
195
  hm_labeled_buf.seek(0)
196
  c.drawImage(ImageReader(hm_labeled_buf), hm_x, img_bottom, width=img_w, height=img_h, preserveAspectRatio=True)
197
- hm_label_w = c.stringWidth("Force map", "Helvetica", 9)
198
- c.drawString(hm_x + (img_w - hm_label_w) / 2, img_bottom - 14, "Force map")
199
 
200
  # Spacing: one line between images/labels and measurements section
201
  row_height = 14
 
1
  """Report and heatmap export utilities."""
2
  import io
3
+ import textwrap
4
  from datetime import datetime
5
 
6
  import cv2
 
11
  from reportlab.lib.utils import ImageReader
12
  from reportlab.pdfgen import canvas
13
 
14
+ from config.constants import ARCH_LABELS, AUTO_BOUNDARY_DESCRIPTION, COLORMAPS
15
 
16
 
17
  def _draw_pdf_footer(c, margin=72, footer_y=40, include_web_app=False):
 
83
  return buf
84
 
85
 
86
+ def info_rows(info):
87
+ """Provenance of a prediction as (label, value) rows: everything needed to reproduce it."""
88
+ if not info:
89
+ return []
90
+ m = info.get("model", {})
91
+ rows = [
92
+ ("Input file", info.get("input_file", "–")),
93
+ ("Prediction time (UTC)", info.get("time", "–")),
94
+ ("Model type", {"single_cell": "Single cell", "spheroid": "Spheroid"}.get(m.get("model_type"), "–")),
95
+ ("Architecture", ARCH_LABELS.get(m.get("architecture"), m.get("architecture", "–"))),
96
+ ("Checkpoint", m.get("checkpoint", "–")),
97
+ ("Checkpoint SHA-256", m.get("checkpoint_sha256", "–")),
98
+ ]
99
+ sub = info.get("substrate")
100
+ if sub:
101
+ if sub.get("mode") == "preset":
102
+ rows.append(("Substrate setting (preset)", sub.get("name", "–")))
103
+ else:
104
+ rows.append(("Substrate setting (manual)", "–"))
105
+ rows.append((" pixel-size setting / Young's modulus", f"{sub.get('pixelsize'):.4f} / {sub.get('young'):.0f} Pa"))
106
+ rows.append((" model input channels (normalised)",
107
+ f"{sub.get('pixelsize_norm'):.3f} / {sub.get('young_norm'):.3f}"))
108
+ shp = info.get("image_shape")
109
+ rows += [
110
+ ("Image size (px)", f"{shp[1]} x {shp[0]}" if shp else "–"),
111
+ ("Image pixel size", f"{info['image_um_per_px']:.4f} µm/px (user input)" if info.get("image_um_per_px") else "not set"),
112
+ ("Stress scale", f"normalised output 1.0 = {info.get('stress_max_pa', 0):.0f} Pa"),
113
+ ]
114
+ d = info.get("display", {})
115
+ if d:
116
+ rows.append(("Display", f"{d.get('colormap', '–')}, {d.get('range_pa', ('–', '–'))[0]:.0f}-{d.get('range_pa', ('–', '–'))[1]:.0f} Pa"
117
+ + (" (values above the range shown in the top colour)" if d.get("mode") == "Range" else "")))
118
+ rows.append(("Measure force region only", f"on ({AUTO_BOUNDARY_DESCRIPTION})" if info.get("auto_boundary") else "off (whole field of view)"))
119
+ rows.append(("App version", f"{info.get('app_version', '–')}" + (f" (commit {info['app_commit']})" if info.get("app_commit") else "")))
120
+ return rows
121
+
122
+
123
+ def colorbar_strip_rgb(width, colormap_name, clip_min=0.0, clip_max=1.0, stress_max_pa=500.0, height=70):
124
+ """Horizontal colourbar with tick labels in Pa, as an RGB image (white background)."""
125
+ from ui.heatmaps import colorbar_ticks_pa
126
+ strip = np.full((height, width, 3), 255, np.uint8)
127
+ pad = max(10, width // 30)
128
+ bar_w = width - 2 * pad
129
+ grad = np.linspace(0, 255, bar_w).astype(np.uint8).reshape(1, -1)
130
+ rgb = cv2.cvtColor(cv2.applyColorMap(grad, COLORMAPS.get(colormap_name, cv2.COLORMAP_JET)), cv2.COLOR_BGR2RGB)
131
+ bar_h = height // 4
132
+ strip[6:6 + bar_h, pad:pad + bar_w] = np.repeat(rgb, bar_h, axis=0)
133
+ pos, labels = colorbar_ticks_pa(clip_min, clip_max, stress_max_pa)
134
+ fs = max(0.4, width / 950)
135
+ lw = max(1, int(round(fs * 1.6)))
136
+ for t, lab in zip(pos, labels):
137
+ x = pad + int(t * (bar_w - 1))
138
+ cv2.line(strip, (x, 6 + bar_h), (x, 12 + bar_h), (0, 0, 0), lw)
139
+ (tw, th), _ = cv2.getTextSize(lab, cv2.FONT_HERSHEY_SIMPLEX, fs, lw)
140
+ cv2.putText(strip, lab, (min(max(x - tw // 2, 0), width - tw), 18 + bar_h + th), cv2.FONT_HERSHEY_SIMPLEX, fs,
141
+ (0, 0, 0), lw, cv2.LINE_AA)
142
+ title = "Traction stress (Pa)"
143
+ (tw, th), _ = cv2.getTextSize(title, cv2.FONT_HERSHEY_SIMPLEX, fs, lw)
144
+ cv2.putText(strip, title, ((width - tw) // 2, height - 8), cv2.FONT_HERSHEY_SIMPLEX, fs, (0, 0, 0), lw, cv2.LINE_AA)
145
+ return strip
146
+
147
+
148
+ def heatmap_figure_rgb(display_heatmap, colormap_name="Jet", cell_mask=None, scale=None, clip_min=0.0, clip_max=1.0):
149
+ """Heatmap with optional red boundary, µm scale bar and a Pa colourbar underneath (for PNG/PDF export)."""
150
+ from utils.units import draw_scale_bar
151
+ hm = heatmap_to_rgb_with_contour(display_heatmap, colormap_name, cell_mask)
152
+ if scale is not None and scale.get("hm_um_per_px_x"):
153
+ draw_scale_bar(hm, scale["hm_um_per_px_x"])
154
+ smax = scale["stress_max_pa"] if scale else 1.0
155
+ bar = colorbar_strip_rgb(hm.shape[1], colormap_name, clip_min, clip_max, smax, height=max(80, hm.shape[0] // 6))
156
+ return np.vstack([hm, bar])
157
+
158
+
159
+ def heatmap_figure_png_bytes(display_heatmap, colormap_name="Jet", cell_mask=None, scale=None, clip_min=0.0, clip_max=1.0):
160
  buf = io.BytesIO()
161
+ Image.fromarray(heatmap_figure_rgb(display_heatmap, colormap_name, cell_mask, scale, clip_min, clip_max)).save(buf, format="PNG")
162
+ buf.seek(0)
163
+ return buf
164
+
165
+
166
+ def _draw_prediction_page(c, img, display_heatmap, raw_heatmap, base_name, colormap_name="Jet", cell_mask=None,
167
+ metrics_full=None, metrics_cell=None, info=None, scale=None, clip_min=0.0, clip_max=1.0,
168
+ page_label=None):
169
+ """Draw one prediction (images, metrics, parameters) on the current page of canvas `c`."""
170
+ from utils.units import draw_scale_bar, metric_rows
171
  page_w_pt, page_h_pt = A4[0], A4[1]
172
+ margin = 60
173
  layout = _pdf_image_layout(page_w_pt, page_h_pt, margin)
174
+ img_w, img_h = layout["img_w"], layout["img_h"]
175
+ bf_x, hm_x, y_top = layout["bf_x"], layout["hm_x"], layout["y_top"]
 
 
176
  img_bottom = layout["img_bottom"]
 
177
 
178
  _draw_pdf_footer(c, margin=margin, include_web_app=True)
179
+ c.setFont("Helvetica-Bold", 15)
180
  c.drawString(margin, y_top, "Shape2Force (S2F) - Prediction Report")
181
  c.setFont("Helvetica", 10)
182
+ c.drawString(margin, y_top - 14, f"Image: {base_name}" + (f" ({page_label})" if page_label else ""))
 
183
 
184
+ bf = img if img.ndim == 3 else cv2.cvtColor(img, cv2.COLOR_GRAY2RGB)
185
+ bf_um_per_px = scale.get("image_um_per_px") if scale else None
186
+ if max(bf.shape[:2]) > 1024: # keep the PDF small; the scale bar follows the resampling
187
+ f = 1024 / max(bf.shape[:2])
188
+ bf = cv2.resize(bf, (int(bf.shape[1] * f), int(bf.shape[0] * f)), interpolation=cv2.INTER_AREA)
189
+ bf_um_per_px = bf_um_per_px / f if bf_um_per_px else None
190
+ bf = np.ascontiguousarray(bf.copy())
191
+ if bf_um_per_px:
192
+ draw_scale_bar(bf, bf_um_per_px)
193
+ bf_buf = io.BytesIO(); Image.fromarray(bf).save(bf_buf, format="PNG"); bf_buf.seek(0)
194
+ c.drawImage(ImageReader(bf_buf), bf_x, img_bottom, width=img_w, height=img_h, preserveAspectRatio=True)
195
  c.setFont("Helvetica", 9)
196
+ c.drawCentredString(bf_x + img_w / 2, img_bottom - 12, "Bright field")
 
197
 
198
+ fig = heatmap_figure_rgb(display_heatmap, colormap_name, cell_mask, scale, clip_min, clip_max)
199
+ fig_h = img_h * fig.shape[0] / fig.shape[1]
200
+ hm_buf = io.BytesIO(); Image.fromarray(fig).save(hm_buf, format="PNG", optimize=True); hm_buf.seek(0)
201
+ c.drawImage(ImageReader(hm_buf), hm_x, img_bottom + img_h - fig_h, width=img_w, height=fig_h, preserveAspectRatio=True)
202
+ hm_label = "Predicted traction stress (red = force region)" if cell_mask is not None and np.any(cell_mask > 0) \
203
+ else "Predicted traction stress"
204
+ c.drawCentredString(hm_x + img_w / 2, img_bottom + img_h - fig_h - 12, hm_label)
 
205
 
206
+ y = img_bottom + img_h - fig_h - 40
 
 
207
  c.setFont("Helvetica-Bold", 10)
208
  c.drawString(margin, y, "Metrics")
209
+ y -= 15
210
  c.setFont("Helvetica", 9)
211
+ cols = [("Whole field of view", metrics_full)] + ([("Force region (red)", metrics_cell)] if metrics_cell else [])
212
+ x_cols = [margin + 170 + i * 150 for i in range(len(cols))]
213
+ for xc, (title, _) in zip(x_cols, cols):
214
+ c.setFont("Helvetica-Bold", 9); c.drawString(xc, y, title)
215
+ c.setFont("Helvetica", 9)
216
+ y -= 13
217
+ labels = [r[0] for r in metric_rows(metrics_full or {})]
218
+ for li, lab in enumerate(labels):
219
+ c.drawString(margin, y, lab)
220
+ for xc, (_, m) in zip(x_cols, cols):
221
+ c.drawString(xc, y, metric_rows(m or {})[li][1])
222
+ y -= 13
223
+ if scale is None or not scale.get("hm_px_area_um2"):
224
+ c.setFont("Helvetica-Oblique", 8)
225
+ c.drawString(margin, y, "Area and total force need the image pixel size (sidebar).")
226
+ y -= 12
227
+ c.setFont("Helvetica-Oblique", 8)
228
+ c.drawString(margin, y, "Total force = sum of traction stress x pixel area. S2F predicts magnitude only (no direction).")
229
+ y -= 20
230
+
231
+ c.setFont("Helvetica-Bold", 10)
232
+ c.drawString(margin, y, "Parameters (for reproducibility)")
233
+ y -= 14
234
+ c.setFont("Helvetica", 8)
235
+ for lab, val in info_rows(info):
236
+ c.drawString(margin, y, f"{lab}:")
237
+ for line in textwrap.wrap(str(val), 82) or ["–"]:
238
+ c.drawString(margin + 175, y, line)
239
+ y -= 11
240
+ if y < 70:
241
+ c.showPage(); _draw_pdf_footer(c, margin=margin, include_web_app=True); y = page_h_pt - 60; c.setFont("Helvetica", 8)
242
+
243
+
244
+ def create_pdf_report(img, display_heatmap, raw_heatmap, base_name, colormap_name="Jet", cell_mask=None,
245
+ metrics_full=None, metrics_cell=None, info=None, scale=None, clip_min=0.0, clip_max=1.0):
246
+ """
247
+ PDF report: bright field and predicted traction-stress map (with µm scale bar and Pa colourbar),
248
+ metrics with units, and every parameter needed to reproduce the prediction (Reviewer 1).
249
+ """
250
+ buf = io.BytesIO()
251
+ c = canvas.Canvas(buf, pagesize=A4)
252
+ c.setTitle("Shape2Force prediction report")
253
+ c.setAuthor("Angione-Lab")
254
+ _draw_prediction_page(c, img, display_heatmap, raw_heatmap, base_name, colormap_name, cell_mask,
255
+ metrics_full, metrics_cell, info, scale, clip_min, clip_max)
256
+ c.save()
257
+ buf.seek(0)
258
+ return buf.getvalue()
259
+
260
+
261
+ _SHARED_KEYS = ("Model type", "Architecture", "Checkpoint", "Checkpoint SHA-256", "Substrate setting (preset)",
262
+ "Substrate setting (manual)", " pixel-size setting / Young's modulus",
263
+ " model input channels (normalised)", "Image pixel size", "Stress scale", "Display", "Measure force region only",
264
+ "App version")
265
 
266
+
267
+ def create_batch_pdf_report(items, colormap_name="Jet", clip_min=0.0, clip_max=1.0, auto_cell_boundary=False):
268
+ """
269
+ Batch PDF: page 1 = summary table of all images (metrics with units) and the shared parameters;
270
+ then one page per image with the same layout as the single-image report.
271
+ items: list of dicts with img, display_heatmap, raw_heatmap, base_name, cell_mask, metrics_full,
272
+ metrics_cell, info, scale.
273
+ """
274
+ from utils.units import fmt
275
+ buf = io.BytesIO()
276
+ c = canvas.Canvas(buf, pagesize=A4)
277
+ c.setTitle("Shape2Force batch report")
278
+ c.setAuthor("Angione-Lab")
279
+ page_w_pt, page_h_pt = A4
280
+ margin = 60
281
+ _draw_pdf_footer(c, margin=margin, include_web_app=True)
282
+ y = page_h_pt - 50
283
+ c.setFont("Helvetica-Bold", 15)
284
+ c.drawString(margin, y, "Shape2Force (S2F) - Batch Report")
285
+ y -= 16
286
+ c.setFont("Helvetica", 10)
287
+ region = "force region (red contour)" if auto_cell_boundary else "whole field of view"
288
+ c.drawString(margin, y, f"{len(items)} images; metrics over the {region}. One page per image follows.")
289
+ y -= 26
290
+ headers = ["#", "Image", "Mean stress (Pa)", "Max stress (Pa)", "Area (µm²)", "Total force (nN)"]
291
+ xs = [margin, margin + 22, margin + 210, margin + 290, margin + 370, margin + 440]
292
+ c.setFont("Helvetica-Bold", 9)
293
+ for x, h in zip(xs, headers):
294
+ c.drawString(x, y, h)
295
+ y -= 4
296
+ c.line(margin, y, page_w_pt - margin, y)
297
+ y -= 12
298
+ c.setFont("Helvetica", 9)
299
+ for i, it in enumerate(items, 1):
300
+ m = (it["metrics_cell"] if (auto_cell_boundary and it.get("metrics_cell")) else it["metrics_full"]) or {}
301
+ vals = [str(i), it["base_name"][:34], fmt(m.get("mean_pa"), nd=1), fmt(m.get("max_pa"), nd=1),
302
+ fmt(m.get("area_um2"), nd=0), fmt(m.get("total_force_nN"), nd=2)]
303
+ for x, v in zip(xs, vals):
304
+ c.drawString(x, y, v)
305
+ y -= 13
306
+ y -= 18
307
+ c.setFont("Helvetica-Bold", 10)
308
+ c.drawString(margin, y, "Parameters (shared by all images)")
309
+ y -= 14
310
+ c.setFont("Helvetica", 8)
311
+ for lab, val in info_rows(items[0]["info"] if items else None):
312
+ if lab in _SHARED_KEYS:
313
+ c.drawString(margin, y, f"{lab}:")
314
+ for line in textwrap.wrap(str(val), 82) or ["–"]:
315
+ c.drawString(margin + 175, y, line)
316
+ y -= 11
317
+ c.showPage()
318
+ for i, it in enumerate(items, 1):
319
+ _draw_prediction_page(c, it["img"], it["display_heatmap"], it["raw_heatmap"], it["base_name"], colormap_name,
320
+ it.get("cell_mask"), it["metrics_full"], it.get("metrics_cell"), it["info"], it["scale"],
321
+ clip_min, clip_max, page_label=f"image {i} of {len(items)}")
322
+ c.showPage()
323
  c.save()
324
  buf.seek(0)
325
  return buf.getvalue()
 
365
  Image.fromarray(heatmap_labeled_rgb).save(hm_labeled_buf, format="PNG")
366
  hm_labeled_buf.seek(0)
367
  c.drawImage(ImageReader(hm_labeled_buf), hm_x, img_bottom, width=img_w, height=img_h, preserveAspectRatio=True)
368
+ hm_label_w = c.stringWidth("Traction stress map", "Helvetica", 9)
369
+ c.drawString(hm_x + (img_w - hm_label_w) / 2, img_bottom - 14, "Traction stress map")
370
 
371
  # Spacing: one line between images/labels and measurements section
372
  row_height = 14
S2FApp/utils/substrate_settings.py CHANGED
@@ -114,21 +114,8 @@ def compute_settings_normalization(config=None, config_path=None):
114
  Returns:
115
  dict: {'pixelsize': {'min', 'max'}, 'young': {'min', 'max'}}
116
  """
117
- if config is None:
118
- config = load_substrate_config(config_path)
119
-
120
- substrates = config.get('substrates', {})
121
- all_pixelsizes = [s['pixelsize'] for s in substrates.values()]
122
- all_youngs = [s['young'] for s in substrates.values()]
123
-
124
- if not all_pixelsizes or not all_youngs:
125
- pixelsize_min, pixelsize_max = 3.0769, 9.8138
126
- young_min, young_max = 1000.0, 10000.0
127
- else:
128
- pixelsize_min, pixelsize_max = min(all_pixelsizes), max(all_pixelsizes)
129
- young_min, young_max = min(all_youngs), max(all_youngs)
130
-
131
- return {
132
- 'pixelsize': {'min': pixelsize_min, 'max': pixelsize_max},
133
- 'young': {'min': young_min, 'max': young_max}
134
- }
 
114
  Returns:
115
  dict: {'pixelsize': {'min', 'max'}, 'young': {'min', 'max'}}
116
  """
117
+ # The ranges must be those used in training (pixel size 3.0769-9.8138, Young's modulus 1-10 kPa),
118
+ # not the min/max of the presets listed by the app: previously the app normalised the pixel size over
119
+ # its own presets (3.0769-6.1538), which gave a different input for any pixel size other than 3.0769.
120
+ from config.constants import SETTINGS_NORMALIZATION
121
+ return {k: dict(v) for k, v in SETTINGS_NORMALIZATION.items()}
 
 
 
 
 
 
 
 
 
 
 
 
 
S2FApp/utils/units.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Physical units for S2F predictions.
3
+
4
+ The network output is a normalised map y_hat in [0, 1]. The ground-truth traction-stress maps used for
5
+ training were exported by the TFM software on a fixed colour scale, so
6
+
7
+ traction stress T [Pa] = y_hat * STRESS_MAX_PA[model_type] (500 Pa single cells, 50 Pa spheroids).
8
+
9
+ Areas and forces additionally need the pixel size of the bright-field image (µm per pixel, entered by the
10
+ user). The prediction is made on a MODEL_INPUT_SIZE x MODEL_INPUT_SIZE grid, so one heatmap pixel covers
11
+ (image width * pixel size / MODEL_INPUT_SIZE) µm in x, and likewise in y.
12
+
13
+ area [µm²] = number of pixels * heatmap pixel area
14
+ force [nN] = sum(T [Pa] * heatmap pixel area [µm²]) * 1e-3 (1 Pa · µm² = 1e-12 N = 1e-3 nN)
15
+ """
16
+ import numpy as np
17
+
18
+ from config.constants import MODEL_INPUT_SIZE, STRESS_MAX_PA
19
+
20
+
21
+ def stress_max_pa(model_type):
22
+ return STRESS_MAX_PA["spheroid" if model_type == "spheroid" else "single_cell"]
23
+
24
+
25
+ def make_scale(model_type, image_um_per_px=None, image_shape=None, heatmap_shape=(MODEL_INPUT_SIZE, MODEL_INPUT_SIZE)):
26
+ """
27
+ Physical scale of one prediction.
28
+
29
+ image_um_per_px: pixel size of the uploaded bright-field image (µm/px); None or <= 0 if unknown.
30
+ image_shape: (height, width) of the uploaded image, before resizing to the model input.
31
+ Returns a dict used by the display, report and measurement code.
32
+ """
33
+ smax = stress_max_pa(model_type)
34
+ s = {"stress_max_pa": smax, "image_um_per_px": None, "image_shape": None,
35
+ "hm_um_per_px_x": None, "hm_um_per_px_y": None, "hm_px_area_um2": None}
36
+ if image_shape is not None:
37
+ s["image_shape"] = (int(image_shape[0]), int(image_shape[1]))
38
+ if image_um_per_px and image_um_per_px > 0 and image_shape is not None:
39
+ h, w = image_shape[:2]
40
+ hh, hw = heatmap_shape[:2]
41
+ sx = image_um_per_px * w / hw
42
+ sy = image_um_per_px * h / hh
43
+ s.update(image_um_per_px=float(image_um_per_px), hm_um_per_px_x=sx, hm_um_per_px_y=sy, hm_px_area_um2=sx * sy)
44
+ return s
45
+
46
+
47
+ def has_physical_size(scale):
48
+ return scale is not None and scale.get("hm_px_area_um2") is not None
49
+
50
+
51
+ def to_pa(heatmap, scale):
52
+ """Normalised map -> traction stress in Pa."""
53
+ return np.clip(np.asarray(heatmap, dtype=np.float64), 0, 1) * scale["stress_max_pa"]
54
+
55
+
56
+ def region_metrics(heatmap, mask, scale):
57
+ """
58
+ Metrics over a region (mask = 1) or the whole map (mask = None).
59
+ Keys: n_px, area_um2, mean_pa, max_pa, total_force_nN (area and force are None without a pixel size).
60
+ """
61
+ t = to_pa(heatmap, scale)
62
+ m = np.ones(t.shape, dtype=bool) if mask is None else (np.asarray(mask) > 0)
63
+ n = int(m.sum())
64
+ if n == 0:
65
+ return {"n_px": 0, "area_um2": None, "mean_pa": None, "max_pa": None, "total_force_nN": None}
66
+ vals = t[m]
67
+ out = {"n_px": n, "mean_pa": float(vals.mean()), "max_pa": float(vals.max()), "area_um2": None, "total_force_nN": None}
68
+ if has_physical_size(scale):
69
+ a = scale["hm_px_area_um2"]
70
+ out["area_um2"] = n * a
71
+ out["total_force_nN"] = float(vals.sum()) * a * 1e-3
72
+ return out
73
+
74
+
75
+ def fmt(value, unit="", nd=1):
76
+ """Format a metric value; '–' when not available."""
77
+ if value is None:
78
+ return "–"
79
+ return f"{value:.{nd}f}{(' ' + unit) if unit else ''}"
80
+
81
+
82
+ def metric_rows(metrics):
83
+ """(label, formatted value) pairs, in the order used everywhere in the app."""
84
+ return [
85
+ ("Mean traction stress", fmt(metrics.get("mean_pa"), "Pa")),
86
+ ("Max traction stress", fmt(metrics.get("max_pa"), "Pa")),
87
+ ("Area", fmt(metrics.get("area_um2"), "µm²", 0)),
88
+ ("Total force", fmt(metrics.get("total_force_nN"), "nN", 2)),
89
+ ]
90
+
91
+
92
+ def nice_scale_bar_um(field_width_um, fraction=0.2):
93
+ """Scale-bar length (µm) from {1, 2, 5} x 10^k closest to `fraction` of the field width."""
94
+ target = field_width_um * fraction
95
+ if target <= 0:
96
+ return None
97
+ k = np.floor(np.log10(target))
98
+ candidates = [m * 10 ** k for m in (1, 2, 5, 10)]
99
+ return float(min(candidates, key=lambda c: abs(c - target)))
100
+
101
+
102
+ def draw_scale_bar(rgb, um_per_px, color=(255, 255, 255), margin_frac=0.04):
103
+ """Draw a µm scale bar (bottom right) on an RGB uint8 image in place. Returns (rgb, length_um)."""
104
+ import cv2
105
+
106
+ if not um_per_px or um_per_px <= 0:
107
+ return rgb, None
108
+ h, w = rgb.shape[:2]
109
+ length_um = nice_scale_bar_um(w * um_per_px)
110
+ if length_um is None:
111
+ return rgb, None
112
+ length_px = int(round(length_um / um_per_px))
113
+ thick = max(2, h // 120)
114
+ m = int(margin_frac * w)
115
+ x1, y = w - m, h - m
116
+ x0 = x1 - length_px
117
+ cv2.rectangle(rgb, (x0 - 1, y - thick - 1), (x1 + 1, y + 1), (0, 0, 0), -1)
118
+ cv2.rectangle(rgb, (x0, y - thick), (x1, y), color, -1)
119
+ label = f"{length_um:g} um" # OpenCV fonts have no µ glyph
120
+ font_scale = max(0.4, w / 1100)
121
+ (tw, th), _ = cv2.getTextSize(label, cv2.FONT_HERSHEY_SIMPLEX, font_scale, max(1, thick // 2))
122
+ tx, ty = x0 + (length_px - tw) // 2, y - thick - 6
123
+ cv2.putText(rgb, label, (tx, ty), cv2.FONT_HERSHEY_SIMPLEX, font_scale, (0, 0, 0), max(2, thick), cv2.LINE_AA)
124
+ cv2.putText(rgb, label, (tx, ty), cv2.FONT_HERSHEY_SIMPLEX, font_scale, color, max(1, thick // 2), cv2.LINE_AA)
125
+ return rgb, length_um
experiments/results/dataset_audit/report.txt CHANGED
@@ -1,86 +1,86 @@
1
- legacy root : C:/Users/Kaveh/Documents/cellforce/dataset
2
- dataset root: C:\Users\Kaveh\Documents\Shape2Force\dataset
3
-
4
- legacy all_tune/train n= 280
5
- legacy all_tune/test n= 81
6
- legacy fibro_split/train n= 236
7
- legacy fibro_split/test n= 46
8
- legacy 1kpa_new/train n= 16
9
- legacy 1kpa_new/test n= 15
10
- legacy 10kpa_new/train n= 28
11
- legacy 10kpa_new/test n= 20
12
- legacy 1kPa_SET_III n= 17
13
- legacy DMSO_SET_II n= 11
14
- legacy Y27632_SET_II n= 20
15
- legacy Control_SET_I n= 27
16
- legacy Fibronectin_SET_I n= 40
17
- legacy TGFB_SET_I n= 15
18
- legacy Y27632_SET_I n= 16
19
- legacy U2OS/test n= 39
20
- legacy Drugs/all n= 98
21
- legacy spheroid/train n= 129
22
- legacy spheroid/test n= 28
23
- repository singlecell/train n= 236
24
- repository singlecell/test n= 46
25
- repository spheroid/train n= 129
26
- repository spheroid/test n= 28
27
-
28
- Folders with samples in the legacy tree that are NOT listed in experiments/layout.py:
29
- single_cell\01kPa\train (30 samples)
30
- single_cell\10kPa\train (30 samples)
31
- single_cell\10kpa_new\all (48 samples)
32
- single_cell\1kpa_new\all (31 samples)
33
- single_cell\ds\10kpa (20 samples)
34
- single_cell\ds\1kpa (15 samples)
35
- single_cell\ds\u2os (39 samples)
36
- single_cell\fibros\test (59 samples)
37
- single_cell\fibros\train (223 samples)
38
- single_cell\u2os\train (12 samples)
39
- single_cell\U2OS_best_images\test (8 samples)
40
- single_cell\U2OS_best_images\train (23 samples)
41
-
42
- Repository dataset vs legacy:
43
- singlecell/train vs fibro_split/train : shared 236, only repo 0, only legacy 0
44
- singlecell/test vs fibro_split/test : shared 46, only repo 0, only legacy 0
45
- spheroid/train vs spheroid/train : shared 128, only repo 0, only legacy 0
46
- spheroid/test vs spheroid/test : shared 28, only repo 0, only legacy 0
47
-
48
- all_tune composition (split x source set):
49
- train 10kpa_new/train 28
50
- train 1kpa_new/train 16
51
- train fibro_split/train 236
52
- val 10kpa_new/test 20
53
- val 1kpa_new/test 15
54
- val fibro_split/test 46
55
-
56
- all_tune images NOT in the repository dataset (Zenodo v1): 79
57
- train 10kpa_new/train 28
58
- train 1kpa_new/train 16
59
- val 10kpa_new/test 20
60
- val 1kpa_new/test 15
61
-
62
- Substrate code the original code fed for all_tune folders (folder_name[:4]):
63
- train 'Posi' -> fibroblasts_PDMS 236
64
- train 'kpan0' -> PDMS_1kPa_3um 16
65
- train 'kpan1' -> PDMS_10kPa_3um 28
66
- val 'Posi' -> fibroblasts_PDMS 46
67
- val 'kpan0' -> PDMS_1kPa_3um 15
68
- val 'kpan1' -> PDMS_10kPa_3um 20
69
-
70
- Leakage check - independent test sets vs all_tune train+val (must be 0):
71
- 1kPa_SET_III 0 (of 17)
72
- DMSO_SET_II 0 (of 11)
73
- Y27632_SET_II 0 (of 20)
74
- Control_SET_I 0 (of 27)
75
- Fibronectin_SET_I 0 (of 40)
76
- TGFB_SET_I 0 (of 15)
77
- Y27632_SET_I 0 (of 16)
78
- U2OS/test 0 (of 39)
79
- Validation-set content - legacy 'test' folders inside all_tune/test (val):
80
- fibro_split/test 46 of 46 in val; 0 in train
81
- 1kpa_new/test 15 of 15 in val; 0 in train
82
- 10kpa_new/test 20 of 20 in val; 0 in train
83
-
84
- Copying and writing manifests ...
85
- sample folders: {'copied': 264}
86
  manifests written to experiments/splits/ - commit them to git
 
1
+ legacy root : C:/Users/Kaveh/Documents/cellforce/dataset
2
+ dataset root: C:\Users\Kaveh\Documents\Shape2Force\dataset
3
+
4
+ legacy all_tune/train n= 280
5
+ legacy all_tune/test n= 81
6
+ legacy fibro_split/train n= 236
7
+ legacy fibro_split/test n= 46
8
+ legacy 1kpa_new/train n= 16
9
+ legacy 1kpa_new/test n= 15
10
+ legacy 10kpa_new/train n= 28
11
+ legacy 10kpa_new/test n= 20
12
+ legacy 1kPa_SET_III n= 17
13
+ legacy DMSO_SET_II n= 11
14
+ legacy Y27632_SET_II n= 20
15
+ legacy Control_SET_I n= 27
16
+ legacy Fibronectin_SET_I n= 40
17
+ legacy TGFB_SET_I n= 15
18
+ legacy Y27632_SET_I n= 16
19
+ legacy U2OS/test n= 39
20
+ legacy Drugs/all n= 98
21
+ legacy spheroid/train n= 129
22
+ legacy spheroid/test n= 28
23
+ repository singlecell/train n= 236
24
+ repository singlecell/test n= 46
25
+ repository spheroid/train n= 129
26
+ repository spheroid/test n= 28
27
+
28
+ Folders with samples in the legacy tree that are NOT listed in experiments/layout.py:
29
+ single_cell\01kPa\train (30 samples)
30
+ single_cell\10kPa\train (30 samples)
31
+ single_cell\10kpa_new\all (48 samples)
32
+ single_cell\1kpa_new\all (31 samples)
33
+ single_cell\ds\10kpa (20 samples)
34
+ single_cell\ds\1kpa (15 samples)
35
+ single_cell\ds\u2os (39 samples)
36
+ single_cell\fibros\test (59 samples)
37
+ single_cell\fibros\train (223 samples)
38
+ single_cell\u2os\train (12 samples)
39
+ single_cell\U2OS_best_images\test (8 samples)
40
+ single_cell\U2OS_best_images\train (23 samples)
41
+
42
+ Repository dataset vs legacy:
43
+ singlecell/train vs fibro_split/train : shared 236, only repo 0, only legacy 0
44
+ singlecell/test vs fibro_split/test : shared 46, only repo 0, only legacy 0
45
+ spheroid/train vs spheroid/train : shared 128, only repo 0, only legacy 0
46
+ spheroid/test vs spheroid/test : shared 28, only repo 0, only legacy 0
47
+
48
+ all_tune composition (split x source set):
49
+ train 10kpa_new/train 28
50
+ train 1kpa_new/train 16
51
+ train fibro_split/train 236
52
+ val 10kpa_new/test 20
53
+ val 1kpa_new/test 15
54
+ val fibro_split/test 46
55
+
56
+ all_tune images NOT in the repository dataset (Zenodo v1): 79
57
+ train 10kpa_new/train 28
58
+ train 1kpa_new/train 16
59
+ val 10kpa_new/test 20
60
+ val 1kpa_new/test 15
61
+
62
+ Substrate code the original code fed for all_tune folders (folder_name[:4]):
63
+ train 'Posi' -> fibroblasts_PDMS 236
64
+ train 'kpan0' -> PDMS_1kPa_3um 16
65
+ train 'kpan1' -> PDMS_10kPa_3um 28
66
+ val 'Posi' -> fibroblasts_PDMS 46
67
+ val 'kpan0' -> PDMS_1kPa_3um 15
68
+ val 'kpan1' -> PDMS_10kPa_3um 20
69
+
70
+ Leakage check - independent test sets vs all_tune train+val (must be 0):
71
+ 1kPa_SET_III 0 (of 17)
72
+ DMSO_SET_II 0 (of 11)
73
+ Y27632_SET_II 0 (of 20)
74
+ Control_SET_I 0 (of 27)
75
+ Fibronectin_SET_I 0 (of 40)
76
+ TGFB_SET_I 0 (of 15)
77
+ Y27632_SET_I 0 (of 16)
78
+ U2OS/test 0 (of 39)
79
+ Validation-set content - legacy 'test' folders inside all_tune/test (val):
80
+ fibro_split/test 46 of 46 in val; 0 in train
81
+ 1kpa_new/test 15 of 15 in val; 0 in train
82
+ 10kpa_new/test 20 of 20 in val; 0 in train
83
+
84
+ Copying and writing manifests ...
85
+ sample folders: {'copied': 264}
86
  manifests written to experiments/splits/ - commit them to git
experiments/results/eval/model_params.csv CHANGED
@@ -21,3 +21,21 @@ released_singlecell,77.002341,,
21
  released_spheroid_GN,77.000613,,
22
  supervised_spheroid_FN,11.783428,,
23
  stage1_image_only,77.000613,,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  released_spheroid_GN,77.000613,,
22
  supervised_spheroid_FN,11.783428,,
23
  stage1_image_only,77.000613,,
24
+ s2f_full_seed0,77.002341,22.0,0.6845365777248289
25
+ s2f_full_seed1,77.002341,32.0,0.7641608729595091
26
+ s2f_no_force_seed0,77.002341,36.0,0.6944503726028814
27
+ s2f_no_force_seed1,77.002341,31.0,0.7536247052797457
28
+ s2f_no_gan_seed0,77.002341,21.0,0.721968437113413
29
+ s2f_no_gan_seed1,77.002341,34.0,0.7040372549033747
30
+ s2f_no_substrate_no_gan_seed0,77.000613,25.0,0.598808929687593
31
+ s2f_no_substrate_no_gan_seed1,77.000613,38.0,0.6280873359703436
32
+ s2f_no_substrate_seed0,77.000613,23.0,0.6303678663765512
33
+ s2f_no_substrate_seed1,77.000613,17.0,0.6032634014036597
34
+ unet_gan_no_substrate_seed0,31.036481,21.0,0.6770522376386131
35
+ unet_gan_no_substrate_seed1,31.036481,1.0,0.6818016338639143
36
+ unet_gan_seed0,31.037633,18.0,0.7331220245942837
37
+ unet_gan_seed1,31.037633,24.0,0.8099774224002186
38
+ unet_no_substrate_seed0,31.036481,12.0,0.646111976809618
39
+ unet_no_substrate_seed1,31.036481,29.0,0.6637544072255855
40
+ unet_seed0,31.037633,21.0,0.7371067419284727
41
+ unet_seed1,31.037633,31.0,0.7615440138956395
experiments/results/eval/per_image.csv CHANGED
The diff for this file is too large to render. See raw diff
 
experiments/results/eval/summary.csv CHANGED
@@ -1,4 +1,5 @@
1
  model,manifest,substrate_mode,n,mse_mean,mse_std,ms_ssim_mean,ms_ssim_std,pixel_r_mean,pixel_r_std,rme_mean,rme_std,mean_gt_Pa_mean,mean_gt_Pa_std,mean_pred_Pa_mean,mean_pred_Pa_std,gt_frac_saturated_mean,gt_frac_saturated_std,seconds_per_image,pred_over_gt
 
2
  baseline_mean_map_singlecell,alltune_val,n/a,81,0.008867533338532128,0.008444125467759028,0.861701829197966,0.03590680370840415,0.41052920249821545,0.15954584047698242,1.1574280416523968,0.6312656594344455,24.59675819831498,12.090901586067531,30.23826703429222,0.0,0.002138373292522666,0.0035866755817526457,0.00027169710324134353,1.2293598526477247
3
  baseline_mean_map_singlecell,test_fibro_1kPa_setIII,n/a,17,0.0029763451928053707,0.002273231475613402,0.9033869399743921,0.018725796216798568,0.15721677869894365,0.17783678834177372,0.7348172664642334,0.16726677632791806,24.97328571317827,9.45682709856301,30.23826703429222,0.0,0.0,0.0,0.0002941243788775276,1.2108245339272936
4
  baseline_mean_map_singlecell,test_fibro_DMSO_setI,n/a,27,0.007250574865826854,0.0056551406664407024,0.8667675676169219,0.030754783101293082,0.4275686668425483,0.1584578635982929,1.1128620902697246,0.38763939451523194,22.690155784840936,9.653348226275018,30.23826703429222,0.0,0.0011002929122359663,0.0017828783273705945,0.00018522474500868056,1.3326601774366882
@@ -251,4 +252,258 @@ unet_seed1,test_fibro_Y27632_setI,legacy,16,0.0023576642997795313,0.003468691247
251
  unet_seed1,test_fibro_Y27632_setII,legacy,20,0.002529909049917425,0.0017941052399756178,0.9199862539768219,0.02635293299150093,0.5905185210696995,0.16741241180482025,0.5762535378336906,0.10192889207166421,17.667164374142885,4.5439277959248345,14.190186373889446,1.9763815197320727,5.369186401366938e-05,0.00016632603301397394,0.00104012489318844,0.8031954689150775
252
  unet_seed1,test_fibro_fibronectin_setI,legacy,40,0.0032456214888952153,0.003434821068665475,0.9198339089751244,0.039578591081581765,0.6018064859264587,0.18237442519641475,0.5458972863852978,0.12961089049850422,18.936000810936093,6.403141493803271,12.861821136903018,1.9595425563856077,0.000261020660400378,0.0006666419848302162,0.001111567020416215,0.6792258442170609
253
  unet_seed1,test_u2os_6kPa,legacy,39,0.025203555308950968,0.019440022684129716,0.6127494802841773,0.09033921807495938,0.25941772816773057,0.13315477293143968,0.7514002399566846,0.053234500789584506,72.38253683615953,22.514049794991656,22.496219963217392,6.844349169425874,0.0023382871578900974,0.004895436215126899,0.0011056447640443103,0.31079623548064356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  unet_seed1,zenodo_v1_test,legacy,46,0.00936730446688745,0.009806955208855243,0.8826427161693573,0.044340123170899685,0.6504549501304828,0.1254012605447015,0.7062365594117538,0.16269038125151805,26.68617501773912,13.512588866281218,15.705596453145795,2.228080111054024,0.002364386682924989,0.003851346753000209,0.0011378837668376955,0.5885293206203512
 
1
  model,manifest,substrate_mode,n,mse_mean,mse_std,ms_ssim_mean,ms_ssim_std,pixel_r_mean,pixel_r_std,rme_mean,rme_std,mean_gt_Pa_mean,mean_gt_Pa_std,mean_pred_Pa_mean,mean_pred_Pa_std,gt_frac_saturated_mean,gt_frac_saturated_std,seconds_per_image,pred_over_gt
2
+ <<<<<<< HEAD
3
  baseline_mean_map_singlecell,alltune_val,n/a,81,0.008867533338532128,0.008444125467759028,0.861701829197966,0.03590680370840415,0.41052920249821545,0.15954584047698242,1.1574280416523968,0.6312656594344455,24.59675819831498,12.090901586067531,30.23826703429222,0.0,0.002138373292522666,0.0035866755817526457,0.00027169710324134353,1.2293598526477247
4
  baseline_mean_map_singlecell,test_fibro_1kPa_setIII,n/a,17,0.0029763451928053707,0.002273231475613402,0.9033869399743921,0.018725796216798568,0.15721677869894365,0.17783678834177372,0.7348172664642334,0.16726677632791806,24.97328571317827,9.45682709856301,30.23826703429222,0.0,0.0,0.0,0.0002941243788775276,1.2108245339272936
5
  baseline_mean_map_singlecell,test_fibro_DMSO_setI,n/a,27,0.007250574865826854,0.0056551406664407024,0.8667675676169219,0.030754783101293082,0.4275686668425483,0.1584578635982929,1.1128620902697246,0.38763939451523194,22.690155784840936,9.653348226275018,30.23826703429222,0.0,0.0011002929122359663,0.0017828783273705945,0.00018522474500868056,1.3326601774366882
 
252
  unet_seed1,test_fibro_Y27632_setII,legacy,20,0.002529909049917425,0.0017941052399756178,0.9199862539768219,0.02635293299150093,0.5905185210696995,0.16741241180482025,0.5762535378336906,0.10192889207166421,17.667164374142885,4.5439277959248345,14.190186373889446,1.9763815197320727,5.369186401366938e-05,0.00016632603301397394,0.00104012489318844,0.8031954689150775
253
  unet_seed1,test_fibro_fibronectin_setI,legacy,40,0.0032456214888952153,0.003434821068665475,0.9198339089751244,0.039578591081581765,0.6018064859264587,0.18237442519641475,0.5458972863852978,0.12961089049850422,18.936000810936093,6.403141493803271,12.861821136903018,1.9595425563856077,0.000261020660400378,0.0006666419848302162,0.001111567020416215,0.6792258442170609
254
  unet_seed1,test_u2os_6kPa,legacy,39,0.025203555308950968,0.019440022684129716,0.6127494802841773,0.09033921807495938,0.25941772816773057,0.13315477293143968,0.7514002399566846,0.053234500789584506,72.38253683615953,22.514049794991656,22.496219963217392,6.844349169425874,0.0023382871578900974,0.004895436215126899,0.0011056447640443103,0.31079623548064356
255
+ =======
256
+ baseline_mean_map_singlecell,alltune_val,none,81,0.008867533338532078,0.008444125467759031,0.861701829197966,0.035906803708404156,0.41052920249821545,0.15954584047698242,1.1574280416523968,0.6312656594344455,24.59675819831498,12.09090158606753,30.23826703429222,0.0,0.002138373292522645,0.003586675581752635,0.0002839241498782049,1.2293598526477247
257
+ baseline_mean_map_singlecell,test_fibro_1kPa_setIII,none,17,0.0029763451928053178,0.002273231475613394,0.9033869399743921,0.01872579621679855,0.15721677869894363,0.1778367883417737,0.7348172664642334,0.16726677632791806,24.97328571317827,9.45682709856301,30.23826703429222,0.0,0.0,0.0,0.00023510876823872352,1.2108245339272936
258
+ baseline_mean_map_singlecell,test_fibro_DMSO_setI,none,27,0.007250574865826808,0.005655140666440696,0.8667675676169219,0.030754783101293093,0.4275686668425483,0.1584578635982929,1.1128620902697246,0.38763939451523194,22.690155784840936,9.65334822627502,30.23826703429222,0.0,0.0011002929122359444,0.0017828783273705856,0.0002962748209635148,1.3326601774366882
259
+ baseline_mean_map_singlecell,test_fibro_DMSO_setII,none,11,0.00831751061857419,0.004066069829535421,0.8644076152281328,0.023882051903673766,0.4553565803125727,0.11754389518444104,0.9131677530028603,0.25543760128001425,26.922392574223604,8.656309600517519,30.23826703429222,0.0,0.0009989304976029546,0.001193270015423396,0.0003632848913019,1.1231641820438851
260
+ baseline_mean_map_singlecell,test_fibro_TGFb_setI,none,15,0.006642159353941627,0.004179202220937179,0.8808432022730509,0.03635780990001607,0.42441162333826304,0.13737702161098117,0.8917144099871318,0.26151822324254964,24.50147196650505,8.277265561301698,30.23826703429222,0.0,0.0006481806437174341,0.0010562970743840123,0.00026659965515134665,1.234140833482564
261
+ baseline_mean_map_singlecell,test_fibro_Y27632_setI,none,16,0.0027625715883913874,0.0020101212249706043,0.916701827198267,0.030305677143512625,0.1283631369458813,0.3517464964374425,1.0871064886450768,0.347565883708035,17.703224846627563,7.054585229165719,30.23826703429222,0.0,2.723932266235e-05,0.00010895729064939998,0.0002498179674148375,1.7080654680863168
262
+ baseline_mean_map_singlecell,test_fibro_Y27632_setII,none,20,0.00375629758927966,0.0013271293894633216,0.8806707769632339,0.020034838710382145,0.351722834949619,0.1725485946521341,1.2468893110752106,0.40122543062040655,17.667164374142885,4.5439277959248345,30.23826703429222,0.0,5.369186401366938e-05,0.00016632603301397394,0.00019977092742919002,1.7115518027640029
263
+ baseline_mean_map_singlecell,test_fibro_fibronectin_setI,none,40,0.004328202983015167,0.0026058117483265825,0.8877401858568191,0.03071873671872164,0.34129742266076474,0.15830508725003353,1.160378596186638,0.39441685439924384,18.936000810936093,6.40314149380327,30.23826703429222,0.0,0.000261020660400378,0.0006666419848302161,0.00042519569396968994,1.5968665895297565
264
+ baseline_mean_map_singlecell,test_u2os_6kPa,none,39,0.023353071668400165,0.019600009418594844,0.6609806311436188,0.0978677352863591,0.10235863128030824,0.21212837305069873,0.6504532175186353,0.07018370277857451,72.38253683615953,22.514049794991656,30.23826703429222,0.0,0.0023382871578900974,0.004895436215126899,0.0002820736322647231,0.4177563864988267
265
+ baseline_mean_map_singlecell,zenodo_v1_test,none,46,0.010858457322920744,0.00941945224431643,0.8455757550571276,0.03406540423851008,0.41372033484868764,0.1555153449812471,1.1657370238200477,0.6015145465584982,26.68617501773912,13.512588866281218,30.23826703429222,0.0,0.002364386682924989,0.003851346753000209,0.0002834382264510174,1.1331060751191175
266
+ baseline_mean_map_spheroid,spheroid_val,none,28,0.027976330236664793,0.014528724392337364,0.7048353616680417,0.051552649696741684,0.7176645297339144,0.14472140836516853,0.655622341803142,0.15465517165849352,8.515775283532482,2.206210863837729,8.358367532491684,0.0,0.008846793855939564,0.015233062860168744,0.00046428612300324995,0.9815157462709017
267
+ released_singlecell,alltune_val,force:PDMS_10kPa_3um,81,0.007545587585888246,0.008507425463869709,0.8884899123215381,0.05000694856832291,0.6237244584855848,0.16339708361712366,0.7052937749727273,0.27113071444515685,24.59675819831498,12.09090158606753,15.46034066259493,5.385866765007075,0.002138373292522645,0.003586675581752635,0.004702659300815862,0.6285519635532317
268
+ released_singlecell,alltune_val,force:PDMS_1kPa_3um,81,0.010979281774690363,0.011246080494480391,0.8668595868864177,0.051662194522751864,0.4394264137559907,0.13403530149588735,0.8060790064894123,0.06708196531526374,24.59675819831498,12.09090158606753,5.252839103456081,0.9046273566726863,0.002138373292522645,0.003586675581752635,0.004662905210330115,0.21355818767271253
269
+ released_singlecell,alltune_val,force:fibroblasts_PDMS,81,0.005426040599783715,0.005180135655613061,0.8985199037893319,0.03873273415698192,0.7084352367281203,0.1194668760478512,0.6202270922101574,0.11796703485782545,24.59675819831498,12.09090158606753,16.66061681361846,6.203331391984003,0.002138373292522645,0.003586675581752635,0.004731072319878412,0.6773501076560491
270
+ released_singlecell,alltune_val,legacy,81,0.005725407185691166,0.005913059640153002,0.9004106028580371,0.04227056120690708,0.6762733289966605,0.16848738931664667,0.6151467293132971,0.10571139673403421,24.59675819831498,12.09090158606753,15.188794456606294,7.324156570890529,0.002138373292522645,0.003586675581752635,0.013400086650141915,0.617512045048555
271
+ released_singlecell,alltune_val,nominal,81,0.005725407185691166,0.005913059640153002,0.9004106028580371,0.04227056120690708,0.6762733289966605,0.16848738931664667,0.6151467293132971,0.10571139673403421,24.59675819831498,12.09090158606753,15.188794456606294,7.324156570890529,0.002138373292522645,0.003586675581752635,0.004713473496613625,0.617512045048555
272
+ released_singlecell,test_fibro_1kPa_setIII,force:PDMS_10kPa_3um,17,0.002826374291223153,0.0035523884368522042,0.8677554200677311,0.07565692186455636,0.47584658916802086,0.24810251885087475,0.6553968717070187,0.17111341798378937,24.97328571317827,9.45682709856301,13.823409153915504,7.3818863359958335,0.0,0.0,0.004789829254150335,0.5535278502268112
273
+ released_singlecell,test_fibro_1kPa_setIII,force:PDMS_1kPa_3um,17,0.003904879147953788,0.003861519045550532,0.8491565304643968,0.037116968675901085,0.2755562877348061,0.20609273383371862,0.7847661270814783,0.055701512845592646,24.97328571317827,9.45682709856301,5.227098351015764,1.1178458797738569,0.0,0.0,0.004942599464865223,0.20930759416480996
274
+ released_singlecell,test_fibro_1kPa_setIII,force:fibroblasts_PDMS,17,0.0031100641867583823,0.003715072512468761,0.8848979858791127,0.032660186773042374,0.5954149762803934,0.1693066096515593,0.6640730640467476,0.07511973129361038,24.97328571317827,9.45682709856301,14.005428180098534,3.644262419974022,0.0,0.0,0.004828425014720176,0.5608163996100819
275
+ released_singlecell,test_fibro_1kPa_setIII,legacy,17,0.0031100641867583823,0.003715072512468761,0.8848979858791127,0.032660186773042374,0.5954149762803934,0.1693066096515593,0.6640730640467476,0.07511973129361038,24.97328571317827,9.45682709856301,14.005428180098534,3.644262419974022,0.0,0.0,0.0049601162181180415,0.5608163996100819
276
+ released_singlecell,test_fibro_1kPa_setIII,nominal,17,0.003904879147953788,0.003861519045550532,0.8491565304643968,0.037116968675901085,0.2755562877348061,0.20609273383371862,0.7847661270814783,0.055701512845592646,24.97328571317827,9.45682709856301,5.227098351015764,1.1178458797738569,0.0,0.0,0.004828200620763383,0.20930759416480996
277
+ released_singlecell,test_fibro_DMSO_setI,force:PDMS_10kPa_3um,27,0.0059642004090602295,0.005276422274717087,0.8879324837967202,0.05078683920147332,0.6219025002951826,0.19403255828913257,0.6789829576456988,0.1558341049022179,22.690155784840936,9.65334822627502,15.249276852787093,6.361649962929143,0.0011002929122359444,0.0017828783273705856,0.004851809254398977,0.6720657626764722
278
+ released_singlecell,test_fibro_DMSO_setI,force:PDMS_1kPa_3um,27,0.009147793235671137,0.008151817357192857,0.8630167135485897,0.06380570378608395,0.4553694903320509,0.17500554529987286,0.799607084857093,0.056941707246762945,22.690155784840936,9.65334822627502,4.577394342049956,0.539373205942632,0.0011002929122359444,0.0017828783273705856,0.004528213430333963,0.2017348133461502
279
+ released_singlecell,test_fibro_DMSO_setI,force:fibroblasts_PDMS,27,0.004453212492754278,0.003938379220494327,0.8974171545770433,0.05240863164370243,0.7418217585205283,0.0709591420866718,0.6026221557899758,0.06756008391392476,22.690155784840936,9.65334822627502,13.69684879426603,5.195207151360879,0.0011002929122359444,0.0017828783273705856,0.004899431157995095,0.6036471906207341
280
+ released_singlecell,test_fibro_DMSO_setI,legacy,27,0.004453212492754278,0.003938379220494327,0.8974171545770433,0.05240863164370243,0.7418217585205283,0.0709591420866718,0.6026221557899758,0.06756008391392476,22.690155784840936,9.65334822627502,13.69684879426603,5.195207151360879,0.0011002929122359444,0.0017828783273705856,0.0048647103486237075,0.6036471906207341
281
+ released_singlecell,test_fibro_DMSO_setI,nominal,27,0.004453212492754278,0.003938379220494327,0.8974171545770433,0.05240863164370243,0.7418217585205283,0.0709591420866718,0.6026221557899758,0.06756008391392476,22.690155784840936,9.65334822627502,13.69684879426603,5.195207151360879,0.0011002929122359444,0.0017828783273705856,0.004569866039134785,0.6036471906207341
282
+ released_singlecell,test_fibro_DMSO_setII,force:PDMS_10kPa_3um,11,0.007911522407084664,0.004987751714184212,0.8595416383309797,0.056132495957072634,0.5964838810283783,0.13112915118864965,0.7117598977955905,0.19758138232095174,26.922392574223604,8.656309600517519,16.873993910849094,8.384900731134598,0.0009989304976029546,0.001193270015423396,0.005141496658325127,0.6267642767754905
283
+ released_singlecell,test_fibro_DMSO_setII,force:PDMS_1kPa_3um,11,0.011324346700513854,0.006289840518603676,0.8479845848950472,0.038718733545230276,0.4724785546427821,0.14915196980433032,0.8208758397535845,0.04488806866563193,26.922392574223604,8.656309600517519,4.982918966561556,0.551311959015583,0.0009989304976029546,0.001193270015423396,0.004978613419966191,0.18508455193289056
284
+ released_singlecell,test_fibro_DMSO_setII,force:fibroblasts_PDMS,11,0.0052343414334410365,0.003744674478947795,0.8893214951861989,0.0312273470555408,0.7779805041346491,0.06304972549132498,0.5753404850309546,0.07140405537010856,26.922392574223604,8.656309600517519,17.07704763182185,5.137652735098763,0.0009989304976029546,0.001193270015423396,0.005038434808904437,0.6343064638382839
285
+ released_singlecell,test_fibro_DMSO_setII,legacy,11,0.0052343414334410365,0.003744674478947795,0.8893214951861989,0.0312273470555408,0.7779805041346491,0.06304972549132498,0.5753404850309546,0.07140405537010856,26.922392574223604,8.656309600517519,17.07704763182185,5.137652735098763,0.0009989304976029546,0.001193270015423396,0.005002455277876355,0.6343064638382839
286
+ released_singlecell,test_fibro_DMSO_setII,nominal,11,0.0052343414334410365,0.003744674478947795,0.8893214951861989,0.0312273470555408,0.7779805041346491,0.06304972549132498,0.5753404850309546,0.07140405537010856,26.922392574223604,8.656309600517519,17.07704763182185,5.137652735098763,0.0009989304976029546,0.001193270015423396,0.005087072199041155,0.6343064638382839
287
+ released_singlecell,test_fibro_TGFb_setI,force:PDMS_10kPa_3um,15,0.00556533075869078,0.004158181737911294,0.8743664622306824,0.03241517167193686,0.583667090787204,0.0887632318940797,0.6681823611259461,0.14421389828036393,24.50147196650505,8.277265561301698,24.10404421389103,3.3702182048968163,0.0006481806437174341,0.0010562970743840123,0.0050296306610106865,0.983779433612914
288
+ released_singlecell,test_fibro_TGFb_setI,force:PDMS_1kPa_3um,15,0.008824856501693474,0.00657402624383509,0.8546348969141643,0.0481219740175007,0.4754152024022303,0.1124045204067094,0.78561985095342,0.058552979008762454,24.50147196650505,8.277265561301698,5.268520954996347,0.5193441511484249,0.0006481806437174341,0.0010562970743840123,0.004754130045572846,0.21502875264795213
289
+ released_singlecell,test_fibro_TGFb_setI,force:fibroblasts_PDMS,15,0.0063882190423706795,0.004582238218193042,0.8828699747721355,0.037851858090629874,0.5466567531665321,0.10196851160139742,0.6384034554163615,0.025397539932643255,24.50147196650505,8.277265561301698,13.529506015280882,2.632022520837055,0.0006481806437174341,0.0010562970743840123,0.004787667592366486,0.5521915595020785
290
+ released_singlecell,test_fibro_TGFb_setI,legacy,15,0.0063882190423706795,0.004582238218193042,0.8828699747721355,0.037851858090629874,0.5466567531665321,0.10196851160139742,0.6384034554163615,0.025397539932643255,24.50147196650505,8.277265561301698,13.529506015280882,2.632022520837055,0.0006481806437174341,0.0010562970743840123,0.005009730656941686,0.5521915595020785
291
+ released_singlecell,test_fibro_TGFb_setI,nominal,15,0.0063882190423706795,0.004582238218193042,0.8828699747721355,0.037851858090629874,0.5466567531665321,0.10196851160139742,0.6384034554163615,0.025397539932643255,24.50147196650505,8.277265561301698,13.529506015280882,2.632022520837055,0.0006481806437174341,0.0010562970743840123,0.0049245516459146535,0.5521915595020785
292
+ released_singlecell,test_fibro_Y27632_setI,force:PDMS_10kPa_3um,16,0.003046026300580656,0.0023902737485226636,0.9070787392556667,0.03204274417939458,0.2856989367377881,0.2464208547194707,0.796855840831995,0.2546800840304405,17.703224846627563,7.054585229165719,22.267511929385364,3.3338313518564413,2.723932266235e-05,0.00010895729064939998,0.004625231027603087,1.2578223528368782
293
+ released_singlecell,test_fibro_Y27632_setI,force:PDMS_1kPa_3um,16,0.0025232239186152,0.004301692061606505,0.8900401741266251,0.04091464467582475,0.3155873393744194,0.21401973112995626,0.7388475462794304,0.07057009569488983,17.703224846627563,7.054585229165719,4.666707871365361,0.7715629894337405,2.723932266235e-05,0.00010895729064939998,0.004619449377059888,0.2636077839939067
294
+ released_singlecell,test_fibro_Y27632_setI,force:fibroblasts_PDMS,16,0.0019995044713140876,0.001613326641036467,0.8894907012581825,0.03692041223184758,0.2693332162654451,0.3116823770419339,0.7746450565755367,0.13932744443374148,17.703224846627563,7.054585229165719,16.011712898034602,5.952325219336972,2.723932266235e-05,0.00010895729064939998,0.0046313107013702,0.9044517615718364
295
+ released_singlecell,test_fibro_Y27632_setI,legacy,16,0.0019995044713140876,0.001613326641036467,0.8894907012581825,0.03692041223184758,0.2693332162654451,0.3116823770419339,0.7746450565755367,0.13932744443374148,17.703224846627563,7.054585229165719,16.011712898034602,5.952325219336972,2.723932266235e-05,0.00010895729064939998,0.0045893192291259245,0.9044517615718364
296
+ released_singlecell,test_fibro_Y27632_setI,nominal,16,0.0019995044713140876,0.001613326641036467,0.8894907012581825,0.03692041223184758,0.2693332162654451,0.3116823770419339,0.7746450565755367,0.13932744443374148,17.703224846627563,7.054585229165719,16.011712898034602,5.952325219336972,2.723932266235e-05,0.00010895729064939998,0.004728436470031675,0.9044517615718364
297
+ released_singlecell,test_fibro_Y27632_setII,force:PDMS_10kPa_3um,20,0.00278275505115738,0.001902668827132123,0.8937429964542389,0.06752012034167221,0.5516216857787583,0.1688051194410714,0.718304792046547,0.18960807167758167,17.667164374142885,4.5439277959248345,14.95754275638319,6.618977019249469,5.369186401366938e-05,0.00016632603301397394,0.00454176664352411,0.8466295122195494
298
+ released_singlecell,test_fibro_Y27632_setII,force:PDMS_1kPa_3um,20,0.0038898970698937304,0.002363755634315763,0.8937384873628617,0.03052258271437355,0.397742511692969,0.18617953458062886,0.7389822542667389,0.05279411005066918,17.667164374142885,4.5439277959248345,5.058338353410363,0.697430168887955,5.369186401366938e-05,0.00016632603301397394,0.00466638803482052,0.2863129728284857
299
+ released_singlecell,test_fibro_Y27632_setII,force:fibroblasts_PDMS,20,0.0027674734359606603,0.0013679365722081556,0.9105745822191238,0.029483450955047265,0.7110556467631046,0.11578713828148801,0.6873486876487732,0.18382089760015108,17.667164374142885,4.5439277959248345,16.1465915851295,3.7963086878174304,5.369186401366938e-05,0.00016632603301397394,0.00448672771453851,0.913932266841936
300
+ released_singlecell,test_fibro_Y27632_setII,legacy,20,0.0027674734359606603,0.0013679365722081556,0.9105745822191238,0.029483450955047265,0.7110556467631046,0.11578713828148801,0.6873486876487732,0.18382089760015108,17.667164374142885,4.5439277959248345,16.1465915851295,3.7963086878174304,5.369186401366938e-05,0.00016632603301397394,0.00473176240921015,0.913932266841936
301
+ released_singlecell,test_fibro_Y27632_setII,nominal,20,0.0027674734359606603,0.0013679365722081556,0.9105745822191238,0.029483450955047265,0.7110556467631046,0.11578713828148801,0.6873486876487732,0.18382089760015108,17.667164374142885,4.5439277959248345,16.1465915851295,3.7963086878174304,5.369186401366938e-05,0.00016632603301397394,0.0045794486999510995,0.913932266841936
302
+ released_singlecell,test_fibro_fibronectin_setI,force:PDMS_10kPa_3um,40,0.0033356499086948503,0.003373158495671077,0.8498496025800705,0.08764148188653184,0.6378749717713935,0.16985712008329082,0.7428044930100441,0.17397508510867352,18.936000810936093,6.40314149380327,9.558850829853327,5.4027435697797355,0.000261020660400378,0.0006666419848302161,0.004528141021728445,0.5047977619610584
303
+ released_singlecell,test_fibro_fibronectin_setI,force:PDMS_1kPa_3um,40,0.004801757886889337,0.003846909160575265,0.873684161901474,0.05037023401123817,0.3493520564337779,0.11453600841885105,0.7684886127710342,0.06612511836238444,18.936000810936093,6.40314149380327,4.657647054409608,0.7189578734721347,0.000261020660400378,0.0006666419848302161,0.004556781053543036,0.24596783137650063
304
+ released_singlecell,test_fibro_fibronectin_setI,force:fibroblasts_PDMS,40,0.0024195228586904273,0.0018857059949133157,0.910586328804493,0.03828682600255021,0.7249726432558797,0.1165157430433979,0.617356789112091,0.14279229548998681,18.936000810936093,6.40314149380327,12.867950729560107,3.676762493265837,0.000261020660400378,0.0006666419848302161,0.00465028285980219,0.6795495447026222
305
+ released_singlecell,test_fibro_fibronectin_setI,legacy,40,0.0024195228586904273,0.0018857059949133157,0.910586328804493,0.03828682600255021,0.7249726432558797,0.1165157430433979,0.617356789112091,0.14279229548998681,18.936000810936093,6.40314149380327,12.867950729560107,3.676762493265837,0.000261020660400378,0.0006666419848302161,0.00461612939834589,0.6795495447026222
306
+ released_singlecell,test_fibro_fibronectin_setI,nominal,40,0.0024195228586904273,0.0018857059949133157,0.910586328804493,0.03828682600255021,0.7249726432558797,0.1165157430433979,0.617356789112091,0.14279229548998681,18.936000810936093,6.40314149380327,12.867950729560107,3.676762493265837,0.000261020660400378,0.0006666419848302161,0.004529583454132026,0.6795495447026222
307
+ released_singlecell,test_u2os_6kPa,force:PDMS_10kPa_3um,39,0.03004958791037396,0.021541023447636233,0.5804610030773358,0.10077035275137514,0.1931371379674635,0.13469607720219803,0.8593333837313529,0.07659096412010012,72.38253683615953,22.514049794991656,13.926628787512294,7.639015090807186,0.0023382871578900974,0.004895436215126899,0.004665741553673312,0.1924031596051368
308
+ released_singlecell,test_u2os_6kPa,force:PDMS_1kPa_3um,39,0.032734328880906056,0.023120905824682503,0.576118549475303,0.09202236444462565,0.26696992370699235,0.14935643027762086,0.899991898964613,0.024037131525816935,72.38253683615953,22.514049794991656,6.928924196519149,1.3219024152562475,0.0023382871578900974,0.004895436215126899,0.00463585364512902,0.09572646247813914
309
+ released_singlecell,test_u2os_6kPa,force:fibroblasts_PDMS,39,0.024324910213740926,0.014906816930928083,0.623754389775105,0.08630506482126424,0.33357786391635685,0.16753466726325286,0.7508460986308563,0.07419530227311273,72.38253683615953,22.514049794991656,30.93002538363903,11.269040677012995,0.0023382871578900974,0.004895436215126899,0.0046363304822872225,0.4273133650130314
310
+ released_singlecell,test_u2os_6kPa,legacy,39,0.024324910213740926,0.014906816930928083,0.623754389775105,0.08630506482126424,0.33357786391635685,0.16753466726325286,0.7508460986308563,0.07419530227311273,72.38253683615953,22.514049794991656,30.93002538363903,11.269040677012995,0.0023382871578900974,0.004895436215126899,0.004493407714061187,0.4273133650130314
311
+ released_singlecell,test_u2os_6kPa,nominal,39,0.022269667663539775,0.015851665122395688,0.6410657274417388,0.09144030107079344,0.32209287343750564,0.16820012474590934,0.6849310061870477,0.05442424999788893,72.38253683615953,22.514049794991656,30.112045076795113,7.7011254844693475,0.0023382871578900974,0.004895436215126899,0.004564688755915656,0.41601256868013353
312
+ released_singlecell,zenodo_v1_test,force:PDMS_10kPa_3um,46,0.009490183085132256,0.009776615018798717,0.8784124734609023,0.05003971706822053,0.6468599329416571,0.1453690852850533,0.706435299437979,0.14323502373451197,26.68617501773912,13.512588866281218,14.552588250650013,5.316206779151774,0.002364386682924989,0.003851346753000209,0.004607185073520783,0.5453231210908442
313
+ released_singlecell,zenodo_v1_test,force:PDMS_1kPa_3um,46,0.013568661152891268,0.012465178722132328,0.8620971493099047,0.05444536425512683,0.410488161268022,0.1297664718542953,0.8268247246742249,0.04564684748280711,26.68617501773912,13.512588866281218,5.672539442615665,0.8544533409385608,0.002364386682924989,0.003851346753000209,0.00456812589064883,0.21256472457536357
314
+ released_singlecell,zenodo_v1_test,force:fibroblasts_PDMS,46,0.006317516024548347,0.006083220944049273,0.8971123371435248,0.04476988985120516,0.7547572318883448,0.0860145628565253,0.590717578711717,0.09063848099768218,26.68617501773912,13.512588866281218,17.392137998957995,6.687299227914619,0.002364386682924989,0.003851346753000209,0.004564197167106244,0.6517283944738017
315
+ released_singlecell,zenodo_v1_test,legacy,46,0.006317516024548347,0.006083220944049273,0.8971123371435248,0.04476988985120516,0.7547572318883448,0.0860145628565253,0.590717578711717,0.09063848099768218,26.68617501773912,13.512588866281218,17.392137998957995,6.687299227914619,0.002364386682924989,0.003851346753000209,0.00450821544813067,0.6517283944738017
316
+ released_singlecell,zenodo_v1_test,nominal,46,0.006317516024548347,0.006083220944049273,0.8971123371435248,0.04476988985120516,0.7547572318883448,0.0860145628565253,0.590717578711717,0.09063848099768218,26.68617501773912,13.512588866281218,17.392137998957995,6.687299227914619,0.002364386682924989,0.003851346753000209,0.004506878230882665,0.6517283944738017
317
+ released_spheroid_GN,spheroid_val,none,28,0.013172084981176418,0.005716511968536954,0.7420558205672673,0.031187837585703627,0.8843209040635234,0.04009939154042142,0.46781118320567266,0.14584597956201845,8.515775283532482,2.206210863837729,9.058851855141777,0.9761151261813897,0.008846793855939564,0.015233062860168744,0.004465077604566236,1.0637730040457358
318
+ s2f_full_seed0,alltune_val,legacy,81,0.007403633580974218,0.007661641274127835,0.8860944465354637,0.04762741777512546,0.5647026629968482,0.19218836862941818,0.6838276062482669,0.10274790465330667,24.59675819831498,12.09090158606753,13.156345622889974,6.409891954235954,0.002138373292522645,0.003586675581752635,0.014900122159793004,0.5348812846316984
319
+ s2f_full_seed0,test_fibro_1kPa_setIII,legacy,17,0.0048432245316421705,0.003773581220047469,0.8711476431173437,0.029049059319276007,0.5685533038037988,0.17695315391818114,0.7552288384998546,0.09549383834284965,24.97328571317827,9.45682709856301,13.663532212376595,4.433941972811288,0.0,0.0,0.005000507130342317,0.5471259316577002
320
+ s2f_full_seed0,test_fibro_DMSO_setI,legacy,27,0.006105205216617448,0.004243343226162324,0.8901766317862051,0.05810375960127931,0.678699136462062,0.09835696125651965,0.6713960656413326,0.08336171808561742,22.690155784840936,9.653348226275018,13.55218111226956,3.2708524067294777,0.0011002929122359444,0.0017828783273705856,0.004949384265475748,0.5972714000193703
321
+ s2f_full_seed0,test_fibro_DMSO_setII,legacy,11,0.007140332896431701,0.004714957848055613,0.880786884914745,0.035433496721979325,0.6500770855517413,0.11572354456996047,0.6434600786729292,0.07055753795866049,26.922392574223604,8.656309600517519,15.203494409268552,5.180656098048238,0.0009989304976029546,0.001193270015423396,0.005000092766501627,0.5647155752354969
322
+ s2f_full_seed0,test_fibro_TGFb_setI,legacy,15,0.007822824735194401,0.00515281028336671,0.865954327583313,0.04802266844812651,0.5246377748976351,0.11438230679080817,0.7508346637090048,0.05970422366022053,24.50147196650505,8.277265561301697,9.998152001450459,2.5922173304448757,0.0006481806437174341,0.0010562970743840123,0.00502799352010086,0.40806332024127034
323
+ s2f_full_seed0,test_fibro_Y27632_setI,legacy,16,0.004826199059607419,0.0028104881319361203,0.884519524872303,0.03115819396922427,0.27830034553637717,0.24603515025572129,0.9061530791223049,0.1446411030512203,17.703224846627563,7.054585229165719,13.045858941040933,4.684875790794899,2.723932266235e-05,0.00010895729064939998,0.004675239324569662,0.7369199145389688
324
+ s2f_full_seed0,test_fibro_Y27632_setII,legacy,20,0.00416848057648162,0.0018434319163991289,0.9060273319482803,0.028021753359816118,0.6338300112157338,0.1506035292564372,0.7263453096151352,0.14155001671605602,17.667164374142885,4.543927795924835,15.415194863453507,4.074068334384739,5.369186401366938e-05,0.00016632603301397394,0.00444730520248408,0.8725336186951829
325
+ s2f_full_seed0,test_fibro_fibronectin_setI,legacy,40,0.0032643622806062477,0.0029542179275722142,0.9086986064910889,0.04077468093993597,0.6548082235733268,0.13116876516183038,0.619601184129715,0.08101787141064191,18.936000810936093,6.40314149380327,10.666864877566695,2.625081854423892,0.000261020660400378,0.0006666419848302161,0.004615598917007385,0.5633113868164955
326
+ s2f_full_seed0,test_u2os_6kPa,legacy,39,0.025228360023062908,0.01864834427623723,0.6179663768181434,0.09230979542713379,0.2590400260116758,0.15254637636935273,0.7635420102339524,0.06487804918318579,72.38253683615953,22.514049794991656,23.594999375442665,8.174258660222794,0.0023382871578900974,0.004895436215126899,0.004780958860348374,0.3259764082164016
327
+ s2f_full_seed0,zenodo_v1_test,legacy,46,0.008099722417840764,0.007962771146788165,0.8855449596176976,0.05101622501597161,0.6705402290678603,0.1079542111545768,0.6632118108479873,0.09619165317496678,26.68617501773912,13.512588866281218,16.777880712533776,5.081314331508309,0.002364386682924989,0.003851346753000209,0.004478164341138696,0.6287105852142918
328
+ s2f_full_seed1,alltune_val,legacy,81,0.008378570599705617,0.009035062478647703,0.8644492008067943,0.05168605813072439,0.4132038688790316,0.2881793933448504,0.7622859419128041,0.12335918511872127,24.59675819831498,12.09090158606753,11.480120349859382,7.103065822237242,0.002138373292522645,0.003586675581752635,0.004644794228636129,0.46673306528036024
329
+ s2f_full_seed1,test_fibro_1kPa_setIII,legacy,17,0.0035435958964037586,0.0031621209145935936,0.8797964278389426,0.04061694186319321,0.5142893255669023,0.23875014557022536,0.6860505938529968,0.09738607131351713,24.97328571317827,9.45682709856301,16.048426137251013,5.465138415692438,0.0,0.0,0.004754865870756206,0.642623734880923
330
+ s2f_full_seed1,test_fibro_DMSO_setI,legacy,27,0.00626537941840334,0.00550013944005588,0.8891017635663351,0.04731001198441305,0.5666683378420798,0.17863158894257805,0.6952517407911795,0.15274118836505313,22.690155784840936,9.653348226275018,15.31017816591042,3.1769322185621993,0.0011002929122359444,0.0017828783273705856,0.004877567291259704,0.6747498038836294
331
+ s2f_full_seed1,test_fibro_DMSO_setII,legacy,11,0.008075738473879964,0.005993826256167385,0.8788157213817943,0.03867741427369394,0.5481885102876839,0.1865520150244958,0.6543542092496698,0.08630270090462323,26.922392574223604,8.656309600517519,14.783654869957404,3.672792256928088,0.0009989304976029546,0.001193270015423396,0.005002845417369454,0.5491211388140803
332
+ s2f_full_seed1,test_fibro_TGFb_setI,legacy,15,0.00748095845337952,0.005991244607777815,0.8813922007878622,0.04604488995457778,0.43871778541191625,0.13422298975713692,0.6653973658879598,0.058959663947104356,24.50147196650505,8.277265561301697,11.191859158376852,1.5555838803336155,0.0006481806437174341,0.0010562970743840123,0.0051559289296467725,0.456783134240946
333
+ s2f_full_seed1,test_fibro_Y27632_setI,legacy,16,0.0029091270844218875,0.003738498531191166,0.907383780926466,0.03571795621353653,0.1908907569598685,0.21790528092696604,0.7400269620120525,0.10983461143628569,17.703224846627563,7.054585229165719,11.939003539737314,1.7230079130657676,2.723932266235e-05,0.00010895729064939998,0.004518166184425287,0.6743971024020335
334
+ s2f_full_seed1,test_fibro_Y27632_setII,legacy,20,0.002956708942656355,0.0019773518682362906,0.9073550760746002,0.031125373069777747,0.5638470048642255,0.19416761999621068,0.6669835031032563,0.12300026089234124,17.667164374142885,4.543927795924835,16.297569638118148,3.2724101963902665,5.369186401366938e-05,0.00016632603301397394,0.004427766799926699,0.9224779536194708
335
+ s2f_full_seed1,test_fibro_fibronectin_setI,legacy,40,0.002843329559982475,0.0026234990019516173,0.9090003848075867,0.038139003936975384,0.6439433240105641,0.14787440943864325,0.6243324726819992,0.10647396282225227,18.936000810936093,6.40314149380327,15.129443677142262,3.39154822107418,0.000261020660400378,0.0006666419848302161,0.00462223887443537,0.7989777687591019
336
+ s2f_full_seed1,test_u2os_6kPa,legacy,39,0.025629090801932063,0.018510913758227877,0.6172383756209643,0.09276946869717624,0.24423073421385452,0.14893750931979002,0.7379362690143096,0.0667922115710023,72.38253683615953,22.514049794991656,37.09050029134139,15.989022251171644,0.0023382871578900974,0.004895436215126899,0.004706083199916687,0.5124233262961904
337
+ s2f_full_seed1,zenodo_v1_test,legacy,46,0.0088119679940459,0.009549827814624828,0.8808011943879335,0.0468587783993427,0.6441706881411599,0.12094733632297655,0.6986183705537216,0.1194069725695662,26.68617501773912,13.512588866281218,16.71857295719826,3.56533219911315,0.002364386682924989,0.003851346753000209,0.004485306532486561,0.626488170226153
338
+ s2f_no_force_seed0,alltune_val,legacy,81,0.007025569781551753,0.007546154498148321,0.8857047418017446,0.04837581737172965,0.5563777112973819,0.21995721553308661,0.6950341363747915,0.12157074360870151,24.59675819831498,12.09090158606753,14.435720834076221,7.1380954221929915,0.002138373292522645,0.003586675581752635,0.004583520653807028,0.5868952614684464
339
+ s2f_no_force_seed0,test_fibro_1kPa_setIII,legacy,17,0.0036621526541078353,0.003446146526259069,0.8776698533226462,0.029881816379458314,0.5788434498521575,0.17532573099833718,0.7151551316766178,0.0828355994175855,24.97328571317827,9.45682709856301,12.628493940129,4.040212503984647,0.0,0.0,0.004733436247881653,0.5056801129482538
340
+ s2f_no_force_seed0,test_fibro_DMSO_setI,legacy,27,0.005511423650508078,0.0044730631777919186,0.8928641478220621,0.0598867039384141,0.6982649753529954,0.09757700921380641,0.6435456695380034,0.07721669298616972,22.690155784840936,9.653348226275018,12.588915863522777,3.561681990440239,0.0011002929122359444,0.0017828783273705856,0.004649621469003127,0.5548183971453076
341
+ s2f_no_force_seed0,test_fibro_DMSO_setII,legacy,11,0.006381369195878464,0.004773527551938624,0.8843225078149275,0.03559783191464839,0.689014609633764,0.11424970131292267,0.624621721831235,0.07478294580091784,26.922392574223604,8.656309600517519,13.90760290351781,4.32540109763999,0.0009989304976029546,0.001193270015423396,0.005182548002763163,0.5165812386538562
342
+ s2f_no_force_seed0,test_fibro_TGFb_setI,legacy,15,0.00730051992771522,0.005112009341160067,0.8713792721430461,0.04863960387776148,0.5781427547493201,0.12134249891333167,0.7343275308609009,0.07138936180916389,24.50147196650505,8.277265561301697,10.122450503210226,2.8772516167503337,0.0006481806437174341,0.0010562970743840123,0.004875675837198833,0.41313642368296116
343
+ s2f_no_force_seed0,test_fibro_Y27632_setI,legacy,16,0.00393375010025915,0.0026148272633293042,0.8878369405865669,0.031566501439895193,0.3065268216964518,0.25337148501270396,0.8818864896893501,0.14272707440028132,17.703224846627563,7.054585229165719,12.685623310972005,4.074223929123499,2.723932266235e-05,0.00010895729064939998,0.0045252144336699746,0.716571326460252
344
+ s2f_no_force_seed0,test_fibro_Y27632_setII,legacy,20,0.003119037344003975,0.0017725148764137029,0.9118784844875336,0.0273043002920909,0.6497841791178236,0.1697912783482691,0.6713823050260543,0.13822003066998126,17.667164374142885,4.543927795924835,14.697451936081052,3.8166650500589756,5.369186401366938e-05,0.00016632603301397394,0.0045626640319823605,0.8319078050573745
345
+ s2f_no_force_seed0,test_fibro_fibronectin_setI,legacy,40,0.003174452977691487,0.0031514437347584796,0.9113428622484208,0.04216925939034792,0.6524915356251586,0.13234634584640664,0.6026194840669632,0.08593283480989711,18.936000810936093,6.40314149380327,9.711981529835612,2.1019366131465844,0.000261020660400378,0.0006666419848302161,0.00456732511520379,0.512884511719426
346
+ s2f_no_force_seed0,test_u2os_6kPa,legacy,39,0.024946405212036636,0.018350372868601014,0.6164228480595809,0.09156690912433854,0.2615694447502838,0.15643780740763447,0.7628524318719522,0.06328663981341529,72.38253683615953,22.514049794991656,23.7020822480703,8.927276630385808,0.0023382871578900974,0.004895436215126899,0.0047541520534416975,0.32745581025601267
347
+ s2f_no_force_seed0,zenodo_v1_test,legacy,46,0.007577678046958546,0.008146737063957011,0.8885169236556344,0.05096400902685564,0.6975362894917742,0.11996565233577272,0.6524692974660707,0.11333234950572708,26.68617501773912,13.512588866281218,15.789938179533118,4.9420675955822615,0.002364386682924989,0.003851346753000209,0.004553618638411761,0.5916898232525666
348
+ s2f_no_force_seed1,alltune_val,legacy,81,0.008252446204107661,0.009097134059776468,0.8631013256532175,0.0583384806363254,0.4416766480116294,0.29297726907749233,0.75269924932056,0.14643350661721924,24.59675819831498,12.09090158606753,11.52208507424623,6.574323683847489,0.002138373292522645,0.003586675581752635,0.0045931927951765135,0.4684391732173697
349
+ s2f_no_force_seed1,test_fibro_1kPa_setIII,legacy,17,0.0036248339490745295,0.00410709200892139,0.8694552849320805,0.06557278387846308,0.5146845124398707,0.28361291747466816,0.7151896883459652,0.16898448006409428,24.97328571317827,9.45682709856301,15.154317130937295,8.5127903857866,0.0,0.0,0.004830514683442912,0.606821116972223
350
+ s2f_no_force_seed1,test_fibro_DMSO_setI,legacy,27,0.006082570463789707,0.005819178696678665,0.8950508325188248,0.053793907804576914,0.6540788285479832,0.145077677246586,0.6361801458729638,0.08949928415618352,22.690155784840936,9.653348226275018,12.45018381073519,2.089472931579054,0.0011002929122359444,0.0017828783273705856,0.004761157212433921,0.5487042014516723
351
+ s2f_no_force_seed1,test_fibro_DMSO_setII,legacy,11,0.00792683599601411,0.0060128226045584226,0.8787778724323619,0.04039691944882655,0.6070894993969326,0.15399487459937286,0.6483136307109486,0.0844969531549956,26.922392574223604,8.656309600517519,12.4360965564847,2.9746397522969654,0.0009989304976029546,0.001193270015423396,0.004949699748646082,0.46192389930423317
352
+ s2f_no_force_seed1,test_fibro_TGFb_setI,legacy,15,0.007498984411358794,0.0059901561094788365,0.8708474079767863,0.04420783603462203,0.5443125852040407,0.09882037730050389,0.7116001804669698,0.047310510029176196,24.50147196650505,8.277265561301697,8.872784860432148,1.234039904673384,0.0006481806437174341,0.0010562970743840123,0.004964208602905247,0.3621327270688784
353
+ s2f_no_force_seed1,test_fibro_Y27632_setI,legacy,16,0.0031128596710913686,0.0036962723519499995,0.8846122659742832,0.030320164129600934,0.2327076717738322,0.2401349375284605,0.8545499220490456,0.1299009115424295,17.703224846627563,7.054585229165719,10.244851902825758,2.089482794164573,2.723932266235e-05,0.00010895729064939998,0.0046354085206984875,0.5786997562072644
354
+ s2f_no_force_seed1,test_fibro_Y27632_setII,legacy,20,0.002746139906230335,0.0019513278427814064,0.9118049710988998,0.029826346806210165,0.6143731511814898,0.1639777867196,0.6372746795415878,0.10683506395713721,17.667164374142885,4.543927795924835,13.764887768775225,2.645406685596266,5.369186401366938e-05,0.00016632603301397394,0.00468966960906979,0.7791226411478397
355
+ s2f_no_force_seed1,test_fibro_fibronectin_setI,legacy,40,0.0029537700320360675,0.002790996460898908,0.9041452869772911,0.048416015797203026,0.614406668057893,0.21286686282780762,0.6481068387627602,0.20858099894130616,18.936000810936093,6.40314149380327,14.802770758979023,5.29661160432691,0.000261020660400378,0.0006666419848302161,0.00471751689910883,0.7817263479641378
356
+ s2f_no_force_seed1,test_u2os_6kPa,legacy,39,0.024824432730197098,0.01880802851143239,0.6202409359124991,0.09518970645263523,0.2411071373982577,0.1393619737267879,0.728512262686705,0.05147858611293676,72.38253683615953,22.514049794991656,31.954397948888634,13.143960454312019,0.0023382871578900974,0.004895436215126899,0.004688758116501974,0.4414655709182805
357
+ s2f_no_force_seed1,zenodo_v1_test,legacy,46,0.008953612841888397,0.010005320407814924,0.884652880222901,0.04950569052001037,0.6649514612991112,0.12007936801682456,0.6731407901515132,0.11200965266577287,26.68617501773912,13.512588866281218,14.990656758132188,2.8652219108010586,0.002364386682924989,0.003851346753000209,0.004928355631620934,0.5617386811023849
358
+ s2f_no_gan_seed0,alltune_val,legacy,81,0.008487074454113744,0.009449747250084775,0.8792160226974959,0.05028129879699088,0.4228369140320166,0.3050416023523168,0.7220750031647859,0.13423930242264148,24.59675819831498,12.09090158606753,12.27195099654412,5.654097482241188,0.002138373292522645,0.003586675581752635,0.004580309361587284,0.49892554529339644
359
+ s2f_no_gan_seed0,test_fibro_1kPa_setIII,legacy,17,0.002548997540382953,0.0031475113146955704,0.8935547821662005,0.03302120442496606,0.5749935604738379,0.1662070985971326,0.6276192384607652,0.07508288209482047,24.97328571317827,9.45682709856301,12.879750855705318,2.2286518710623966,0.0,0.0,0.004751696306116371,0.5157411404983342
360
+ s2f_no_gan_seed0,test_fibro_DMSO_setI,legacy,27,0.005658725086875493,0.006048713772669171,0.9035186193607472,0.054184805214217514,0.7079754370588515,0.1290404251308001,0.5878671981670238,0.08110928069127286,22.690155784840936,9.653348226275018,13.183228947498181,2.172609916727817,0.0011002929122359444,0.0017828783273705856,0.004761219024658137,0.5810109490876992
361
+ s2f_no_gan_seed0,test_fibro_DMSO_setII,legacy,11,0.007475083080035655,0.005808283657235817,0.8889947479421442,0.03507860468442787,0.6916011905911458,0.07949284213829536,0.6147426746108315,0.07710826192875249,26.922392574223604,8.656309600517519,12.92913661084392,2.5165968081807515,0.0009989304976029546,0.001193270015423396,0.005018971183083209,0.48023728111084396
362
+ s2f_no_gan_seed0,test_fibro_TGFb_setI,legacy,15,0.007782343449071006,0.006171239063117971,0.8825387318929037,0.046665367556058664,0.45631973288743677,0.11542169214923606,0.6703397472699483,0.07314273558280705,24.50147196650505,8.277265561301697,9.964529859522978,1.2484980286499976,0.0006481806437174341,0.0010562970743840123,0.0049517154693602865,0.40669107036283675
363
+ s2f_no_gan_seed0,test_fibro_Y27632_setI,legacy,16,0.0024350379098904747,0.0036607865915241106,0.9130466245114803,0.03801626228116689,0.2796582660454166,0.26772456420619806,0.6918546855449677,0.07821012545439263,17.703224846627563,7.054585229165719,11.187869211426005,2.3798641786778356,2.723932266235e-05,0.00010895729064939998,0.004688128829002325,0.6319678650840429
364
+ s2f_no_gan_seed0,test_fibro_Y27632_setII,legacy,20,0.002221586552332105,0.0015655524069637732,0.9205944895744324,0.027171061021134407,0.662899155132191,0.14831070191526827,0.5780481100082397,0.08748712874258467,17.667164374142885,4.543927795924835,13.795815873891115,1.9931977765073927,5.369186401366938e-05,0.00016632603301397394,0.00460975170135492,0.7808732392891665
365
+ s2f_no_gan_seed0,test_fibro_fibronectin_setI,legacy,40,0.0032603403225948103,0.003175680273390469,0.9173164144158363,0.04136486748810669,0.6322736502936221,0.11763146317977716,0.5701033428311348,0.09462788083221126,18.936000810936093,6.40314149380327,10.910426208283752,1.759481849949653,0.000261020660400378,0.0006666419848302161,0.00460028052330012,0.5761737294594254
366
+ s2f_no_gan_seed0,test_u2os_6kPa,legacy,39,0.026338072816053215,0.020656468800329206,0.6295405733279693,0.09464828427959596,0.2145976400608969,0.1709826421090544,0.7474112709363302,0.06120880726590094,72.38253683615953,22.514049794991656,20.19636344928772,2.6512804477532277,0.0023382871578900974,0.004895436215126899,0.004675290523431189,0.2790225976053162
367
+ s2f_no_gan_seed0,zenodo_v1_test,legacy,46,0.009505964161413067,0.0105059053875036,0.8841959056646927,0.04796164855626492,0.6473071051806796,0.16389843205886578,0.691778267207353,0.1372963150475617,26.68617501773912,13.512588866281218,14.924051604517128,2.4399636759969523,0.002364386682924989,0.003851346753000209,0.004511434098948539,0.5592428137264577
368
+ s2f_no_gan_seed1,alltune_val,legacy,81,0.0073014836396193645,0.007787122450999757,0.8762923986823471,0.0657951252950296,0.5748387732353465,0.3249971192578943,0.7034308719046322,0.16946222682135703,24.59675819831498,12.09090158606753,10.658765937500622,6.43172538622235,0.002138373292522645,0.003586675581752635,0.004589781349087883,0.4333402740134596
369
+ s2f_no_gan_seed1,test_fibro_1kPa_setIII,legacy,17,0.0026499569957034587,0.0034457921712781436,0.8911961597554824,0.03340390201045932,0.6151346347295915,0.18211335027704056,0.6575270084773793,0.0707611851527858,24.97328571317827,9.45682709856301,11.654660763109431,3.1017646648116606,0.0,0.0,0.004768497803631901,0.4666851169271382
370
+ s2f_no_gan_seed1,test_fibro_DMSO_setI,legacy,27,0.005289597682551333,0.005023608122684967,0.9029299925874781,0.05631497131453442,0.7541221651647669,0.11244898502424247,0.5867721063119394,0.0865919691102769,22.690155784840936,9.653348226275018,11.313061781779483,3.562233705242814,0.0011002929122359444,0.0017828783273705856,0.0048664675818548735,0.4985889867418903
371
+ s2f_no_gan_seed1,test_fibro_DMSO_setII,legacy,11,0.006321751724251245,0.004280538688392897,0.8963781324299899,0.034464294182373414,0.7682119792892987,0.05563885610421556,0.5857787213542245,0.08095006991899459,26.922392574223604,8.656309600517519,13.246577995067293,3.2792092417666154,0.0009989304976029546,0.001193270015423396,0.005244298414750491,0.4920282608073254
372
+ s2f_no_gan_seed1,test_fibro_TGFb_setI,legacy,15,0.0065680028327429665,0.005639175761659044,0.8880462527275086,0.047310781621786806,0.6235300353068147,0.10838697809862587,0.653057587146759,0.06319746633303829,24.50147196650505,8.277265561301697,10.038496057192484,1.302305751383115,0.0006481806437174341,0.0010562970743840123,0.004701995849609313,0.40970991746600766
373
+ s2f_no_gan_seed1,test_fibro_Y27632_setI,legacy,16,0.0023165166385296747,0.0027711000511226203,0.9125325158238411,0.03126713829357044,0.32364429529956334,0.268381011076066,0.7338700443506241,0.08385476353947305,17.703224846627563,7.054585229165719,12.77206145459786,4.597554542485138,2.723932266235e-05,0.00010895729064939998,0.004525214433669988,0.7214539478117129
374
+ s2f_no_gan_seed1,test_fibro_Y27632_setII,legacy,20,0.001960298648918935,0.0012975390557817801,0.9245099633932113,0.02731074484927929,0.7226115924858971,0.1303520066125546,0.5786385864019394,0.09304469371964946,17.667164374142885,4.543927795924835,13.693433767184615,3.6886421011144876,5.369186401366938e-05,0.00016632603301397394,0.00453602075576777,0.7750781889608669
375
+ s2f_no_gan_seed1,test_fibro_fibronectin_setI,legacy,40,0.0027760626202506977,0.002801866773182362,0.9153424397110939,0.04508545668258543,0.733992344807851,0.12772151809285667,0.5858058944344521,0.0960413260568054,18.936000810936093,6.40314149380327,9.895527909975499,2.163134842802298,0.000261020660400378,0.0006666419848302161,0.004506129026412905,0.522577497158774
376
+ s2f_no_gan_seed1,test_u2os_6kPa,legacy,39,0.024521995491037712,0.01906853879499107,0.6303228506675134,0.09372717468971807,0.2932885014942948,0.16746670851697615,0.7466858380880111,0.06567925618059174,72.38253683615953,22.514049794991656,23.784966805042366,8.145908115955974,0.0023382871578900974,0.004895436215126899,0.004562347363202944,0.32860090077915466
377
+ s2f_no_gan_seed1,zenodo_v1_test,legacy,46,0.008013685783067586,0.008551064138787307,0.8959970383540444,0.050054315003419295,0.7703199416675881,0.09844705646652188,0.6270276398762412,0.08765088231835338,26.68617501773912,13.512588866281218,13.71746636805651,4.762617531950138,0.002364386682924989,0.003851346753000209,0.004501804061557874,0.5140289441607158
378
+ s2f_no_substrate_no_gan_seed0,alltune_val,none,81,0.006584345173725896,0.007473013001067255,0.9055347685460691,0.04240380665043231,0.7404536633029499,0.11701917845193674,0.5976351624653663,0.0911925742458448,24.59675819831498,12.09090158606753,13.684477248907458,4.469461252968698,0.002138373292522645,0.003586675581752635,0.004395340695793195,0.5563528794556725
379
+ s2f_no_substrate_no_gan_seed0,test_fibro_1kPa_setIII,none,17,0.002723307971952106,0.0036293693637504923,0.8893837332725525,0.035285085856855525,0.605126743975169,0.18205625717030516,0.6551546208998736,0.08092392497792301,24.97328571317827,9.45682709856301,10.326958370997625,2.651966885026337,0.0,0.0,0.004353425082038394,0.4135202107405572
380
+ s2f_no_substrate_no_gan_seed0,test_fibro_DMSO_setI,none,27,0.0054801068445494636,0.005209930862760233,0.9072047140863206,0.05457835885731617,0.7572188293428722,0.10588822471655404,0.5768459516542929,0.0812995019699332,22.690155784840936,9.653348226275018,12.068015902682587,2.8510082947572637,0.0011002929122359444,0.0017828783273705856,0.004407750235663463,0.5318613065999797
381
+ s2f_no_substrate_no_gan_seed0,test_fibro_DMSO_setII,none,11,0.006780140123076009,0.005172666815557405,0.8934287428855896,0.04009636632671069,0.8028265249122781,0.07326845940110314,0.5953265591101213,0.10555083923072701,26.922392574223604,8.656309600517519,12.536605396731334,3.818708870319906,0.0009989304976029546,0.001193270015423396,0.004727710377086246,0.4656571796941368
382
+ s2f_no_substrate_no_gan_seed0,test_fibro_TGFb_setI,none,15,0.0070365064311772064,0.005546042345032216,0.8712649703025818,0.04662099076536288,0.6775248857399596,0.10433643835032462,0.7068019350369771,0.07248174552480378,24.50147196650505,8.277265561301697,7.770808134227991,1.4177286739085924,0.0006481806437174341,0.0010562970743840123,0.004533243179321227,0.3171567873493944
383
+ s2f_no_substrate_no_gan_seed0,test_fibro_Y27632_setI,none,16,0.0018403326903352875,0.002749490517977058,0.9114614687860012,0.02915320220347747,0.362621617606424,0.29645761152566413,0.6968241818249226,0.07819226089686898,17.703224846627563,7.054585229165719,10.144082683837041,4.093312279764802,2.723932266235e-05,0.00010895729064939998,0.004374951124191237,0.5730076170709357
384
+ s2f_no_substrate_no_gan_seed0,test_fibro_Y27632_setII,none,20,0.00191423752694385,0.0012787633083515026,0.926742422580719,0.025817263689435908,0.7350979043175822,0.12852869909473524,0.5660009846091271,0.11039941113334054,17.667164374142885,4.543927795924835,13.484251592308283,4.253110092085113,5.369186401366938e-05,0.00016632603301397394,0.0043802857398986305,0.763238022058787
385
+ s2f_no_substrate_no_gan_seed0,test_fibro_fibronectin_setI,none,40,0.0027652025368296923,0.0025809557700046293,0.9190963372588158,0.04015344774701807,0.7228541923815774,0.10356866153637226,0.5701558090746403,0.07002883687150871,18.936000810936093,6.40314149380327,10.134018573444337,1.7363134891136132,0.000261020660400378,0.0006666419848302161,0.004360294342040955,0.5351720605964299
386
+ s2f_no_substrate_no_gan_seed0,test_u2os_6kPa,none,39,0.025457039988862354,0.01810527939163579,0.633322075391427,0.09250462757613633,0.32291794719288325,0.1862208784114964,0.768845110367506,0.06418890571975915,72.38253683615953,22.514049794991656,19.24736239016056,7.001569894527225,0.0023382871578900974,0.004895436215126899,0.0044402648241091466,0.2659116857665221
387
+ s2f_no_substrate_no_gan_seed0,zenodo_v1_test,none,46,0.0082008310115349,0.008602988028534252,0.8980634031088456,0.04711176436218675,0.7853023571922321,0.07824709560178504,0.6174369065657906,0.08585723693659922,26.68617501773912,13.512588866281218,14.11868706750481,4.721797994211453,0.002364386682924989,0.003851346753000209,0.004326457562653857,0.5290637215007278
388
+ s2f_no_substrate_no_gan_seed1,alltune_val,none,81,0.006931888133238521,0.00798636462483243,0.8978240158822801,0.04521280824699618,0.7010138013314605,0.14502270849717053,0.6267374470645999,0.08805389026525767,24.59675819831498,12.09090158606753,11.54208186737917,4.033034800884589,0.002138373292522645,0.003586675581752635,0.004383787696744132,0.46925215812260457
389
+ s2f_no_substrate_no_gan_seed1,test_fibro_1kPa_setIII,none,17,0.0033327442498000646,0.0036360561765027832,0.8535401645828696,0.03584004493403767,0.4747256927964938,0.17281649291133677,0.7512895219466266,0.06246685407279381,24.97328571317827,9.45682709856301,7.475291241836898,2.64738091216259,0.0,0.0,0.004429396461038006,0.2993315067825547
390
+ s2f_no_substrate_no_gan_seed1,test_fibro_DMSO_setI,none,27,0.006050296229120573,0.005659446366269638,0.8932994228822214,0.06100000263878493,0.7391684049275957,0.0923240666118028,0.6334173966337133,0.10053374330138756,22.690155784840936,9.653348226275018,9.833326873679956,3.2757793758021445,0.0011002929122359444,0.0017828783273705856,0.0044077414053457185,0.4333741454630956
391
+ s2f_no_substrate_no_gan_seed1,test_fibro_DMSO_setII,none,11,0.008831519866362172,0.005996829231641583,0.8620802164077759,0.04668333692158989,0.6185338022597191,0.12233883982315981,0.7183004996993325,0.11336948422674197,26.922392574223604,8.656309600517519,8.842864200811494,5.239641968583439,0.0009989304976029546,0.001193270015423396,0.004727341912009445,0.32845759070009056
392
+ s2f_no_substrate_no_gan_seed1,test_fibro_TGFb_setI,none,15,0.008993653549502234,0.006291149167858076,0.8253290017445882,0.0402574526729459,0.2975274036604047,0.15748922344198854,0.8551249742507935,0.03972897653871592,24.50147196650505,8.277265561301697,3.681207417200009,1.3299787376595396,0.0006481806437174341,0.0010562970743840123,0.00466698010762526,0.15024433724767375
393
+ s2f_no_substrate_no_gan_seed1,test_fibro_Y27632_setI,none,16,0.0025764575984794187,0.004309795297845585,0.8771230205893517,0.04317282848518076,0.1865989865688637,0.19835696039727185,0.7766678333282471,0.053255650664599766,17.703224846627563,7.054585229165719,4.54373455431778,1.1029062833357872,2.723932266235e-05,0.00010895729064939998,0.004375606775283763,0.2566614045566593
394
+ s2f_no_substrate_no_gan_seed1,test_fibro_Y27632_setII,none,20,0.002343492364161595,0.001663832258518659,0.9114789187908172,0.029853094990593992,0.6570347289676649,0.1444130547359827,0.61685601323843,0.07996468684122934,17.667164374142885,4.543927795924835,10.721658123657107,3.9343359671259424,5.369186401366938e-05,0.00016632603301397394,0.00434932708740229,0.6068692120931979
395
+ s2f_no_substrate_no_gan_seed1,test_fibro_fibronectin_setI,none,40,0.003307227212644595,0.0030814810317691746,0.8995786517858505,0.04927182958448695,0.6743644269953942,0.12218686194246967,0.6443672075867652,0.09969030375678203,18.936000810936093,6.40314149380327,8.42940599513895,3.064815942832111,0.000261020660400378,0.0006666419848302161,0.004324859380721985,0.44515238879112856
396
+ s2f_no_substrate_no_gan_seed1,test_u2os_6kPa,none,39,0.024623870885429423,0.019050582262652008,0.6421064818516756,0.09479664075525357,0.26117333147805133,0.1820757602582087,0.7255409742013003,0.06171702205144775,72.38253683615953,22.514049794991656,23.352580407682137,4.628170206236368,0.0023382871578900974,0.004895436215126899,0.00448782016069457,0.32262727210765685
397
+ s2f_no_substrate_no_gan_seed1,zenodo_v1_test,none,46,0.0088297159527428,0.009300929429374414,0.8903089580328568,0.05111147275631368,0.7485207669480254,0.09236943951596883,0.643010935705641,0.08190876424149247,26.68617501773912,13.512588866281218,12.021718344286732,4.019169937624538,0.002364386682924989,0.003851346753000209,0.004326493843741979,0.45048487976622825
398
+ s2f_no_substrate_seed0,alltune_val,none,81,0.006036201931383804,0.0057173572639637,0.8946175222043637,0.040376459012745516,0.6925590545962323,0.1194221765849953,0.631190914798666,0.0909251326218282,24.59675819831498,12.09090158606753,16.75051587553304,7.7700937446061396,0.002138373292522645,0.003586675581752635,0.0044083742447840754,0.6810050227139505
399
+ s2f_no_substrate_seed0,test_fibro_1kPa_setIII,none,17,0.0032853256322114355,0.0036911020409445944,0.8633440487525043,0.03764468077155762,0.5585545148746852,0.18471131391558185,0.7263459177578196,0.08455485070976279,24.97328571317827,9.45682709856301,10.87999327436966,6.454777878227879,0.0,0.0,0.004647829953361912,0.4356652704545139
400
+ s2f_no_substrate_seed0,test_fibro_DMSO_setI,none,27,0.00498858996541924,0.004629243911676816,0.8982188613326462,0.05602221292990747,0.7273164300501479,0.11037116299309724,0.5995595962912948,0.08578336983294695,22.690155784840936,9.653348226275018,14.556477225765034,6.628285465990541,0.0011002929122359444,0.0017828783273705856,0.004408165260597462,0.6415327141777524
401
+ s2f_no_substrate_seed0,test_fibro_DMSO_setII,none,11,0.006491170857440291,0.004620413927589039,0.8794515024531971,0.04185982302118295,0.74866250201957,0.07625505683302651,0.6242583421143618,0.10018535516915326,26.922392574223604,8.656309600517519,14.605643143030731,7.488299172369105,0.0009989304976029546,0.001193270015423396,0.004554596814242227,0.5425091066020136
402
+ s2f_no_substrate_seed0,test_fibro_TGFb_setI,none,15,0.00818974082358178,0.00626542990697831,0.793100635210673,0.050975727049602314,0.6329779085801042,0.10009203778023723,0.8607578595479329,0.06322202563385705,24.50147196650505,8.277265561301697,3.557318549913665,1.4454067348745578,0.0006481806437174341,0.0010562970743840123,0.004467201232910107,0.14518795257594025
403
+ s2f_no_substrate_seed0,test_fibro_Y27632_setI,none,16,0.0021642479186993625,0.002646824076747542,0.8724521808326244,0.028080608292072977,0.33559256421025013,0.28729446659982505,0.8051880672574043,0.107266925043099,17.703224846627563,7.054585229165719,8.09546431992203,5.272167373675125,2.723932266235e-05,0.00010895729064939998,0.004250407218933062,0.45728755015299954
404
+ s2f_no_substrate_seed0,test_fibro_Y27632_setII,none,20,0.002479387648054355,0.0022552043907653418,0.9130702883005142,0.027117665603106553,0.6970579793253251,0.13756860741656335,0.6445961490273475,0.15630959199388966,17.667164374142885,4.543927795924835,16.21424127370119,6.933451746610353,5.369186401366938e-05,0.00016632603301397394,0.00424978733062738,0.9177613866225104
405
+ s2f_no_substrate_seed0,test_fibro_fibronectin_setI,none,40,0.00256250997190359,0.0020870258011828355,0.9099225625395775,0.03452747715479902,0.6848560205911453,0.13370096351333266,0.6026169180870056,0.07649649229332839,18.936000810936093,6.40314149380327,11.899125028867275,4.891614814857005,0.000261020660400378,0.0006666419848302161,0.0042879998683929,0.6283863814578621
406
+ s2f_no_substrate_seed0,test_u2os_6kPa,none,39,0.02594394440977614,0.016586386430795522,0.614406338868997,0.08916053748156616,0.30383829631564335,0.1584402337356263,0.7847096308683738,0.0800902869078907,72.38253683615953,22.514049794991656,24.342214688658714,11.23937973777654,0.0023382871578900974,0.004895436215126899,0.004385556930150674,0.3362995516965396
407
+ s2f_no_substrate_seed0,zenodo_v1_test,none,46,0.007400309244352952,0.006408305328076324,0.8850695944350698,0.04392544065223393,0.7285528152116086,0.08901451047634606,0.6575638677762903,0.0933789815248257,26.68617501773912,13.512588866281218,17.906092967757065,8.539865649646641,0.002364386682924989,0.003851346753000209,0.004391836083453574,0.6709876164663664
408
+ s2f_no_substrate_seed1,alltune_val,none,81,0.005956001030022438,0.006885230239235322,0.9018691962147937,0.04328746573668415,0.7264675672206247,0.118857263649371,0.6028929459459987,0.08042727712697072,24.59675819831498,12.09090158606753,13.828027918704866,4.153677066951064,0.002138373292522645,0.003586675581752635,0.004395502584951834,0.5621890416295658
409
+ s2f_no_substrate_seed1,test_fibro_1kPa_setIII,none,17,0.002796559217933735,0.003620707340892184,0.8808423596269944,0.03602239153195617,0.6129261080591188,0.1766443919958361,0.6817729438052458,0.07465250594431415,24.97328571317827,9.45682709856301,10.435045642011305,2.660703524639384,0.0,0.0,0.004529518239638336,0.4178483264821171
410
+ s2f_no_substrate_seed1,test_fibro_DMSO_setI,none,27,0.004842698921156233,0.004845658607308818,0.9030451642142402,0.0550687232840656,0.7559775213763033,0.09621503751228515,0.5883160564634535,0.06903982730163202,22.690155784840936,9.653348226275018,12.760717697717526,2.9239944054418903,0.0011002929122359444,0.0017828783273705856,0.004522579687612974,0.5623900434497163
411
+ s2f_no_substrate_seed1,test_fibro_DMSO_setII,none,11,0.006133073718625673,0.004681497712413217,0.8926492116668008,0.03741355876079262,0.7985017521425607,0.07075859785650414,0.5862573005936362,0.09676891282483573,26.922392574223604,8.656309600517519,12.840691149573434,3.576249005149851,0.0009989304976029546,0.001193270015423396,0.004636612805453146,0.47695208047250376
412
+ s2f_no_substrate_seed1,test_fibro_TGFb_setI,none,15,0.006611817462059307,0.005193215618131214,0.8853791395823161,0.04591175739892129,0.6618331908331269,0.10766547771671947,0.65476127465566,0.06327355810343926,24.50147196650505,8.277265561301697,9.79080560306708,1.2811871879431431,0.0006481806437174341,0.0010562970743840123,0.004533068339029893,0.3996007103757556
413
+ s2f_no_substrate_seed1,test_fibro_Y27632_setI,none,16,0.0019246746196585687,0.002474348502142866,0.9122877456247807,0.026163164636889034,0.3531353357458934,0.30606421342557555,0.7109610363841057,0.09399725721871027,17.703224846627563,7.054585229165719,11.59796564024873,3.607571937086301,2.723932266235e-05,0.00010895729064939998,0.0041289478540420125,0.6551329342946308
414
+ s2f_no_substrate_seed1,test_fibro_Y27632_setII,none,20,0.00198277587769549,0.0011675730538776333,0.9205920219421386,0.028101061437466247,0.7226227424527251,0.1412508653475486,0.5953339472413063,0.1095054575018648,17.667164374142885,4.543927795924835,13.405058439821005,2.7413659877716325,5.369186401366938e-05,0.00016632603301397394,0.00447138547897332,0.7587555170675965
415
+ s2f_no_substrate_seed1,test_fibro_fibronectin_setI,none,40,0.00290653421689053,0.0029924332029782653,0.9050060629844665,0.04473654623010389,0.6983888994370772,0.12354518397893957,0.6263985753059387,0.08800999836339071,18.936000810936093,6.40314149380327,9.388699976261705,2.189993108628912,0.000261020660400378,0.0006666419848302161,0.0044522166252135755,0.4958121870611379
416
+ s2f_no_substrate_seed1,test_u2os_6kPa,none,39,0.027006950802527897,0.01915385490887696,0.6184915143709916,0.08817434272414917,0.2990628251947941,0.166388230817163,0.8026611804962158,0.05622527266271162,72.38253683615953,22.514049794991656,17.594110328131,6.58832208484115,0.0023382871578900974,0.004895436215126899,0.00446162468347788,0.24307120332015855
417
+ s2f_no_substrate_seed1,zenodo_v1_test,none,46,0.007388410606401237,0.0081490482619423,0.8972046310487001,0.04918373198321073,0.7695797627344162,0.07816217930799868,0.5984317828779635,0.0784944220220804,26.68617501773912,13.512588866281218,14.261498308295142,4.484424374613189,0.002364386682924989,0.003851346753000209,0.0042659718057383176,0.5344152280652842
418
+ stage1_image_only,alltune_val,none,81,0.006152135759798968,0.005197399057892214,0.8894352912902832,0.04067220266835748,0.6886789973236269,0.1331715460392659,0.6880884424403861,0.22398842819570877,24.59675819831498,12.09090158606753,20.078738323516315,7.698807110445672,0.002138373292522645,0.003586675581752635,0.004383558108482785,0.8163164495755308
419
+ stage1_image_only,test_fibro_1kPa_setIII,none,17,0.00608556946356064,0.004653140850665439,0.8754840352955986,0.031592957728404036,0.6159350286030835,0.1568306183956502,0.7717524661737329,0.12389168980119193,24.97328571317827,9.45682709856301,18.6689187608221,5.844196736581263,0.0,0.0,0.0046471146976245995,0.7475555669861499
420
+ stage1_image_only,test_fibro_DMSO_setI,none,27,0.004535511489612581,0.003151084853860642,0.8951396986290261,0.04699274980054576,0.7440344503991725,0.07974033031232931,0.6527206941887185,0.07494364885767464,22.690155784840936,9.65334822627502,18.201678887837463,7.356558490960521,0.0011002929122359444,0.0017828783273705856,0.004522058698866056,0.802183954153273
421
+ stage1_image_only,test_fibro_DMSO_setII,none,11,0.00598911399191071,0.0027780948337919878,0.8938964767889543,0.028034135663031444,0.785622839722247,0.06563863597188895,0.6102587391029705,0.06969724437694105,26.922392574223604,8.656309600517519,23.182478818026457,7.074244268163167,0.0009989304976029546,0.001193270015423396,0.004727255214344319,0.8610853866020115
422
+ stage1_image_only,test_fibro_TGFb_setI,none,15,0.00636611618101592,0.003228687329520828,0.8981391867001851,0.03592569842727307,0.656847773181309,0.12015999586589923,0.6763573090235392,0.11771460683719792,24.50147196650505,8.277265561301698,21.209169924259186,5.880026110410783,0.0006481806437174341,0.0010562970743840123,0.0047393957773843925,0.8656283978878234
423
+ stage1_image_only,test_fibro_Y27632_setI,none,16,0.011111548839835388,0.00611195895687479,0.8893611170351505,0.03451472902175742,0.3510870106222347,0.2841542511144262,1.1834550276398659,0.4380329407114071,17.703224846627563,7.054585229165719,26.360932854004204,13.356368562601821,2.723932266235e-05,0.00010895729064939998,0.004376158118247925,1.4890469438411906
424
+ stage1_image_only,test_fibro_Y27632_setII,none,20,0.00618784942198541,0.0034534858169003374,0.8966459959745408,0.029734146707084057,0.7124459773740204,0.11866913743001065,0.9073350816965103,0.30655766187060857,17.667164374142885,4.5439277959248345,20.98967949859798,4.946596455537543,5.369186401366938e-05,0.00016632603301397394,0.00440083742141718,1.1880615957429945
425
+ stage1_image_only,test_fibro_fibronectin_setI,none,40,0.0038155761227244072,0.0021298740508979884,0.9057704076170922,0.035629500919882595,0.7221371177176458,0.10426675501197195,0.7010910183191299,0.1762966956115447,18.936000810936093,6.40314149380327,17.315664049237967,4.69476669623596,0.000261020660400378,0.0006666419848302161,0.004400318861007635,0.9144308886614361
426
+ stage1_image_only,test_u2os_6kPa,none,39,0.028107271720774613,0.015054990698095192,0.5925251451822428,0.07874136082131679,0.2839312720271035,0.163697968062445,0.7958607979309864,0.15857595150229462,72.38253683615953,22.514049794991656,50.79323125000183,22.18890486119771,0.0023382871578900974,0.004895436215126899,0.004577850684141436,0.701733228347248
427
+ stage1_image_only,zenodo_v1_test,none,46,0.006657953482910778,0.006211471304150571,0.8848133696162183,0.04644428609303831,0.7262762656822205,0.10867233952893747,0.6347961788592131,0.12687178544588726,26.68617501773912,13.512588866281218,20.18482863660092,8.079961847643782,0.002364386682924989,0.003851346753000209,0.004369746083798565,0.756377735782046
428
+ supervised_spheroid_FN,spheroid_val,none,28,0.012721961114688596,0.004821648802264053,0.791937095778329,0.04293594642332129,0.877946714449,0.0838834982047096,0.4360183839287077,0.126400407403286,8.515775283532482,2.206210863837729,8.781364427081176,1.3781254844840514,0.008846793855939564,0.015233062860168744,0.0020002382142202714,1.0311878994813637
429
+ unet_gan_no_substrate_seed0,alltune_val,none,81,0.007110126288880733,0.007931535678309409,0.8868687042483577,0.04367922181373004,0.6449097036056178,0.13033880000071488,0.676191211482625,0.09293977510416296,24.59675819831498,12.09090158606753,13.208412329585832,3.6877699615237307,0.002138373292522645,0.003586675581752635,0.0009261767069498222,0.5369980963788424
430
+ unet_gan_no_substrate_seed0,test_fibro_1kPa_setIII,none,17,0.0028645559967330585,0.003529062307323367,0.8738383826087502,0.033022911737257535,0.5751061763410374,0.1707178139269341,0.6832290782647974,0.06303838467485426,24.97328571317827,9.45682709856301,8.957122507340769,1.5706371336017428,0.0,0.0,0.000823806313907353,0.3586681628606901
431
+ unet_gan_no_substrate_seed0,test_fibro_DMSO_setI,none,27,0.005474153194679926,0.005780994878684663,0.8905841796486466,0.05775693996671411,0.7186275399754303,0.08593411771866423,0.6324638172432229,0.06816100599709457,22.690155784840936,9.653348226275018,11.729184917553708,3.107381278888618,0.0011002929122359444,0.0017828783273705856,0.0007776684231227778,0.5169283555730304
432
+ unet_gan_no_substrate_seed0,test_fibro_DMSO_setII,none,11,0.0078330669784918,0.004783157993994559,0.8648108460686423,0.040571198776903024,0.7037756944691389,0.060570293995505495,0.6947660771283236,0.06991115311917431,26.922392574223604,8.656309600517519,9.631484789265828,2.2679648675153974,0.0009989304976029546,0.001193270015423396,0.0007274150848388183,0.3577499571300113
433
+ unet_gan_no_substrate_seed0,test_fibro_TGFb_setI,none,15,0.006878551833021074,0.005333956016830964,0.847029201189677,0.04607122347327515,0.6241266846327905,0.08257712404693716,0.7537199974060058,0.047051113896271375,24.50147196650505,8.277265561301697,6.930510078867276,1.7763310332095081,0.0006481806437174341,0.0010562970743840123,0.0008666515350341466,0.282860968040683
434
+ unet_gan_no_substrate_seed0,test_fibro_Y27632_setI,none,16,0.0022823720209998563,0.0025754554003426587,0.8750228546559811,0.03314318207867343,0.34956343730336314,0.25646344406385785,0.8119308277964592,0.08976495336984629,17.703224846627563,7.054585229165719,8.264638076070696,2.03123932583938,2.723932266235e-05,0.00010895729064939998,0.0008131116628646375,0.46684364841274084
435
+ unet_gan_no_substrate_seed0,test_fibro_Y27632_setII,none,20,0.002410341575159645,0.0014399240480382637,0.9027249872684479,0.0274830608544369,0.6484961118156737,0.1277846225693392,0.64908427298069,0.05748612036876584,17.667164374142885,4.543927795924835,10.198309179395437,2.0684265688934853,5.369186401366938e-05,0.00016632603301397394,0.0009002089500427,0.5772465214803438
436
+ unet_gan_no_substrate_seed0,test_fibro_fibronectin_setI,none,40,0.0034315999095269377,0.003374591637629618,0.9068501338362693,0.04116159599132644,0.632939231168137,0.18176873573675925,0.6235659018158912,0.09320960640846672,18.936000810936093,6.40314149380327,9.63957014027983,2.215524675284799,0.000261020660400378,0.0006666419848302161,0.0007002174854278101,0.5090605052526559
437
+ unet_gan_no_substrate_seed0,test_u2os_6kPa,none,39,0.027033175616405662,0.02053382389655254,0.618600165996796,0.09360228077931716,0.2469951015073029,0.1279749345771713,0.7816948707287128,0.05500199019268074,72.38253683615953,22.514049794991656,18.078694549890663,4.453574340990637,0.0023382871578900974,0.004895436215126899,0.0008463798425136052,0.24976597035846418
438
+ unet_gan_no_substrate_seed0,zenodo_v1_test,none,46,0.009090406420316655,0.009162996694849367,0.8780113238355388,0.0473497896225869,0.6782812449336312,0.09354894529617125,0.7042871519275333,0.09823410561222727,26.68617501773912,13.512588866281218,13.209375593325365,3.715715821991453,0.002364386682924989,0.003851346753000209,0.0008699064669401305,0.49498946868723925
439
+ unet_gan_no_substrate_seed1,alltune_val,none,81,0.007545894646390441,0.008102724891582388,0.8847817094237717,0.04902324639349142,0.5883212416551665,0.1474671968992294,0.6817748679055108,0.085178152092677,24.59675819831498,12.09090158606753,11.636145631380288,2.8778345582416396,0.002138373292522645,0.003586675581752635,0.0008026258445079976,0.4730763923262632
440
+ unet_gan_no_substrate_seed1,test_fibro_1kPa_setIII,none,17,0.003215255256851759,0.0037229387513900763,0.8616151143522823,0.03591953679938062,0.5081683167402383,0.20142510665274932,0.7297108944724587,0.07598010942146109,24.97328571317827,9.45682709856301,9.064630413537516,2.2332506952919435,0.0,0.0,0.0007648187525131589,0.36297307921937394
441
+ unet_gan_no_substrate_seed1,test_fibro_DMSO_setI,none,27,0.006099744790440582,0.005890867874655551,0.8937629814501162,0.05176985303997429,0.6248838617053475,0.09813404118054046,0.6395866804652743,0.06432920942517506,22.690155784840936,9.653348226275018,11.50595652008498,2.268640956321618,0.0011002929122359444,0.0017828783273705856,0.0007037410029658149,0.5070902390089359
442
+ unet_gan_no_substrate_seed1,test_fibro_DMSO_setII,none,11,0.008083127269690637,0.005265395023054257,0.8658393892374906,0.03775344328509625,0.6095223888217908,0.08655870429496273,0.7066235596483404,0.06178629983502124,26.922392574223604,8.656309600517519,9.469131812114608,2.0625514815693418,0.0009989304976029546,0.001193270015423396,0.000818014144897409,0.35171955040803726
443
+ unet_gan_no_substrate_seed1,test_fibro_TGFb_setI,none,15,0.007159132409530327,0.005750421375014546,0.8811055223147074,0.046507680231069985,0.49188387439328873,0.08037763152607716,0.6599311232566833,0.06681361099885405,24.50147196650505,8.277265561301697,11.052867646018663,1.471664804399314,0.0006481806437174341,0.0010562970743840123,0.0008667151133218934,0.4511103521098072
444
+ unet_gan_no_substrate_seed1,test_fibro_Y27632_setI,none,16,0.002849142751074356,0.0031153099780753483,0.8862025961279869,0.03977416796215143,0.2857997347384637,0.22328610075477565,0.7828864604234695,0.08677939301331013,17.703224846627563,7.054585229165719,9.147892065811902,2.0856706693105154,2.723932266235e-05,0.00010895729064939998,0.000875160098075825,0.5167359136578193
445
+ unet_gan_no_substrate_seed1,test_fibro_Y27632_setII,none,20,0.0029422997555229352,0.0015792422549509681,0.9012894630432129,0.031778549432428284,0.5877366147298236,0.13442469707174168,0.6703198045492172,0.09406098160583451,17.667164374142885,4.543927795924835,10.265733930282295,2.4459018123072203,5.369186401366938e-05,0.00016632603301397394,0.00074961185455319,0.5810629092978218
446
+ unet_gan_no_substrate_seed1,test_fibro_fibronectin_setI,none,40,0.0033935087689314475,0.0033662158510656998,0.8966212302446366,0.04513849439469155,0.621858132757507,0.14798430865155843,0.6508893713355064,0.10005930104643272,18.936000810936093,6.40314149380327,8.572974537673872,2.289148026211758,0.000261020660400378,0.0006666419848302161,0.000780338048934885,0.45273416616684603
447
+ unet_gan_no_substrate_seed1,test_u2os_6kPa,none,39,0.025156569631340362,0.0183061669229949,0.6001567252171345,0.0868426612293877,0.22726862240783335,0.13976234096347442,0.7632809999661568,0.05243945513378061,72.38253683615953,22.514049794991656,27.842097891828953,10.226323326321737,0.0023382871578900974,0.004895436215126899,0.0008719823299309693,0.38465214275164933
448
+ unet_gan_no_substrate_seed1,zenodo_v1_test,none,46,0.009465944816601294,0.009431984840548632,0.8713209227375363,0.053505809169738405,0.6217507701462954,0.10684328603468805,0.7167643049488897,0.0661944918849691,26.68617501773912,13.512588866281218,11.25701759820399,3.0843732305447173,0.002364386682924989,0.003851346753000209,0.0007610113724417957,0.4218295649609247
449
+ unet_gan_seed0,alltune_val,legacy,81,0.008896755340601052,0.009666847556706673,0.8856365121441123,0.04503096402228058,0.44311364702987427,0.25641649481472994,0.7338594514646648,0.11617726909899273,24.59675819831498,12.09090158606753,11.415637523671727,3.416048723195492,0.002138373292522645,0.003586675581752635,0.0010761920316719408,0.4641114667075828
450
+ unet_gan_seed0,test_fibro_1kPa_setIII,legacy,17,0.002861085115000547,0.003519745732761128,0.8894201026243322,0.03402468913413564,0.506094178827618,0.19625827641725022,0.6384491955532747,0.07176174043150726,24.97328571317827,9.45682709856301,10.189796085743343,1.8211739778707572,0.0,0.0,0.0011312540839699765,0.4080278503507547
451
+ unet_gan_seed0,test_fibro_DMSO_setI,legacy,27,0.006817517621028703,0.006557109772478235,0.8881449677326061,0.05762871065732718,0.5672109531800837,0.20468851200284974,0.6721662856914379,0.07907325907616997,22.690155784840936,9.653348226275018,10.157643093003166,1.3463450154786165,0.0011002929122359444,0.0017828783273705856,0.0010856080938268222,0.4476674020805703
452
+ unet_gan_seed0,test_fibro_DMSO_setII,legacy,11,0.009159973251040647,0.005944136982825366,0.8729555335911837,0.03680210829948178,0.5904003539554601,0.12212289381356448,0.7097411101514642,0.059527843161020486,26.922392574223604,8.656309600517519,8.907611016184092,1.8902033407047922,0.0009989304976029546,0.001193270015423396,0.0011351108551025091,0.3308625335443825
453
+ unet_gan_seed0,test_fibro_TGFb_setI,legacy,15,0.007735271456961773,0.006199777236688587,0.8838155229886373,0.04721641435019445,0.47962963184776697,0.1037623303385278,0.6638339161872864,0.08285822467745926,24.50147196650505,8.277265561301697,10.147598199546337,1.6181507552330459,0.0006481806437174341,0.0010562970743840123,0.0011806646982828466,0.4141627986032308
454
+ unet_gan_seed0,test_fibro_Y27632_setI,legacy,16,0.002558477615821119,0.00367504826954948,0.9006644077599049,0.03630259593426026,0.27281412531119653,0.2066967487466184,0.7343357838690281,0.07039040539978343,17.703224846627563,7.054585229165719,9.021019475767389,1.5426694778682797,2.723932266235e-05,0.00010895729064939998,0.0009641200304031,0.5095692764409463
455
+ unet_gan_seed0,test_fibro_Y27632_setII,legacy,20,0.002935759944375555,0.0021178801193124925,0.9118422031402588,0.029929833701287545,0.5185496980953312,0.2265668223721441,0.6311286121606827,0.0831322772473751,17.667164374142885,4.543927795924835,9.291185229085386,1.77394867182248,5.369186401366938e-05,0.00016632603301397394,0.00108236074447628,0.525901329286531
456
+ unet_gan_seed0,test_fibro_fibronectin_setI,legacy,40,0.003814059103024142,0.003769395367029528,0.9127391576766968,0.042612474092440726,0.5775882613252327,0.19506691748540458,0.6067270435392856,0.10041230162291143,18.936000810936093,6.40314149380327,8.942449605092406,0.9192021384241391,0.000261020660400378,0.0006666419848302161,0.00098379850387569,0.47224594540193937
457
+ unet_gan_seed0,test_u2os_6kPa,legacy,39,0.027285520572406314,0.02054482918029977,0.6023936424499903,0.09196777872896694,0.2509465956342824,0.1285479399614382,0.8007107560451214,0.05035910187679719,72.38253683615953,22.514049794991656,18.576295568774906,6.608298321123872,0.0023382871578900974,0.004895436215126899,0.0011268273378029462,0.25664057078882185
458
+ unet_gan_seed0,zenodo_v1_test,legacy,46,0.010349244145048817,0.010614743420698063,0.8777541984682498,0.05027761595769469,0.6043250745242503,0.11782006112679133,0.7247807241004446,0.08841426955953365,26.68617501773912,13.512588866281218,11.533397928123241,2.309558173251458,0.002364386682924989,0.003851346753000209,0.001140641129535139,0.43218625076305006
459
+ unet_gan_seed1,alltune_val,legacy,81,0.008463837237263992,0.008643803826793093,0.8485986597744035,0.062351256277883245,0.36853869888381025,0.34058314877982687,0.8090631505589426,0.14113198529161844,24.59675819831498,12.09090158606753,9.316242166311929,7.391196488231451,0.002138373292522645,0.003586675581752635,0.0010525827054623839,0.3787589442152643
460
+ unet_gan_seed1,test_fibro_1kPa_setIII,legacy,17,0.003087790001539794,0.0032570815930959415,0.8754880498437321,0.03547666042825058,0.5702642694185898,0.16346834141804212,0.6815485042684218,0.10823322736899739,24.97328571317827,9.45682709856301,11.881190352141857,3.9905472608418466,0.0,0.0,0.001291148802813306,0.4757559933682341
461
+ unet_gan_seed1,test_fibro_DMSO_setI,legacy,27,0.005805163991344286,0.005730935674564853,0.8710532409173471,0.0635984036549269,0.6814040526699349,0.10566217422085833,0.7089556764673304,0.06597642743390736,22.690155784840936,9.653348226275018,8.713901853533807,2.562661399150049,0.0011002929122359444,0.0017828783273705856,0.001111560397677911,0.38403887289991534
462
+ unet_gan_seed1,test_fibro_DMSO_setII,legacy,11,0.007571573475037063,0.004932103096493074,0.8661844459446993,0.03194648952318592,0.6261719487554713,0.0982516163356674,0.7018440149047158,0.05703068367109283,26.922392574223604,8.656309600517519,11.435860513963483,4.064228108025979,0.0009989304976029546,0.001193270015423396,0.0010242678902365454,0.4247713304987818
463
+ unet_gan_seed1,test_fibro_TGFb_setI,legacy,15,0.0063831371565659266,0.004708021155345677,0.8892816106478373,0.04118176950248778,0.5280949847761387,0.0876171280220849,0.6313014189402263,0.11100081522529394,24.50147196650505,8.277265561301697,19.224934776624043,2.0311413828146248,0.0006481806437174341,0.0010562970743840123,0.0011747678120930733,0.7846440737481265
464
+ unet_gan_seed1,test_fibro_Y27632_setI,legacy,16,0.0037228848668746125,0.002667254265638723,0.8983138538897038,0.03826431673555708,0.2753003479237422,0.20590043281777404,0.79309968277812,0.14142831596451,17.703224846627563,7.054585229165719,14.316206914372742,3.507119908601787,2.723932266235e-05,0.00010895729064939998,0.0010445415973662875,0.8086779125499249
465
+ unet_gan_seed1,test_fibro_Y27632_setII,legacy,20,0.002794922274188075,0.0016998947375520758,0.891304737329483,0.03352278985509912,0.6289526739852188,0.14596615618843345,0.7136506229639054,0.083871311489084,17.667164374142885,4.543927795924835,9.905006503686309,2.9332273706638943,5.369186401366938e-05,0.00016632603301397394,0.0010547041893004898,0.5606449509341165
466
+ unet_gan_seed1,test_fibro_fibronectin_setI,legacy,40,0.003250861511332862,0.003441318689763804,0.8963666707277298,0.04796957884301842,0.6662179562420488,0.12866429824961675,0.6585755400359631,0.08826350434052695,18.936000810936093,6.40314149380327,8.858292270451784,2.405045234263453,0.000261020660400378,0.0006666419848302161,0.000986766815185505,0.46780164190402135
467
+ unet_gan_seed1,test_u2os_6kPa,legacy,39,0.023859886894336834,0.017164497730959304,0.6057904064655304,0.0869881750560279,0.26165326340819783,0.12558636648246074,0.7230575222235459,0.05510360845552232,72.38253683615953,22.514049794991656,32.99379673523781,11.668345360950902,0.0023382871578900974,0.004895436215126899,0.0011087319789788205,0.45582537138647755
468
+ unet_gan_seed1,zenodo_v1_test,legacy,46,0.008605520499100778,0.008641334619750845,0.8744173879208772,0.04821787508181828,0.648023035757245,0.11617008614369323,0.7234572418358015,0.11574815994957705,26.68617501773912,13.512588866281218,14.881438433962023,4.623587120521901,0.002364386682924989,0.003851346753000209,0.0011075890582540391,0.557645988009517
469
+ unet_no_substrate_seed0,alltune_val,none,81,0.006979805700492384,0.008197433131021949,0.8965202422789585,0.04320632525213128,0.6924084978435667,0.15240861269782188,0.6456945711447869,0.11211702831737828,24.59675819831498,12.09090158606753,12.80053825704036,1.941329625904119,0.002138373292522645,0.003586675581752635,0.0007950141106122383,0.5204156642852744
470
+ unet_no_substrate_seed0,test_fibro_1kPa_setIII,none,17,0.002655270759372312,0.0034300713914118125,0.8915993992020103,0.05023486193095585,0.6140884622945793,0.18761464159993707,0.621740418321946,0.11792132873771213,24.97328571317827,9.45682709856301,11.790571186472388,2.76186865327146,0.0,0.0,0.0009414869196274411,0.47212734927589306
471
+ unet_no_substrate_seed0,test_fibro_DMSO_setI,none,27,0.005540574873857912,0.005810385784504729,0.9025429465152599,0.05503802974838969,0.7331505127747888,0.09614053493077895,0.592307898733351,0.08328851044438451,22.690155784840936,9.653348226275018,11.63535516847063,1.515919271422916,0.0011002929122359444,0.0017828783273705856,0.0007411462289315223,0.5127930931282584
472
+ unet_no_substrate_seed0,test_fibro_DMSO_setII,none,11,0.006518047070130654,0.004458100186546832,0.8933131098747253,0.032482507729852395,0.7462393260539575,0.06566382093726619,0.5990639708258889,0.07064696325754424,26.922392574223604,8.656309600517519,13.050546700304205,2.084977049233175,0.0009989304976029546,0.001193270015423396,0.0010906349528919182,0.48474691334823017
473
+ unet_no_substrate_seed0,test_fibro_TGFb_setI,none,15,0.0062191579840145455,0.005247627661531973,0.8839654326438904,0.04402523011038894,0.6424484910165181,0.10192854596962078,0.6490398168563842,0.0600502928800729,24.50147196650505,8.277265561301697,10.35505427668492,1.2601253206856016,0.0006481806437174341,0.0010562970743840123,0.00087536176045732,0.42262988488368725
474
+ unet_no_substrate_seed0,test_fibro_Y27632_setI,none,16,0.0021921655279583748,0.0022924013406008205,0.9081759452819824,0.036747162947400464,0.3633264646146958,0.25978721718066644,0.6959067322313786,0.092844539230188,17.703224846627563,7.054585229165719,12.177440745290369,3.2843484628768023,2.723932266235e-05,0.00010895729064939998,0.0007499754428863125,0.6878656770611007
475
+ unet_no_substrate_seed0,test_fibro_Y27632_setII,none,20,0.00209595464984881,0.0013535009784702433,0.9232022881507873,0.026479926112329306,0.6866655698024176,0.1376552733471021,0.5542190030217171,0.06710602414772301,17.667164374142885,4.543927795924835,12.993147410452366,2.3545751112778386,5.369186401366938e-05,0.00016632603301397394,0.0007997632026671799,0.7354404552588379
476
+ unet_no_substrate_seed0,test_fibro_fibronectin_setI,none,40,0.00304757874109777,0.003318005866790576,0.9087060451507568,0.058670004910280286,0.6695466162273791,0.17959071544248326,0.5763051636517048,0.15598083216300265,18.936000810936093,6.40314149380327,10.300773304767574,2.9281725163061965,0.000261020660400378,0.0006666419848302161,0.0008251786231994251,0.5439782881092071
477
+ unet_no_substrate_seed0,test_u2os_6kPa,none,39,0.026837067499470197,0.02049363826068112,0.6083701130671378,0.09122354933205411,0.27336321337682024,0.13538433996984403,0.7855739043309138,0.04766878625014532,72.38253683615953,22.514049794991656,17.57308253302024,4.319806079069399,0.0023382871578900974,0.004895436215126899,0.0007948447496462744,0.24278069408920475
478
+ unet_no_substrate_seed0,zenodo_v1_test,none,46,0.008796959138556293,0.009604988928716142,0.8879453565763391,0.047774744695816225,0.7367108236496638,0.09713326825363923,0.6678279605896577,0.10115120137813564,26.68617501773912,13.512588866281218,13.143549146859542,2.04356517567875,0.002364386682924989,0.003851346753000209,0.0006957831590071522,0.49252278148227013
479
+ unet_no_substrate_seed1,alltune_val,none,81,0.007933399191788745,0.009074640166986912,0.8925063220071204,0.045772531502667094,0.6288075387589437,0.14738922431110474,0.6632690113267781,0.10630234596334064,24.59675819831498,12.09090158606753,11.51571103176217,1.7737380566101122,0.002138373292522645,0.003586675581752635,0.0008273536776318556,0.4681800316494985
480
+ unet_no_substrate_seed1,test_fibro_1kPa_setIII,none,17,0.0029091733706402296,0.003646898125151408,0.889901876449585,0.03569597796790269,0.4799167027724973,0.24133784675948106,0.6406881528742173,0.07944605497038089,24.97328571317827,9.45682709856301,9.894522810902666,1.478323349273483,0.0,0.0,0.000883649377261853,0.3962042850325209
481
+ unet_no_substrate_seed1,test_fibro_DMSO_setI,none,27,0.006413075505945504,0.006343344518715402,0.8992119740556788,0.05491150240432412,0.6671410694960616,0.11464597021660021,0.6183865611199979,0.07759299637508874,22.690155784840936,9.653348226275018,10.761577808470637,1.4017549004770096,0.0011002929122359444,0.0017828783273705856,0.0008147380970142185,0.47428399833465834
482
+ unet_no_substrate_seed1,test_fibro_DMSO_setII,none,11,0.008412618676877781,0.005329096557874965,0.8844641663811423,0.03367089933304919,0.6178300733394487,0.1329774942147189,0.6553465182130987,0.06697203501293034,26.922392574223604,8.656309600517519,11.075035160915418,1.9258353494958744,0.0009989304976029546,0.001193270015423396,0.0009093284606933182,0.4113689052851501
483
+ unet_no_substrate_seed1,test_fibro_TGFb_setI,none,15,0.007257875947592094,0.005760307476694916,0.8861749807993571,0.04281662135681882,0.5018684002665604,0.08314437964771465,0.6227045337359111,0.06914515621515495,24.50147196650505,8.277265561301697,12.023165014882883,0.8533176244684136,0.0006481806437174341,0.0010562970743840123,0.0010000705718993667,0.4907119470748229
484
+ unet_no_substrate_seed1,test_fibro_Y27632_setI,none,16,0.002144944106475975,0.003666359649526131,0.9168362766504288,0.03957343809307531,0.2814971282846513,0.21891152299453076,0.6215785555541515,0.06711916862036713,17.703224846627563,7.054585229165719,9.994790540076792,1.116403051708918,2.723932266235e-05,0.00010895729064939998,0.00081308186054225,0.5645745691345486
485
+ unet_no_substrate_seed1,test_fibro_Y27632_setII,none,20,0.00262913280894277,0.0018383041658014871,0.9169821381568909,0.028365170577891886,0.5792773798088493,0.17424937528416862,0.5840459361672401,0.07459840885576016,17.667164374142885,4.543927795924835,11.37109324336052,1.5040466424703776,5.369186401366938e-05,0.00016632603301397394,0.00087540149688716,0.6436286549754923
486
+ unet_no_substrate_seed1,test_fibro_fibronectin_setI,none,40,0.003789891613996535,0.003783737345638713,0.9141823709011078,0.043491921339969805,0.5344625481336307,0.21672890184285318,0.5874574169516563,0.11511750082756109,18.936000810936093,6.40314149380327,9.375950659159571,1.332600162490109,0.000261020660400378,0.0006666419848302161,0.0008254587650298649,0.49513890249437914
487
+ unet_no_substrate_seed1,test_u2os_6kPa,none,39,0.027875341540680047,0.020912424397394932,0.6080871216761761,0.0926872050860862,0.23941356086165066,0.1427563488662741,0.8006347830478961,0.052452604421357525,72.38253683615953,22.514049794991656,15.682435284058252,4.549663549928541,0.0023382871578900974,0.004895436215126899,0.0008208629412528385,0.21666048151304793
488
+ unet_no_substrate_seed1,zenodo_v1_test,none,46,0.009963816768267028,0.010426644957591909,0.8827077228090038,0.050228906078909764,0.6549511579159091,0.1196643846122939,0.6922626041847727,0.09932212428248685,26.68617501773912,13.512588866281218,12.06029817947875,1.8191895728733705,0.002364386682924989,0.003851346753000209,0.0007175051647683478,0.45193056597515
489
+ unet_seed0,alltune_val,legacy,81,0.00894211452270359,0.009867072640838465,0.8827742374973533,0.04789295904474347,0.5023366934376498,0.2707398299769022,0.7372302287890588,0.09552188633565857,24.59675819831498,12.09090158606753,8.711392654933864,3.4812716953623415,0.002138373292522645,0.003586675581752635,0.001084916385603495,0.3541683251384991
490
+ unet_seed0,test_fibro_1kPa_setIII,legacy,17,0.003268220215378388,0.0037595277380528306,0.8833158577189726,0.03986030707521417,0.47657472276656265,0.1734561661948203,0.6810622145147884,0.08653970127973955,24.97328571317827,9.45682709856301,8.021491168833832,1.2931544702176891,0.0,0.0,0.0009864919325884413,0.32120287498256317
491
+ unet_seed0,test_fibro_DMSO_setI,legacy,27,0.007008928583538175,0.007107914964803601,0.8990774596178973,0.05499852265046698,0.6607050268548635,0.12153031850309934,0.6376839986553898,0.08378485947187085,22.690155784840936,9.653348226275018,9.844316824994705,1.2951467346129462,0.0011002929122359444,0.0017828783273705856,0.001122651276765011,0.433858494333106
492
+ unet_seed0,test_fibro_DMSO_setII,legacy,11,0.00984026997519482,0.006172265460423406,0.8790992010723461,0.03658704141181812,0.5394952045524914,0.17443503850716813,0.7111577174880288,0.07571095640017261,26.922392574223604,8.656309600517519,8.65740261294625,1.4336317360162332,0.0009989304976029546,0.001193270015423396,0.0010908300226384546,0.3215688423336912
493
+ unet_seed0,test_fibro_TGFb_setI,legacy,15,0.008463237760588473,0.006596494148280559,0.8868953029314677,0.04523535662070905,0.301050859943291,0.17935147156253525,0.6737913012504577,0.0807509468484633,24.50147196650505,8.277265561301697,8.995631399254004,0.560641598758392,0.0006481806437174341,0.0010562970743840123,0.0011340618133544532,0.36714657027755554
494
+ unet_seed0,test_fibro_Y27632_setI,legacy,16,0.00223660537085375,0.0042541047739635,0.9267599880695343,0.04316783424287141,0.21816429197890835,0.1929096732370412,0.5698524136096239,0.10249383110929797,17.703224846627563,7.054585229165719,9.01596009498462,0.8719746634831341,2.723932266235e-05,0.00010895729064939998,0.0011038333177566125,0.509283487787941
495
+ unet_seed0,test_fibro_Y27632_setII,legacy,20,0.0029505794227588497,0.0020014004884593008,0.9184931576251983,0.030336167258101298,0.5579946785084606,0.19341488736838064,0.6012944757938385,0.08589331781183468,17.667164374142885,4.543927795924835,9.144949773326516,1.4357771236022525,5.369186401366938e-05,0.00016632603301397394,0.0010533452033996298,0.5176240838462329
496
+ unet_seed0,test_fibro_fibronectin_setI,legacy,40,0.004185320693068163,0.003938793388697372,0.9058794245123863,0.04986326360266549,0.5219302906851803,0.2319754916271671,0.6449151426553726,0.12687297487643961,18.936000810936093,6.40314149380327,7.344533104333095,1.7823434068995279,0.000261020660400378,0.0006666419848302161,0.00110784173011775,0.38786083596338955
497
+ unet_seed0,test_u2os_6kPa,legacy,39,0.02750251867856157,0.021127265007876744,0.6144035779512845,0.09550880096982202,0.2562314793521325,0.14464684130032462,0.7932444703884614,0.04834376375613158,72.38253683615953,22.514049794991656,16.332000732803955,4.357839858717402,0.0023382871578900974,0.004895436215126899,0.001106219413952905,0.22563454455557458
498
+ unet_seed0,zenodo_v1_test,legacy,46,0.011242424454236276,0.011339659870055403,0.8824383551659791,0.05019359391356504,0.6125343198942972,0.12975649226416486,0.7303289991358052,0.09050543562117241,26.68617501773912,13.512588866281218,9.976406834776634,1.6577813633107,0.002364386682924989,0.003851346753000209,0.0011095482370127349,0.3738417674374469
499
+ unet_seed1,alltune_val,legacy,81,0.008346784058282744,0.008926754615049956,0.863242448112111,0.06240583212920162,0.4509528700796148,0.28950694262843724,0.7620595745098444,0.18027286037597748,24.59675819831498,12.09090158606753,12.73479315993966,7.065690509438673,0.002138373292522645,0.003586675581752635,0.001081772792486463,0.5177427471239713
500
+ unet_seed1,test_fibro_1kPa_setIII,legacy,17,0.002517878310754847,0.0033813246843316324,0.9079219909275279,0.0328088694538975,0.4986281936674813,0.2284866100022391,0.5433910576736226,0.09481039040521076,24.97328571317827,9.45682709856301,13.875309870961834,1.8244969089523473,0.0,0.0,0.0011770444757797705,0.5556060996667294
501
+ unet_seed1,test_fibro_DMSO_setI,legacy,27,0.00605202294429069,0.00599180241034368,0.9026832249429491,0.05029688190724423,0.6664389942826758,0.12562468323564877,0.6038823823134104,0.07621650260385049,22.690155784840936,9.653348226275018,12.806746142881888,1.5869188235181888,0.0011002929122359444,0.0017828783273705856,0.001070861463193511,0.564418607977912
502
+ unet_seed1,test_fibro_DMSO_setII,legacy,11,0.008314894364130727,0.005774868766718388,0.889673953706568,0.03140080498095143,0.5842346992638722,0.15151013653880532,0.6263988018035889,0.07883527714845324,26.922392574223604,8.656309600517519,13.7712743810632,2.2484894597981104,0.0009989304976029546,0.001193270015423396,0.0010340213775634547,0.5115174791057864
503
+ unet_seed1,test_fibro_TGFb_setI,legacy,15,0.007237924262881247,0.005826993260715331,0.8919121464093526,0.044390589352841944,0.4880563950126084,0.13041191245260728,0.6062942643960317,0.08412574355309976,24.50147196650505,8.277265561301697,13.010410157342752,1.3092826232484662,0.0006481806437174341,0.0010562970743840123,0.0011862754821776933,0.5310052463431073
504
+ unet_seed1,test_fibro_Y27632_setI,legacy,16,0.0023576642997795313,0.003468691247317946,0.9228644259274006,0.03762459170283293,0.27546098957799564,0.1990886059353804,0.5931138209998608,0.08407543216368647,17.703224846627563,7.054585229165719,14.080598775763065,1.6270311073155472,2.723932266235e-05,0.00010895729064939998,0.00108483433723445,0.7953691430657842
505
+ unet_seed1,test_fibro_Y27632_setII,legacy,20,0.002529909049917425,0.0017941052399756178,0.9199862539768219,0.02635293299150093,0.5905185210696995,0.16741241180482025,0.5762535378336906,0.10192889207166422,17.667164374142885,4.543927795924835,14.190186373889446,1.9763815197320727,5.369186401366938e-05,0.00016632603301397394,0.00104012489318844,0.8031954689150775
506
+ unet_seed1,test_fibro_fibronectin_setI,legacy,40,0.0032456214888952153,0.003434821068665475,0.9198339089751244,0.03957859108158177,0.6018064859264587,0.18237442519641475,0.5458972863852978,0.12961089049850422,18.936000810936093,6.40314149380327,12.861821136903018,1.9595425563856077,0.000261020660400378,0.0006666419848302161,0.001111567020416215,0.6792258442170609
507
+ unet_seed1,test_u2os_6kPa,legacy,39,0.025203555308950968,0.019440022684129716,0.6127494802841773,0.0903392180749594,0.25941772816773057,0.13315477293143968,0.7514002399566846,0.053234500789584506,72.38253683615953,22.514049794991656,22.496219963217392,6.844349169425874,0.0023382871578900974,0.004895436215126899,0.0011056447640443103,0.31079623548064356
508
+ >>>>>>> dc31c70c28a2ef1c160986f495985204de87c4fe
509
  unet_seed1,zenodo_v1_test,legacy,46,0.00936730446688745,0.009806955208855243,0.8826427161693573,0.044340123170899685,0.6504549501304828,0.1254012605447015,0.7062365594117538,0.16269038125151805,26.68617501773912,13.512588866281218,15.705596453145795,2.228080111054024,0.002364386682924989,0.003851346753000209,0.0011378837668376955,0.5885293206203512