Skip to content

Releases: LaingLab/BARCC

BARCC v8.09.000

Choose a tag to compare

@blaingvt blaingvt released this 30 Jul 21:29

BARCC v8.09.000

Cell detection and Mask Settings release: Adaptive detection, Area Tune, Measure Tune (TP/FP/FN/TN), smarter Smart Suggest, peak quality filters, and UX fixes for masks and editing.

Highlights

Adaptive detection (Blob/DoG overlay)

  • Adaptive is a checkbox on Blob / LoG or DoG (not a separate radio method).
  • Tile-local thresholds, optional dual-pass (sensitive + strict), density-aware packing.
  • Parameters: tile size/overlap, sensitivity, packing, dual-pass.
  • Autotune More/Less Cells nudges adaptive knobs when Adaptive is on.

Peak quality filters (fewer FPs on high BG / edges)

  • Local SNR, bg relative (peak vs local median), isotropy, circularity.
  • Tissue-edge reject (bimodal outer ring; does not treat pure dark-field as “outside”).
  • Defaults tuned for mixed high/low background immunofluorescence.

Area Tune

  • Draw 10 independent diameter lines (one per cell).
  • Sets blob_min_area / blob_max_area to 0.7×–1.5× mean area (π·r²).
  • Results are stored for the session so Smart Suggest can prefer those area bounds.
  • Measure Tune does not overwrite Area Tune size bounds when both have been used.

Measure Tune (TP / FP / FN / TN)

  • Label the current mask after Show Mask / Smart Suggest:
    • TP green — correct detection
    • FP orange — false mark
    • FN blue — missed cell
    • TN gray — true empty background
  • Dual approach supported:
    • Precision pass: FP + TN only (≥2 should-not) — tighten thr/SNR/quality.
    • Recall pass: TP + FN only (≥2 should-detect) — recover missed cells.
    • Full pass: both sides.
  • Detection rings stay visible while labeling; Apply uses a progress dialog.
  • Performance: local-patch LoG (no full-frame LoG storm on large TIFFs).
  • Labels feed Smart Suggest for thr/sigma/SNR/packing restore.

Smart Suggest upgrades

  • Regional diagnosis (bright vs dark tiles: peaks vs detections).
  • Named recipes: mixed_both, high_bg_fp, low_bg_fn, recover_clusters, global over/under.
  • Joint suggestions (Adaptive + dual-pass + SNR + thr + packing together).
  • Explicit adaptive_enabled → 1 when indicators support it (priority 0).
  • Trajectory memory after Apply (e.g. ease SNR after a strict high-BG pass).
  • Area Tune / Measure Tune results preferred over pure LoG-derived sizes when present.

Mask Settings UX

  • Inactive detection methods: parameters dimmed and locked (Blob vs Watershed vs Adaptive panel).
  • Adaptive checkbox disabled under Watershed.
  • Hover tooltips for adaptive and quality parameters.

Manual add / remove cells

  • Remove brush paint is yellow/gold (not red or cyan).
  • Add stays red.
  • Detection mask stays visible under paint (rings + brush composite; works while zooming).

Other

  • Crop / Enter / hemisphere _r/_l and random-region work from earlier 8.08 remain.
  • Python 3.14 env support: environment.yml, Launch_BARCC.bat, optional BARCC.lnk.
  • requirements.txt updated for the preferred env.

Files

  • Application/barcc.py — detection, Smart Suggest, Measure/Area Tune, Mask Settings, mask edit UI.
  • Application/allen_atlas.py — prior atlas refinements included in this tree.
  • Application/Launch_BARCC.bat — launcher for barcc314 / preferred env.
  • environment.yml — conda env definition (new in tree).
  • requirements.txt — dependencies.
  • README.md — version highlights.
  • release-notes-v8.09.000.md — this file.
  • Version string: 8.09.000.

Notes

  • Adaptive runs only when Adaptive is checked and method is Blob or DoG.
  • Expert quality on mixed high/low BG still often needs dual Measure Tune passes (FP/TN then TP/FN) plus manual add/remove on ROIs.
  • Atlas alignment improvements are not in this release (deferred by design).

Requirements / Running

From Application/ (example):

conda activate barcc314
python barcc.py

or use Launch_BARCC.bat. See requirements.txt / environment.yml.

Git

  • Tag: v8.09.000
  • Previous: v8.08.000 — see release-notes-v8.08.000.md

BARCC v8.08.000

Choose a tag to compare

@blaingvt blaingvt released this 29 Jul 15:43

BARCC v8.08.000

Major multi-channel atlas, intensity, and cell-mask release. Allen Mouse Atlas integration, portable schematic files, cross-channel cell masks, axon/PNN intensity with correction, random null distributions, and perineuronal shell analysis.

Highlights

Allen Mouse Atlas + semi-auto stitch

  • Import Allen Atlas plate browser with Nissl reference strip and borders-only movable overlay.
  • Stitch editor: Reflect right→left, move/rotate hemispheres, then load into BARCC.
  • Fit Atlas to Image, crop/move/scale/rotate with model-space placement (no zoom drift).
  • Post-crop cleanup of incomplete/loose structures and morphological borders.
  • Hemisphere labels: after Reflect/bilateral stitch, structures are named with _r / _l suffixes (e.g. V2M_r, V2M_l) so left and right are distinct in Atlas Manager and Count Cells.

Portable atlas schematic (.catlas)

  • Save / Load Atlas Schematic (Atlas + File menus): lossless package of zone mask, structure drawings, painted regions, Atlas Manager names, and placement.
  • Load onto other fluorescence channels of the same section without re-labeling.
  • Placement fix: when background size changes between save and load, atlas layers, paint, and img_x/img_y scale together (avoids right-shift after crop / viewer resize).
  • Legacy .atlas files still load; new saves use .catlas.

Next Channel (keep atlas)

  • Next Channel… loads a new TIFF while preserving atlas drawings, zone masks, names, paint, and placement.
  • Normal Import / Next Image fully clears atlas (no ghost double-overlays).
  • Clear Atlas in Atlas menu and Atlas Manager ribbon.

Paint on atlas → cell counter regions

  • Painted regions use atlas model coordinates when an atlas is loaded.
  • Named (or auto-named) paint merges into the existing zone mask and appears in Atlas Manager / Count Cells without clobbering Allen zones.

Axons and Nets — intensity & correction

  • Measure Region Intensities… with options dialog:
    • Background subtraction: Xth-percentile intensity within each region.
    • Counterstain normalization: divide by factors from a counterstain file.
  • Counterstain Normalization Measurement…: measure on DAPI/counterstain with the same .catlas; exports Normalization_Factor per region.
  • Export columns include Pre_Correction_Mean/Median and Post_Correction_Mean/Median, plus raw/BG/normalized detail columns.
  • Excel output under output/ (multi-sheet, Count Cells–style), File Browser listing, openpyxl fallback warnings.

Cross-channel cell masks

  • Save Cell Mask… / Load Cell Mask… (.barccmask + PNG).
  • Loaded mask is locked so Count Cells reuses it without re-detection.
  • Show Mask re-detects and unlocks when you want a new mask on the current channel.

Random null cell distribution

  • Generate Random Cell Mask…: same cell count as ground truth; randomized XY; radii shuffled.
  • With atlas/.catlas: stratified by region (same count per structure, placed inside that structure).
  • Display: red = GT, cyan = random. Optional seed + save.

Perineuronal (PNN) shells

  • Draw Perineuronal Masks: shell between cell boundary and outer disk of 150% cell area.
  • Also draws shells for random cells when present (magenta = true PNN, yellow = random PNN).
  • Measure Perineuronal Intensity… exports:
    • {name}_pnn_by_structure.xlsx — per structure: True/Random Mean, SEM_Mean, Median, SEM_Median.
    • {name}_pnn_cells_true.xlsx — per cell: area + perineuronal intensity.
    • {name}_pnn_cells_random.xlsx — same for random cells.

Menu reorganization

  • Mask menu renamed Cell (detection tools + Counting submenu).
  • Axons and Nets expanded with intensity, counterstain norm, PNN, and label toggles.

Files

  • Application/barcc.py — main application (major feature work).
  • Application/allen_atlas.py — Allen CCF plate load, stitch session, bilateral _r/_l naming (new in repo).
  • release-notes-v8.08.000.md — this file.
  • Version string: 8.08.000.

Notes

  • Count Cells still counts only the real/ground-truth cell mask (not the random null mask).
  • uint8 zone ID limit (255) still applies for bilateral split when structure count is very high.
  • Prefer same-section, same-resolution channels for .catlas and cell-mask transfer.

Requirements / Running

From Application/:

py -3.12 barcc.py

Dependencies: see requirements.txt (including openpyxl for Excel exports).

Git

  • Tag: v8.08.000

v8.07.000: Save Flattened Image now flattens zone masks + masked cells

Choose a tag to compare

@blaingvt blaingvt released this 23 Jun 17:27

BARCC v8.07.000

Usability and flattening fix for the paint + count workflow on TIFFs.

Highlights

Save Flattened Image now includes the full mask

  • Previously only saved the base TIFF + paint layer (black boundaries). The zone fills for painted regions and the red cell mask overlay were missing.
  • Now properly flattens:
    • TIFF base
    • Yellow filled painted region masks (explicit tint from the zone mask_images, so areas are filled, not just boundaries)
    • Black paint boundaries (paint_layer)
    • Red masked cells (from last_cell_mask after Count Cells, using alpha_composite for blending)
  • Uses Image.alpha_composite for correct layering and visibility.
  • Default save name is now {tiff_filename}_flattened.tif (with proper initialdir).
  • Works for both interactive File > Save Flattened Image and internal autosave (used by Next Image before reset).
  • Same safe TIFF save (no tiff_deflate to avoid segfaults).

Remaining crash hardening in flattened save

  • All overlay steps (zone fill, paint, cells) are now in defensive try/except blocks.
  • Size guards, proper 2D handling for masks, int casts for offsets, explicit mode='L' on fromarray.
  • If overlays fail for any reason, still saves at least the base + what succeeded (no app crash).

See previous release notes for the v8.06 count stability work, zone table, and earlier paint bundle fixes.

Other Notes

  • Version string in code and exported settings JSON: 8.07.000.
  • README.md and docs/generate_barcc_manual.py updated (manual PDF will be regenerated on next run).
  • New release notes file: this one.
  • Git tag: v8.07.000

Requirements / Running

Unchanged from v8.06. Use py -3.12 barcc.py from the Application directory.

v8.05.000: Paint bundle load & Count Cells fixes for .tiff

Choose a tag to compare

@blaingvt blaingvt released this 18 Jun 15:16

BARCC v8.05.000

Patch release focused on reliability of the new Paint bundle (.barccpaint) workflow — specifically loading painted regions + names onto TIFFs and then running Count Cells — plus related crash and feedback fixes.

Highlights

Fixed "failed to load paint bundle: ufunc 'less' ..." on .tiff

  • The error ufunc 'less' did not contain a loop with signature matching types (<class 'numpy.dtypes.UInt8DType'>)->none occurred when loading a .barccpaint (containing strokes.png + zones.png + manifest with named painted regions) onto a .tiff via the left File Browser or Load Paint.
  • Root cause: json stringifies dict keys → zone IDs became strings in zone_names/painted_zone_outlines. After load, np.array(zones mask) produced uint8 scalars. _populate_region_list (called from _update_ribbon_selection during bundle load + show_page) did if zid > 0 and zid not in names + sorted(names.items()), causing Python sort / numpy ufunc 'less' to fail on mixed str + np.uint8.
  • Fixed by:
    • Normalizing keys with {int(k): v for ...} immediately after loading manifest / legacy sidecar JSON in _load_barccpaint_bundle, legacy paths, and StateManager restore.
    • int(zid) in _populate_region_list, _ensure_zone_has_name, and count lookup paths.
    • Same normalization for painted outlines.
  • Painted regions now load with names appearing immediately in the Atlas Manager list and shapes usable for counting.

Fixed silent crash / no feedback on Count Cells after painted bundle load

  • After a successful bundle load, clicking Count Cells would sometimes "crash" with no dialog at all and no .xlsx (or _masked.tif) generated.
  • Causes addressed:
    • Numpy broadcast error in the cell marker drawing code inside count_cells_in_zones (rgb_img[slice, x] = [255,0,0] etc.) on edge centroids or degenerate (0-length) slices after window-fit scaling of the TIFF. This happened after counts were computed but before df was returned → exception escaped the count path.
    • Progress dialog close timing vs. the "Results Saved" / warning messagebox: leaving the busy Toplevel open while showing the results dialog + closing it afterward could cause event/focus issues on OK.
    • Auto-save block silently skipped (only a log) when tiff_dir / tiff_filename was not set (some direct open vs. browser flows, or state after accessory load). No user-visible indication and no file.
  • Fixes:
    • Explicit [:, :] channel indexing + if start < end guards in the cross drawing.
    • Full try/except around non-critical viz blocks in count_cells_in_zones so df / counts / return always succeed (fallback annotated image).
    • Close the busy progress dialog before any final "Results Saved" popup (and perform masked save early).
    • If save paths are missing, still show an info dialog ("Count Complete...") so the user always gets feedback.
    • Added defensive guard for original_background before detection.
  • Result: Count Cells after loading a painted bundle on a .tiff now reliably produces the spreadsheet (with your painted region names), the masked image, and dialogs. No more silent failures.

Other robustness for painted + TIFF + count

  • Manual add/remove cell masks are now cleared on every new TIFF load (via browser or direct) so stale edits from a previous image don't get resized and OR'd into the current count.
  • zone_counters bumped from loaded zone IDs on bundle load (in addition to the ribbon populate path) so future naming doesn't collide.
  • All zone ID handling now consistently uses Python int keys.
  • The left File Browser accessory flow (double-click paint child) continues to chain TIFF load + bundle restore correctly.

These changes make the "draw or load painted regions with names → Count Cells" workflow on TIFFs (including via .barccpaint bundles that carry both visuals and labeled shapes) production-ready.

Other Notes

  • Version string in code and exported settings JSON updated to "8.05.000".
  • README.md updated with v8.05.000 section.
  • Release notes added (this file).
  • BARCC_User_Manual.pdf and generator may be updated in a follow-up if new "What's New" text is desired; core behavior is documented in the code comments and this note.
  • No changes to requirements or installation.

Requirements

Unchanged.

Preparing / Installing the Release

  • Source, this release note, updated README are in the repository.
  • Git tag: v8.05.000 (to be created on push)
  • Run py -3.12 barcc.py (or your normal launcher) from the Application directory.

BARCC v8.04.000

Choose a tag to compare

@blaingvt blaingvt released this 15 Jun 14:03

BARCC v8.04.000

Feature release focused on precision editing and reliable undo for custom painted regions, plus UI clarity improvements for paint mode and advanced border tools.

Highlights

Painted Region Border/Edge Expansion with Enter-to-Commit

  • Live border drag (or the red local edge segment when "Border drag resize enabled" is checked) provides real-time preview of the yellow/orange highlighted zone mask shape as you expand, shrink, or deform the boundary.
  • The original black drawn boundary line remains at its previous position during the live adjustment (clear visual before/after).
  • After releasing the mouse, press Enter (or keypad Enter) to commit the final shape: the current mask contour is extracted, the stored painted zone outline points are updated, _rebuild_paint_layer_from_data() re-rasterizes a clean black boundary line (with proper caps and joints) from the new points, and show_page() redraws it. This automatically refits the visible black outline exactly to the new expanded/deformed region.
  • The mask/zone data (used for counting and tints) was already updated by the drag; Enter "bakes" and refits the black visual boundary for the painted region.
  • Works for both the precise edge-grab path and the legacy one-sided border pull. Also supported after "Move Selected Region" translates of painted zones.

Undo Button + Repeated Undo for Painted Regions

  • New prominent ↶ Undo button in the Atlas Manager ribbon header (always visible when the ribbon is shown via View menu). Also exposed in the Edit menu with Ctrl+Z accelerator.
  • Full per-stroke granularity: each continuous paint stroke (mouse down to up = one group) gets its own undo checkpoint at the start of drawing.
  • Naming a painted region (right-click), Stop Paint (auto-default "Painted Region N" conversion), Count Cells (force conversion of remaining strokes), border/edge deformations, and Move Selected on painted zones are all first-class undoable actions.
  • Bounded history (40 levels). The Atlas Manager "Labeled Regions" list/header, zone/mask data, and visual black boundaries now stay perfectly in sync after each undo step. No more unexpected batch removal of multiple paints.
  • Keyboard Ctrl+Z (and the button) continue to work for all prior atlas, mask-edit, and global operations.

UI Clarity

  • "Border drag resize enabled" checkbox (in the Atlas Manager ribbon, under the selected region tools) now starts unchecked by default. You must explicitly enable it after selecting a region before edge or one-sided border drag tools become active. This prevents accidental activation of the advanced editing mode.
  • Paint mode indicator: When the Paint tool is active (Paint > Start Paint), a clear "🎨 PAINT ON" label appears in bold red in the ribbon header. The main window title also updates to include " — 🎨 PAINT MODE". The indicator automatically returns to normal (gray "Paint: off") when you Stop Paint or switch tools. The title-bar version remains visible even if you hide the ribbon.

Edge / Border Tools for Painted Regions

  • Edge grab, border drag, Move Selected Region, quick per-region rotate/scale, and related tools now work fully for painted regions (in addition to atlas regions) with correct coordinate space handling (background/image pixel space vs. atlas page model space).
  • Combined with the Enter commit flow, you can now iteratively refine the shape of hand-painted custom regions and have the black visual boundary automatically follow the final mask contour.

Robustness

  • Undo stack snapshots, mask pruning on restore (to prevent the orphan auto-registration logic in the ribbon list from re-adding removed painted zones), and state hygiene around paint naming/finalization and border operations.
  • All new paint editing paths participate in save_state at the appropriate moments (start of stroke, start of border interaction, etc.) and correctly refresh the ribbon list, canvas, and paint_layer on undo/redo.

These features make iterative, high-precision work with custom painted regions (with live mask preview + explicit commit for the visible black boundary) reliable and user-friendly, while preserving the full power of the Atlas Manager ribbon for atlas-based work.

Other Notes

  • Version string in code and exported settings JSON updated to "8.04.000".
  • User Manual fully regenerated with new "What's New in Version 8.04.000" section (covering the Enter-to-commit painted boundary refit flow, undo button, paint indicator, checkbox default change, and painted region edge support) plus updates to the "7. Paint Tools" and "6. Working with Atlas Sections" chapters.
  • README.md top-level highlights updated.
  • See previous release notes (v8.03.000 for the Atlas Manager ribbon, v8.02.x for Paint reliability) for earlier features.

Requirements

Unchanged.

Preparing / Installing the Release

  • Source, updated manual (BARCC_User_Manual.pdf), this file, and updated README are in the repository.
  • Git tag: v8.04.000

BARCC v8.03.000

Choose a tag to compare

@blaingvt blaingvt released this 05 Jun 18:32

BARCC v8.03.000

Major release introducing the Atlas Manager ribbon for advanced per-region and global editing of atlas overlays, plus UI improvements for mode awareness and numerous workflow robustness fixes.

Highlights

Atlas Manager Ribbon (new central UI for atlas work)

  • New expandable/collapsible Atlas Manager ribbon (View menu "Show Atlas Manager Ribbon" toggle to show/hide entirely).
  • Header shows currently selected region (or "No region selected").
  • Global tools now checkboxes (Crop, Move) — checked state clearly indicates when whole-atlas modes are active (rebinds canvas for crop rect or layer drag via img_x/img_y).
  • "Move Selected Region" checkbox + drag inside orange tint: translates only the selected zone's mask pixels. Atlas artwork, other regions, and background stay fixed.
  • "Border drag resize enabled" checkbox: arms precise edge editing.
  • Global Quick Adjust (new): Rot +5°/-5°, Scale +5%/-5% buttons for the entire current atlas page (base + all masks), plus "Dialogs..." to global rotate/scale settings.
  • Selectable list of all labeled regions on the page — click to select for editing (orange highlight, updates header/list).
  • Selected Region Quick Adjust (Rot +/-5°, Scale +/-5%, Dialogs...) — applies only to the chosen zone (centroid-preserving).
  • Automatic mutual exclusion: enabling border/edge features deselects global Move (and Crop); enabling globals unchecks border drag. Prevents overlapping/confusing behaviors.

Per-Region Atlas Editing (select + fine control)

  • Select regions via: canvas click on named (yellow) area (now autoselects instead of re-naming prompt), ribbon list, or Atlas > Select Region (temporary picker).
  • Quick per-region rotate/scale.
  • Edge grab & local deformation: Click near border of selected (orange) region → illuminates local red edge segment (persistent). Click red to re-center grab point. Drag red to locally expand/shrink only that boundary portion (falloff weights for smooth blend). Live shape update of tint during drag. Release commits to mask.
  • "Move Selected Region" for translation-only of one zone.
  • Works alongside global alignment.

Global Quick Adjust (mirrors regional)

  • Added to ribbon under Global: small-increment Rot +/-5° and Scale +/-5% for whole atlas page + masks (same style as selected-region quick adjust).
  • "Dialogs..." for full settings.

Menu & Other Changes

  • Import Atlas moved under new top-level Atlas menu (along with Crop, Move, Rotate, Scale, Select/Deselect Region, Rotate/Scale Selected, etc.) for logical grouping.
  • Many state/binding fixes: atlas crop now uses proper model coords + rebases layer (no disappearing atlas); load image after atlas no longer breaks global Move due to stale selection/edge state (full clears added to import_tiff/_load_tiff_file); forgiving edge hit tests (zid==0 boundary pixels still trigger grab if near selected); delegation so per-region features work even under global edit bindings; hygiene clears everywhere (page change, deselect, imports, crop, etc.).

Robustness

  • Edge grab, move-selected, crop, etc. now reliable across load orders, zooms, pans, and previous selections.
  • Checkboxes + orange selection + list + header provide clear at-a-glance feedback on active context and armed tools.

These features make fine-grained atlas region correction practical while keeping global tools obvious and non-conflicting.

Other Notes

  • Version string in code and exported settings JSON updated to "8.03.000".
  • User Manual fully regenerated with new "What's New in Version 8.03.000", expanded "6. Working with Atlas Sections" chapter documenting the ribbon, global/per-region quick adjust, edge grab, move-selected, checkboxes/mutual exclusion, etc., plus File menu note about Atlas menu reorganization.
  • README.md top-level highlights updated.
  • See previous release notes for Paint reliability (v8.02.00x) and earlier features.

Requirements

Unchanged from v8.02.

Preparing / Installing the Release

  • Source, updated manual (BARCC_User_Manual.pdf), this file, and updated README are in the repository.
  • Git tag: �8.03.000
  • GitHub release will include these notes and the updated manual.

See release-notes-v8.02.002.md etc. for prior changes.

BARCC v8.02.002

Choose a tag to compare

@blaingvt blaingvt released this 04 Jun 17:14

BARCC v8.02.002

Patch release that resolves the mismatch between the cell counts users see visually on the annotated image and zone labels versus the numbers reported in the exported spreadsheet.

Highlights

Count Mismatch Between Visual Mask/Image and Spreadsheet Fixed

  • Symptom: After drawing painted regions, naming them, running "Count Cells", the yellow zone labels on the image (e.g. "MyRegion\n(12)") and the number of red cell markers visible inside each region on the annotated image / _masked.tif did not match the "Cell_Count" values in the "Cell Counts" sheet of the .xlsx (or the fallback .csv).
  • Root cause:
    • Cell detection, manual edits, and final cell mask always operate in the coordinate system of the main experimental image (original_background, aligned at 0,0).
    • Hand-painted regions are rasterized into mask_images using the same background-aligned model space.
    • However, both the per-zone counting logic inside count_cells_in_zones (which builds the DataFrame used for the spreadsheet and last_df) and the positioning of zone labels in show_page unconditionally subtracted/added the atlas overlay offset (img_x / img_y / display_img_x).
    • img_x/img_y are updated by panning the atlas, zooming (centered), dragging, alignment tools, etc. Any non-zero value would shift the cell centroid lookup into the zone mask, causing cells to be assigned to the wrong zone (or no zone at all) for counting purposes.
    • The visual red markers (and the underlying cell positions) were drawn using raw centroids, so users would literally see more (or fewer) cells inside a painted region than the spreadsheet and on-screen labels reported.
  • Fix:
    • Added a simple, robust size-based heuristic in count_cells_in_zones:
      • Compare the zone mask_pil dimensions to the background_pil (main image) size.
      • If they match (within tolerance): this is a paint region (or standalone TIFF) in the main image space → use direct cell coordinates for zone lookup (no offset applied).
      • If sizes differ (typical for an atlas/PDF overlay rendered at a different resolution): keep the previous img_x/img_y offset logic to translate into the placed atlas layer's coordinate system.
    • Applied the identical heuristic to the zone label drawing code in show_page:
      • If the current zone mask size matches the main background_image, place the yellow "Name\n(count)" labels at base offset 0 (over the background layer drawn at canvas 0,0).
      • Otherwise use the atlas placement offset (as before).
    • Updated variable names and comments for clarity.
  • Result: After re-running Count Cells, the per-zone totals in the spreadsheet exactly match the number of cells the user sees marked inside each region on the image, and the on-screen yellow labels (when enabled via the Cell menu) appear over the correct regions with the correct counts — even if an atlas overlay has been panned or zoomed.
  • This only affects the mapping/assignment and label placement. No changes to the actual cell detection, manual add/remove logic, watershed, neighborhood search, binary_fill_holes, or any other counting internals.
  • Pure atlas (PDF) region workflows and cases with no overlay offset continue to behave exactly as before.

Other Notes

  • Version string recorded in exported detection settings JSON is now "8.02.002".
  • The User Manual has been fully regenerated with a new "What's New in Version 8.02.002" section.
  • README.md top-level highlights updated.
  • No other functional changes. Previous v8.02.001 and v8.02.000 Paint reliability, menu, stability, and export improvements remain fully intact.

Requirements

Unchanged. For full .xlsx support with the "Detection Parameters" metadata sheet:

pip install openpyxl xlsxwriter

Preparing / Installing the Release

  • Source, updated manual (BARCC_User_Manual.pdf), and this file are in the repository.
  • Git tag: v8.02.002
  • GitHub release includes these patch notes and the updated manual as an asset.

See release-notes-v8.02.001.md for the prior patch (first-paint reliability + settings dialog X-button fixes) and release-notes-v8.02.000.md for the major Paint overhaul.


Full updated manual and source available at the GitHub release and in the repo.

BARCC v8.02.001

Choose a tag to compare

@blaingvt blaingvt released this 04 Jun 12:38

BARCC v8.02.001

Patch release that resolves the final reported issues with the Paint tool workflow (first-attempt zone registration after naming) and improves usability of the auxiliary settings dialogs. These changes build directly on the major Paint reliability overhaul in v8.02.000.

Highlights

Paint Tool / Zone Registration Fixes (Final Polish)

  • "First paint + name + Count Cells" now works on the very first attempt: Previously, after loading a fresh TIFF, drawing one region, right-click naming it immediately, and clicking Count Cells would still show "No Regions Defined". Drawing a second region and naming it would then succeed (but the spreadsheet would only contain the second region).
    • Root cause: The first stop_paint() (automatically called by Count Cells) + its final show_page() triggered load_page_image(), which (on the first activation of atlas_filetype='img' after save_paint() sets it) would unconditionally reset zone_names[current_page] = {}, mask_images[...] = blank, and zone_counters[...] = 0 when populating page_images. This clobbered the zone entry and mask pixels that _convert_named_paints_to_zones (called from name_painted_region) had just created. The subsequent post-stop conversion attempts in count_cells had no data left (because stop_paint also clears named_paint_groups + paint_group_data).
  • Targeted guard added in load_page_image: Per-page mask/zone/counters initialization now only occurs for true multi-page PDF atlas content (if self.atlas_filetype == 'pdf'). For 'img' (baked paint from Stop/Save/Count) and 'png' (Load Paint) cases we still cache the image for display/layer purposes, but we no longer destroy user-defined paint zones. This matches the intent of the edit/crop/rotate paths that carefully preserve mask_images.
  • Additional robustness in conversion paths (cumulative with prior 8.02 work):
    • Broadened stroke collection in _convert_named_paints_to_zones (durable paint_group_data model points + live canvas items + last-resort any-'paint' for still-named groups).
    • Conditional dtag in name_painted_region (only strip the group tag after successful retirement; leave it if collection failed so later Stop/Count fallbacks can still discover it).
    • Re-collection + re-convert safety net inside stop_paint before the final clear.
    • Ultimate force-add of lingering data groups before the "No Regions Defined" error guard in count_cells.
  • These ensure that paint_group_data (the durable model-space geometry recorded during drawing) is always used to populate zone_names and the labeled mask_images before any clobber/clear can occur, and that the guard in Count Cells always sees the registered zones.

The net result: the exact user flow requested throughout development ("draw, name immediately with right-click, click Count Cells without ever pressing Stop Paint") is now 100% reliable on the first try after loading any image. No more "paint a new region to make the first one appear" workaround.

Settings Dialog Usability

  • The titlebar X button (and Alt+F4 / window manager close) on the Brightness Settings dialog (the one containing the live brightness slider/scale) now correctly closes the window.
    • Previously bound to self.disable_event (a no-op pass), so the X did nothing (only the "Close" button at the bottom worked).
  • For consistency, the same fix was applied to the other three small auxiliary settings dialogs that shared the identical Toplevel + protocol + _register_transparent_window pattern:
    • Brush Settings (the brush size slider)
    • Scale Settings
    • Rotate Settings
  • show_mask_settings was already using the correct window.protocol("WM_DELETE_WINDOW", window.destroy).
  • The <Destroy> cleanup handler in _register_transparent_window continues to work, removing the window from the transparent list.
  • Progress dialogs ("Counting Cells", "Detecting Cells", etc.) remain intentionally hardened (they set a closed flag and make all subsequent UI calls no-ops) so that early dismissal cannot crash long-running operations. This behavior is unchanged and was the critical stability fix from 8.02.000.

Summary of Changes

These are the final missing pieces that users encountered while exercising the v8.02.000 paint features on real data:

  • Zone data for the very first named paint region on a freshly loaded image could be silently destroyed by the internal "bake to img" path.
  • The brightness slider dialog (a frequently used quality-of-life control) had a non-functional close button in the title bar.

All prior v8.02.000 guarantees (durable geometry, proper filling, no dups, auto-stop on Count, full wipe on load, auto-export, etc.) are preserved and now apply even on the absolute first paint action.

Other Notes

  • No changes to detection (Blob remains default), exports, File Browser, or core counting logic.
  • The settings JSON export now records "version": "8.02.001".
  • The User Manual source (docs/generate_barcc_manual.py) has been updated with a new "What's New in Version 8.02.001" section. Re-run the generator (after pip install fpdf2) to produce an updated BARCC_User_Manual.pdf.
  • README.md top section updated to lead with v8.02.001 highlights.

Requirements

Unchanged from v8.02.000. For full .xlsx support:

pip install openpyxl xlsxwriter

Preparing the Release

  • Bump complete.
  • Full notes in this file + README + manual generator.
  • Commit the changes, create annotated tag v8.02.001, and push (including --tags).
  • On GitHub: Draft a new release from the tag, paste the highlights + link to this release-notes file, mark as latest if appropriate.

Full updated manual (BARCC_User_Manual.pdf) and source are included in the repository after regeneration.


Previous release: See release-notes-v8.02.000.md for the major Paint tool reliability, menu reorganization, auto-save to File Browser dir, progress dialog crash hardening, and interior counting improvements in 8.02.000. See release-notes-v8.01.000.md for Blob Detection, Smart Suggest, etc.

BARCC v8.02.000

Choose a tag to compare

@blaingvt blaingvt released this 28 May 19:57

BARCC v8.02.000

This is a focused stability and reliability release that makes the Paint tool for custom regions fully trustworthy for quantitative work, plus a critical crash-prevention fix.

Highlights

Painted Region / Zone System Overhaul

  • Reliable zone registration: Regions you draw with the Paint tool and name immediately via right-click now correctly and consistently appear in the output spreadsheet when you click Count Cells.
  • Automatic paint stop + conversion: Count Cells now guarantees that paint mode is stopped and all strokes (explicitly named + auto-default "Painted Region N") are converted into countable zones.
  • Full state isolation: Every new TIFF loaded (via the left File Browser or Import) completely wipes previous masks, zone names, counters, and paint data. No more leakage between images.
  • Durable paint geometry: Strokes are now stored in stable model/image coordinates. They survive zooming, panning, and canvas refreshes.
  • Accurate interior counting:
    • Painted outlines now receive proper interior filling using scipy.ndimage.binary_fill_holes.
    • Cell-to-zone assignment uses a small neighborhood search around each centroid for tolerance.
  • No duplicate zones: Processed paint groups are retired after conversion, eliminating cases where 3 drawn regions would produce 6 entries.

Critical Stability Fix

  • Progress dialog safety: Closing the "Counting Cells" or "Detecting Cells" progress window with the X button (or Alt+F4) before the operation completes can no longer crash the entire application. All progress UI methods are now fully defensive.

Summary of Changes

These fixes primarily targeted long-standing fragile areas in the paint → named group → zone mask → counting pipeline that had caused:

  • "No regions defined" errors even after naming zones
  • Severe under-counting (e.g., 30 visible cells inside a region yielding only 1 count)
  • Duplicate zones in exports
  • Application crashes on early dialog dismissal during long operations

The Paint tool (for defining custom non-atlas regions) is now considered production-ready.

Other Notes

  • Blob Detection remains the default method (introduced in 8.01).
  • All previous automatic export behavior (.xlsx + _masked.tif) continues unchanged.
  • The User Manual has been fully updated for v8.02.000.

Requirements

For full .xlsx support with the Detection Parameters metadata sheet:

pip install openpyxl xlsxwriter

Full updated manual (BARCC_User_Manual.pdf) and source are included in the repository.


Previous release: See release-notes-v8.01.000.md for the Blob Detection, Smart Suggest, File Browser, and export features introduced in 8.01.000.

BARCC v8.01.000

Choose a tag to compare

@blaingvt blaingvt released this 27 May 14:20

BARCC v8.01.000

This is a significant release with major improvements to cell detection, parameter tuning, and workflow automation.

Highlights

  • New Blob Detection Engine (default): Replaced the primary detection method with skimage.feature.blob_log for much more accurate results on immunofluorescence images.
  • Smart Suggest (Offline): New fully local AI-like assistant in Mask Settings that analyzes your image and suggests optimized parameters. Completely private — no data leaves your computer.
  • Left File Browser Pane: Browse all TIFFs in a folder directly in the app, with visual indicators showing which images have already been counted.
  • Automatic Exports: "Count Cells" now automatically saves:
    • {image}.xlsx (with Cell Counts + full Detection Parameters metadata sheet)
    • {image}_masked.tif (original + final cell mask overlay)
  • Export / Import Settings: Save and load complete detection configurations as portable .json files.
  • Improved UX: Brush size dialog auto-opens for Add/Remove Cell, better Autotune behavior, fixed transparency mode, and many stability fixes.

Other Changes

  • Full rewrite and expansion of the User Manual and README for v8.01.
  • Various bug fixes around painted regions, ProgressDialogs, and menu behavior.

Requirements

For full .xlsx support with metadata, install:
pip install openpyxl xlsxwriter

Full changelog and updated manual available in the repository.