Changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.5.4 - 2026-11-27

This release fixes .aris heights (loaded in metres instead of nm) and .jpk folder orientation (frames were upside down), both of which change results, and stops .npz bundles from running code when opened. It also makes several command-line errors clearer, and the API reference has been reviewed against the code.

Security

  • Opening an .npz bundle could run code stored in the file. load_npz_bundle loaded with allow_pickle=True, so a crafted .npz received from someone else could execute code when opened with playnano play/process/analyze or load_afm_stack. Files you saved yourself were never a risk. Bundles are now written without pickled arrays (text is stored as plain NumPy strings) and read with allow_pickle=False. Bundles saved by earlier versions still open: their text fields are read with a restricted unpickler that can only rebuild arrays of text, and a file containing anything else is refused with an error. Upgrade if you open .npz files from other people.

Fixed

  • .aris heights are now loaded in nm, not metres (changes results). load_aris returned the values as stored, so ARIS stacks were 1e9 times too small compared with the other readers, and thresholds, colour scales, scale annotations and analysis heights were wrong. Channels whose DataUnits is a length (height and amplitude) are now converted to nm; others, such as phase in degrees, are unchanged; a missing unit is guessed from the data range with a warning. Results from .aris files must be regenerated (#118).

  • Asking for a channel an .aris file does not have now lists the channels it does have, as the other readers do.

  • .jpk folders are now loaded the right way up (changes results). load_jpk_folder flipped each frame after AFMReader had already flipped it, so the two flips cancelled and frames were upside down compared with AFMReader and with the .h5-jpk reader. Frames are now flipped once. Anything that depends on orientation (images, exports, tracks, drift direction, anything “up” or “down”) changes for .jpk data; to get the old orientation, pass flip_image=False (#119).

  • API reference for playnano.processing: docstrings now match the code and render without warnings. Corrected zero_mean (documented a mask parameter it does not have), mask_morphological (masks by absolute height, so holes below -threshold are masked too), mask_adaptive (non-overlapping blocks), ProcessingPipeline.run (raises ValueError, not RuntimeError, for an unknown step), the max_shift and max_jump behaviour of the alignment functions, and the temporal_*_filter placeholders, which are not implemented. The align_frames and rolling_frame_align examples showed made-up output; all examples now run as doctests.

  • API reference for playnano.io: docstrings now match the code and render without warnings. Corrected the default colormap of the GIF, video and image sequence exports (afm_brown, not afmhot), how zmin and zmax work (both None scales each frame separately; zmin == zmax gives a blank frame instead of raising), which data and metadata each export format keeps (OME-TIFF keeps no processed layers or masks), and the errors the loaders raise. Documented the missing cmap_name, font_scale and fmt parameters and the video formats (MP4, AVI, MOV, MKV).

  • API reference for the core of playnano.analysis (AnalysisPipeline, AnalysisModule, export and utils): docstrings now match the code and render without warnings. The AnalysisPipeline examples showed made-up output and a wrong path into results_by_name; the class now has an example that runs as a doctest. Documented the errors AnalysisPipeline.run raises, that its log_to JSON summarises arrays instead of writing them, the version and requires attributes of analysis modules, and the units of the particle tables. Corrected load_analysis_from_hdf5 (integer-valued floats are converted only for files saved before 0.5.2) and flatten_particle_features (object_key is detected when not given).

  • API reference for the detection and tracking modules (feature_detection, log_blob_detection, count_nonzero, particle_tracking, tracked_particle_boundary_size): docstrings now match the code and render without warnings, and each module has an example that runs as a doctest instead of made-up output. Documented the units (positions, areas, distances and sizes are in pixels), that particle_tracking uses centroid as (row, col) by default, links tracks greedily and links only moves shorter than max_distance, that feature_detection accepts a mask function’s name, and the errors each module raises. Noted that log_blob_detection output cannot yet be used by tracking or clustering, and that mask_key cannot find a mask through a pipeline.

  • API reference for the clustering modules (dbscan_clustering, k_means_clustering, x_means_clustering): docstrings now match the code, and each module has an example that runs as a doctest. Documented that coordinates are centroid (row, col) in pixels plus time in seconds, that eps and time_weight act on coordinates rescaled to 0 to 1, that cluster coords are rescaled while cluster_centers are in the original units, and how X-means chooses the number of clusters. Corrected DBSCAN, which always drops noise points and uses the mean of all members as the centre, not of core points.

  • API reference for particle_region_extraction and particle_region_media_export: docstrings now match the code and render without warnings, so the analysis reference builds without warnings. Documented that image crops come from stack.data (processed data, not raw), the order in which padding, square and fixed_box_size apply, the box coordinates, the output file names, and that padding and missing frames count towards the colour scale. Corrected fps (also used for GIFs) and noted that formats are not checked before writing starts, and that fixed_size_mode="per_track" needs fixed_box_size to be set.

  • API reference for AFMImageStack and playnano.utils: docstrings now match the code and render without warnings. The AFMImageStack constructor parameters now appear in the reference (they were only in __init__, which is not rendered). Documented the step lookup order and keyword handling of apply, that stack[a:b] returns a stack without processed data or results, which NumPy number types are rejected or lose their value, and that export_analysis_log currently always raises (with the alternative to use). Corrected the examples of guess_height_data_units ('m', not 'nm') and utc_now_iso (includes microseconds), and replaced examples that could not run with ones that run as doctests.

  • API reference for playnano.cli: docstrings now match the code and render without warnings, and every function documents its parameters. Documented the exit statuses of playnano, the wizard commands, that play applies the processing steps only when F is pressed, that YAML processing and analysis files read 1e3 as text (write 1.0e3), and which errors each command raises. Replaced examples that could not run.

  • playnano process with a channel the file does not have now says why it failed and lists the available channels, instead of only “Failed to load” and a traceback; the wizard does the same, and playnano play reports the error once instead of twice. The .h5-jpk message now names the file and lists the channels plainly (#50).

  • The GUI no longer logs “Skipped scale bar” warnings on every repaint while the scale bar is switched off, and a missing pixel size no longer logs an error each frame.

  • playnano play with an invalid --zmin or --zmax (not a number or auto) now warns and opens the window with auto limits, which can be changed in the window, instead of logging an error and then failing.

  • playnano play with option flags inside the input path (a quoted Windows path ending in \) now reports the fix as a normal error with exit status 1, instead of a traceback and status 2.

  • clear is no longer accepted as an analysis step: it is a processing step only, and was accepted and then failed when the analysis ran.

  • The wizard’s help lists the load and clear commands, and that exit also quits.

  • An unknown --cmap in the GUI is now reported with a warning listing the colormaps available, instead of being replaced silently.

  • The error for an unknown processing step lists the step names by type, without Python’s internal methods.

  • Importing the GUI (directly, or through playnano.cli) no longer configures Python’s root logger. It set the level to INFO for every library and stopped a script’s own logging.basicConfig from taking effect. The playnano command still sets up logging from --log-level.

  • NumpyEncoder writes NumPy bools, and sanitize_analysis_for_logging describes text and object arrays instead of failing on them, so analysis plugins returning either no longer stop the JSON export.

  • API reference for playnano.gui: docstrings now match the code and render without warnings. The MainWindow parameters now appear in the reference, and the window’s controls, keys and default processing pipeline are described. With this, the whole documentation builds with sphinx-build -n without warnings (#30).

Changed

  • Tests use a real ARIS file: 2 frames of a DNA origami recording (G. Heath, Zenodo 10670413, CC BY 4.0), 356 KB. Its citation and changes are in tests/resources/README.md.

  • The documentation links types to the NumPy, SciPy, h5py and scikit-image documentation, and CONTRIBUTING.md has rules for writing types in docstrings.

  • CONTRIBUTING.md: AI use is disclosed in the pull request, not in source files, and module docstrings no longer have author or AI-use sections; authors are credited in CITATION.cff.

  • The documentation links to the scikit-learn documentation. docs/_generated/generated_module_list.rst is no longer tracked by git; the docs build writes it.

  • Pull-request docs builds run with -n -W, so any warning, including a broken cross-reference, fails the check; a failed build is retried once in case an intersphinx inventory could not be downloaded. Inventory downloads time out after 30 seconds instead of waiting indefinitely, and two nitpick_ignore entries that hid mistakes were removed.

  • The Codecov patch check requires 80% of changed lines to be covered, instead of the whole project’s coverage (about 93%), which small fixes with one untested error branch could not meet.

  • The documentation build installs the system libraries Qt needs. Without them the API reference pages for playnano.cli and playnano.gui were published empty.

0.5.3 - 2026-11-20

This release fixes polynomial_flatten at high orders and on data with NaN pixels, CLI parameter parsing, wizard save, and playnano analyze output names and exit codes. It also corrects the documentation examples.

Fixed

  • Publishing a release removed the main documentation from the website, so the docs home page gave a 404 until the main docs were rebuilt by hand. Every docs build now includes main, deploys no longer overlap, and the Keep Main Docs Alive workflow, which failed with an expired token, has been removed (#82).

  • playnano analyze and the wizard’s analysis export used --output-name as given, so ../name wrote outside the output folder and run.json became run.json.json. They now treat the name as process does: any folder part is dropped and a known extension is removed (#102).

  • playnano analyze exited with code 0 when the HDF5 file could not be written. It now writes every file it can, then exits with code 1 and names the files that failed (#102).

  • playnano with no subcommand exited with code 0; it now exits with code 2, like other usage errors. With --log-level DEBUG, errors from play, process and wizard now include the traceback, as analyze errors did; at other levels analyze no longer prints one (#102).

  • The wizard’s save wrote tuples and NumPy values with Python-specific YAML tags, so load failed with ConstructorError. It now writes plain YAML, as asave already did (#103).

  • Step parameters in --processing and --analysis-steps strings were split on every comma, so list values such as drop_frames:indices_to_drop=[0,1] failed, [0] stayed a string, and 1e3 and none were not converted. Values are now read as Python values: lists and tuples in brackets, numbers including 1e3, true/false and none/null. To keep a value that looks like a number as text, quote it (name='1') (#104).

  • Values typed into the wizard were left as text for float | None, list, tuple and unannotated parameters. They are now converted, so pad for intersection_crop and crop_square accepts 2 or 2,3 (#104).

  • polynomial_flatten and polynomial_flatten_masked fitted with raw pixel coordinates, so at order 3 and above on large frames the fit silently dropped terms and left background behind: on a 512 px frame at order 4 the residual was 0.187 instead of the noise level of 0.010, and at 1024 px order 3 already failed. Coordinates are now scaled to −1…1 before fitting. Results at order 3+ on frames of a few hundred pixels or more change; re-run affected processing. Both are now version 0.2.0 (#105).

  • A single NaN pixel made polynomial_flatten return an image that was entirely NaN, and made remove_plane fail with ValueError: Input y contains NaN. All four plane and polynomial filters now leave NaN pixels out of the fit and keep them NaN in the output. remove_plane and remove_plane_masked are now version 0.1.1; their results are otherwise unchanged (#105).

  • Many documentation examples failed when copied: the CLI and analysis guides used step names that do not exist (threshold_mask, detect_particles, track_particles), --export npz hdf5 instead of --export npz,h5, a --raw flag the CLI does not have, draw_scale_bar instead of draw_scale, and playnano.io.loaders instead of playnano.io.data_loaders. All examples were rerun and now work. The same wrong names are fixed in docstrings and --help text, and --help now says --draw-ts is off by default (#107).

  • Corrected reference information in the documentation: the contents of NPZ and HDF5 bundles, OME-TIFF provenance (stored in TIFF tag 65000), the default mask_morphological threshold (0.0), the pad parameter of intersection_crop and crop_square, links to the _masked filters, and claims that exports need line_rate metadata (#107).

  • The analysis module list in the documentation was not regenerated when the docs were built from the repository root, as CI does, and its links pointed to pages that do not exist. It is now written next to conf.py and links to each module’s API page. Three analysis modules were missing from the API reference. Headings on the exporting and colourmaps pages render at the right levels, and nested lists render correctly. The README licence badge now links to COPYING (#107).

  • The documentation version switcher was below the long navigation tree, outside the scrolling part of the sidebar, so it could not be reached at normal zoom. It is now at the top of the sidebar (#107).

Changed

  • The plane and polynomial filters no longer use scikit-learn, so importing the processing filters is faster (#105).

  • The conda environment file is renamed from enviroment.yaml to environment.yaml, the name the installation guide already used, and no longer limits NumPy to versions below 2.0, matching pyproject.toml (#106).

  • Tests and pre-commit checks now also run on pushes to dev. The test workflow no longer asks for write permissions, and a failed coverage upload (for example from a fork without a token) no longer fails the tests. Removed the unused count_nonzero entry point (it is built in), the unused setuptools settings and --cov-append (#106).

  • The documentation is now also built for pull requests to dev, so broken pages are found before a release (#107).

0.5.2 - 2026-11-18

This release restores loading of .asd files and .jpk/.spm folders with AFMReader 0.0.8 and fixes silent errors in frame alignment and analysis export. playnano analyze now writes to ./output by default and playnano gui is removed.

Changed

  • playnano analyze and the wizard’s analysis export now write to ./output when no --output-folder is given, as the help text already said. Previously they wrote to the current folder (#84).

  • export_bundles raises ValueError for an unsupported format instead of calling sys.exit(1), so scripts and the wizard can handle the error (#84).

Removed

  • The playnano gui subcommand. It always failed with AttributeError and was never documented; use playnano play to open the GUI (#84).

  • The median_filter (playnano.filters) and particle_detect (playnano.analysis) entry points, which named functions and modules that do not exist (#84).

Fixed

  • CITATION.cff failed schema validation, so Zenodo could not archive the v0.5.1 release (“Citation metadata load failed”). The licence is now the SPDX identifier GPL-3.0-or-later (was GPLv3+), the preferred citation type is software (was misc), and the University of Leeds affiliation is on the author entry instead of a separate, nameless author. The author’s ORCID is now included.

  • playnano analyze could overwrite its input: run beside an .h5 bundle with no output options, it replaced the bundle with the analysis results. analyze, the wizard’s analysis export and export_bundles now refuse to write over the input file, and analyze checks this before loading any data (#84).

  • Output names lost everything after the first dot that was not an extension: exp_1.5nM_protein became exp_1. Only known file extensions are now removed (#84).

  • playnano play rejected any input path containing --, such as run--2/sample.h5-jpk. Only a flag after a space (a sign of a broken Windows quote) is now rejected (#84).

  • An unsupported export format in the wizard ended the whole session. It now reports the error and carries on (#84).

  • playnano play --scale-bar-nm 0 showed a 100 nm scale bar. The GUI now starts with the scale bar switched off (#84).

  • Default playback speed in playnano play ignored bidirectional scanning, so some videos played at half speed. It now comes from the frame timestamps or frame durations, and only falls back to line_rate. Series recorded slower than 1 fps (e.g. slow-scan AFM) play at 5 fps instead of in real time (#84).

  • playnano analyze with dbscan_clustering failed after the analysis had finished (TypeError: keys must be str, int, float, bool or None, not int64), so no results were saved. Cluster ids are now plain integers, and the JSON sanitizers convert NumPy dict keys (#85).

  • Analysis HDF5 files did not reload as written: None came back as 'None', an empty dict as [], [0.0, 1.0] as integers, and a key named values crashed the loader. export_to_hdf5 now records each value’s type, and load_analysis_from_hdf5 uses it to rebuild the original structure. Lists of numbers or strings now load as Python lists, not NumPy arrays. Files written by earlier versions still load as before (#85).

  • Running an analysis pipeline a second time on the same stack kept results from steps of the earlier run that were not repeated. Each run now starts with empty results (#85).

  • AnalysisPipeline.run(log_to=...) failed if the folder did not exist, and export_analysis_to_json failed for a bare filename such as results.json (#85).

  • The analysis JSON written by playnano analyze, the wizard and AnalysisPipeline.run(log_to=...) replaced anything nested more than six levels deep, including plain numbers, with "<... truncated depth 7 ...>". Every bounding box from particle_region_extraction was lost this way. Values are now always written; the depth limit is 50 and applies to containers only, with a warning if it is ever reached (#90).

  • align_frames(method="full_cross_correlation") found no drift (all-zero shifts) on data with a height offset, which is usual for AFM, so frames were left unaligned with no error. It now subtracts each frame’s mean, as the FFT method already did, and both methods find the same shifts. Re-run any processing that used this method. align_frames is now version 0.2.0 (#86).

  • After align_frames or rolling_frame_align with mode="crop", the border_mask in the metadata kept the uncropped shape. With mode="crop_square" it had the right shape but covered the wrong region. The mask is now cropped with the same bounds as the frames. rolling_frame_align is now version 0.1.1 (#86).

  • A single NaN pixel broke frame alignment, with no error. align_frames shifted that frame by almost the whole image, and rolling_frame_align returned a zero shift for every frame. This affected any data with missing pixels and any stack aligned again after mode="pad". NaN pixels are now ignored when finding shifts and kept in the output, and a frame with no finite pixels raises ValueError (#91).

  • .asd files and folders of .jpk or .spm files failed to load with AFMReader 0.0.8 (TypeError: cannot unpack non-iterable AFMScan object), because its loaders now return an AFMScan object instead of a tuple. playNano now accepts both, and requires afmreader>=0.0.7,<0.0.9, so a future AFMReader release cannot break loading without warning (#96).

0.5.1 - 2026-11-13

Added

  • playNano logo and application icon. The GUI now sets its window and taskbar icon from bundled PNGs in playnano/resources/icons/ (pixel-aligned 16 and 32 px versions for small sizes), and on Windows registers its own taskbar identity so the playNano icon is shown instead of Python’s.

Changed

  • Depend on PySide6-Essentials instead of PySide6. playNano only uses the core Qt modules (QtCore, QtGui, QtWidgets), and the full PySide6 package now also pulls in Qt Addons, WebEngine and Pdf: about 83 MB to download instead of about 260 MB on Windows. Existing installs with the full PySide6 keep working. conda users: don’t install pyside6 from conda-forge alongside playNano; it is not recognised as PySide6-Essentials, so pip installs a second copy of Qt. enviroment.yaml and the installation docs now install Qt from pip.

Fixed

  • playnano.gui.window failed with ImportError: Failed to import any of the following Qt binding modules: PyQt5, PySide2 if it was imported before PySide6 (e.g. from a notebook or script). The GUI’s matplotlib canvas now uses the binding-neutral backend_qtagg instead of the Qt5-only backend_qt5agg.

Documentation

  • Light and dark logos in the documentation sidebar, a favicon for the docs site, and the logo at the top of the README (switches with GitHub’s light/dark theme).

0.5.0 - 2026-10-19

Added

  • drop_final_frames() function added to stack_edit module, this is a helper function that generates a list for drop_frames similarly to the other functions in the module.

  • zero_median function in both filters and masked filters module to subtract the median value from every pixel, optionally masked.

  • particle_region_extraction analysis module (ParticleRegionExtractionModule) that extracts per-particle, per-frame image regions from tracked detections — producing tight, padded, squared, or fixed-size bounding boxes plus optional raw-image and mask crops. Requires a preceding particle_tracking step.

  • particle_region_media_export analysis module (ParticleRegionMediaExportModule) that exports per-particle GIFs, video, and/or image sequences from the extracted crops, with optional colormap, timestamp, and scale-bar overlays. Requires a preceding particle_region_extraction step.

  • tracked_particle_boundary_size analysis module (BoundarySizeModule) that computes a per-particle boundary-size metric over time (max bounding-box dimension), with an optional threshold for a binary state variable. Requires a preceding particle_region_extraction step (run with include_bbox=True).

  • Unified per-frame metadata schema across all readers (.jpk folder, .h5-jpk, .spm folder, .aris, .asd). Every reader now emits exactly six keys per frame: timestamp, frame_pixel_size_nm, frame_duration_s, start_epoch_ms, scan_direction, line_rate. Fields the source format cannot provide are stored as None rather than a synthetic fallback. A new build_frame_metadata factory in playnano.utils.io_utils builds the dict and casts values to native Python types for JSON safety; FRAME_METADATA_KEYS is the authoritative tuple.

  • Real per-frame timing where the source format encodes it:

    • .spm folders: from each file’s Relative frame time header field, giving real inter-frame gaps (falls back to synthetic lines / Scan Rate if any file is missing the field).

    • .jpk folders: from per-file StartDate / EndDate TIFF tags with millisecond precision (falls back to interlace-aware scan-rate timing).

    • .h5-jpk: from meta-data/start-times / meta-data/end-times datasets, capturing real inter-frame jitter.

    • .aris: from per-frame Series/Time offsets, plus absolute start_epoch_ms derived from Global/StartTime.

  • AFMImageStack.acquisition property and provenance["acquisition"] slot, a home for whole-video acquisition metadata that doesn’t belong per-frame. Currently populated with:

    • bidirectional (bool) by the .jpk folder and .h5-jpk readers.

    • asd_file_version, asd_scan_direction_raw, asd_channels by the .asd reader.

  • Schema drift check: AFMImageStack.__init__ now logs a warning when frame_metadata carries keys outside FRAME_METADATA_KEYS, catching reader regressions early. Missing keys are still tolerated for loader round-trips.

Changed

  • Reader docstrings expanded to document per-frame populated fields, whole-video acquisition fields, timing sources and fallbacks.

  • playnano.utils.io_utils.height_units renamed to HEIGHT_UNITS.

  • Developer tooling: pre-commit-hooks bumped to v6.0.0; ome-types added to dev extras (used by the OME-TIFF units test).

Fixed

  • Bidirectional (interlaced) .jpk folder and .h5-jpk scans were timed as unidirectional, so timestamps drifted from real acquisition time. Real per-frame start/end times are now used, with interlace-aware scan-rate timing as fallback.

  • .h5-jpk: dataset name is now read from the channel group rather than reconstructed from the channel string, fixing a KeyError on camelCase datasets (e.g. MeasuredHeight).

  • .h5-jpk: z-unit attribute is now decoded properly. Previously str(bytes) produced "b'm'", so the explicit unit-conversion path never matched.

  • OME-TIFF export now records explicit PhysicalSize (X, Y in µm) and TimeIncrement metadata, so timing and calibration survive round-trips through ImageJ/Fiji and other OME consumers such as napari.

  • AFMImageStack.export_processing_log referenced self.stack.provenance, which does not exist on the class, every call raised AttributeError. Corrected to self.provenance. Two tests that mocked the same broken shape (and so passed against the bug) were updated to populate real provenance.

Removed

  • pad_to_square utility removed from playnano.utils.io_utils, no remaining callers. Related test in tests/test_utils.py removed.

Documentation

  • Loading and metadata section added to introduction.rst describing the unified per-frame schema and the stack.acquisition slot.

  • Updated processing-operations-reference.rst with zero_median and drop_final_frames

0.4.0.post1 - 2026-05-12

Documentation

  • Fixed font asset paths in README (src/playnano/fonts/ → src/playnano/resources/fonts/).

  • Corrected BibTeX citation key year (2025 → 2026).

  • Added playnano.io.render_utils to the API reference toctree.

  • Fixed underline lengths for “Video Export Options (CLI)” and “Image Sequence Export Options (CLI)” sections in exporting.rst.

  • Restored html_sidebars configuration for the version switcher in conf.py.

  • Restored full nitpick_ignore and intersphinx_mapping lists truncated during conf.py cleanup.

  • Added autosummary_generate = True and exclude_patterns = [] to conf.py.

  • Added whats_new/v0.4.0.md release notes page.

  • Updated README image links to absolute raw GitHub URLs so images render correctly on PyPI.

No code changes

0.4.0 - 2026-05-11

Added

  • Official support for Python 3.13

  • Compatibility with NumPy 2.x (including NumPy 2.0+)

Processing filters
  • Flip filter

    • Added the built-in processing filter vertical_flip, which uses NumPy flipud() to reverse the row order of a 2D image.

    • No masked equivalent is provided.

File readers
  • ARIS reader

    • Support for loading Asylum Research .aris high-speed AFM data files.

    • Comprehensive ARIS loader including:

      • Channel-name extraction from HDF5 metadata.

      • Global and per-frame pixel-size scaling with well-defined fallback behaviour.

      • Frame sorting and stacked-image construction.

      • Timestamp parsing and validation.

    • Multi-suffix file loading support, enabling correct detection of formats such as .ome.tif in addition to single-suffix formats.

Visual exports
  • Video and image sequence export

    • New export formats for animated data visualisation:

      • Video (MP4, AVI, MOV, MKV)

      • Image sequences (PNG, JPG)

    • All visual exports support metadata overlays including scale bars, timestamps, and data labels.

    • Video and sequence exports are available via the API, CLI, and GUI.

Colormaps and perceptual scaling
  • Introduced a unified colormap selection system for the GUI and all visual exports.

  • Added custom colormaps designed for AFM data:

    • afm_brown (default): perceptually linear (R² ≈ 0.996), minimising contrast compression and flicker in HS-AFM videos.

    • playnano_gold: high-contrast, full-dynamic-range (L* 0–100) map for complex topography.

    • classic_afm: legacy-style map for continuity with older AFM software.

Command Line Interface (CLI)
  • Added global --version flag.

  • Added --cmap option to select colormaps in play, process and wizard.

  • Added --fps option:

    • In play:

      • Optional argument.

      • If not provided, the frame rate is derived from the data.

      • If provided without a value or with a non-numeric value, a default FPS (5) is used and a warning is logged.

    • In process:

      • Requires a numeric value.

      • Invalid values raise an error.

  • Added --make-sequence and --make-video options for exporting image sequences and videos in process.

  • Added --draw-ts to toggle timestamp rendering in exported media (default: off).

  • Extended the wizard REPL:

    • After running a processing pipeline, GIF export prompts now include options for timestamps and scale bars (including scale-bar length).

    • After GIF export, the wizard can also export videos with configurable zmin, zmax, timestamps, and scale bars.

  • Improved CLI UX and robustness:

    • --fps in play now logs a warning when a non-numeric value is supplied and falls back gracefully, instead of failing silently.

    • Help text now explicitly documents default FPS behaviour.

Resources and assets
  • Introduced src/playnano/resources/ for non-code assets.

  • Moved bundled fonts into resources/fonts.

  • Added importlib.resources integration for robust, cross-platform asset loading.

Documentation and tests
  • Integrated sphinx-apidoc into conf.py via a builder-inited hook for automatic API documentation generation.

  • Added test coverage for:

    • ARIS HDF5 loading and edge cases.

    • Multi-suffix file handling (e.g. .ome.tif).

    • Per-frame pixel-size overrides and fallback logic.

    • Timestamp mismatch and missing-channel errors.

    • Video and image-sequence export.

    • CLI FPS parsing and help text.

  • Refined CLI test infrastructure:

    • CLI tests now patch the entrypoint dispatch directly, ensuring full coverage of argparse wiring and command dispatch.

    • Added regression tests for CLI help output and invalid argument handling.


Changed

Pixel-size handling
  • Updated pixel_size_nm semantics:

    • The AFMImageStack.pixel_size_nm attribute now represents the global or first-frame pixel size.

    • Per-frame overrides are stored in frame_metadata["frame_pixel_size_nm"].

    • Most datasets will have identical values; differences occur when scan size changes mid-scan (e.g. ARIS files).

    • GUI playback and animated exports now respect per-frame pixel size.

  • Updated NPZ, OME-TIFF, and HDF5 export documentation to reflect per-frame support.

Visualisation rendering
  • Introduced playnano.io.render_utils as a single source of truth for visual exports.

    • Centralises visual constants for consistent appearance across formats.

    • Enforces minimum output resolution to prevent pixelated annotations.

    • Ensures scale bars are physically correct based on pixel_size_nm and that text size and positioning are consistent across resolutions.

  • Rendering logic previously in export_gif has been migrated to this module.

GUI
  • Added a colormap selection dropdown to the export panel.

  • The active colormap is now displayed on the z-scale histogram and updates dynamically when zmin or zmax change.

Logging and user feedback
  • Improved warning messages for invalid CLI arguments (e.g. non-numeric --fps), providing clearer runtime feedback without interrupting interactive workflows.

Developer tooling
  • Updated pre-commit configuration, including Ruff, Black, isort and markdownlint version alignment and formatting fixes.

Tests
  • Improved numerical robustness in tests (floating-point comparisons now use tolerances for cross-platform consistency)

  • Added Python 3.13 to the test matrix


Fixed

  • Fixed loader errors relating to missing file extensions and no-suffix inputs.

  • Connected FPS calculation based on line_rate to GUI playback logic.

  • Fixed frame_metadata construction to ensure one entry per frame (previously overwritten or incomplete in some loaders, notably .spm and .jpk)

  • Standardised metadata structure across all formats:

    • timestamp

    • frame_pixel_size_nm

    • line_rate

  • Clarified pixel size behaviour per format:

    • Per-frame (.jpk, .aris, .spm)

    • Constant (.h5-jpk, .asd)

  • Updated docstrings to document pixel size semantics and usage

0.3.1 - 2026-03-12

Fixed

  • Resolved incorrect mask output in video processing pipeline. Video filter functions that return (array, metadata) were previously interpreted as (array, mask), causing metadata to be mis‑assigned as a mask and leading to failures in pipelines using mask‑aware steps.

Changed

  • Updated ProcessingPipeline._handle_video_filter_step() to accept mask as an explicit optional parameter, ensuring its correct propagation through run() / _run_single_step() without overloading metadata as mask data.

  • Metadata from video‑filter functions is now stored only in step_record as a side effect and is no longer returned as a mask-like object.

  • Added debug‑level logging for clearer diagnosis of mask‑related failures.

  • Updated the test suite to:

    • reflect the new behaviour of mask passthrough in _handle_video_filter_step(),

    • confirm that metadata is recorded correctly,

    • ensure mask value is preserved through video filter steps.

  • Removed mask handling from filters.zero_mean() and improved robustness of masked_filter.zero_mean_masked() to make each function role‑specific.

  • Incremented version numbers to reflect these changes.

  • Updated docstrings for clarity and corrected supported Python versions in the README.

0.3.0 - 2026-03-06

Added

  • Processing Plugins

    • Support for 3D stack plugins via the playnano.video_processing entry point, alongside the existing playnano.filters entry point for 2D frame plugins.

    • CLI and wizard now recognise and expose video plugins as a step type.

  • Feature Detection

    • morph_opening and sep_radius parameters added to FeatureDetectionModule to optionally separate touching or overlapping particles using morphological opening.

  • Particle Tracking

    • max_missing parameter: tracks can now persist across frames with missing detections (default: 0, preserving previous behaviour).

    • distance_scale parameter: distance threshold can now be scaled with time since last detection using "constant" (default), "linear", or "sqrt" modes.

  • Video Processing

    • pad parameter added to intersection_crop and crop_square, allowing outward expansion of the crop region beyond the finite-pixel intersection, filled with NaN.

  • CI

    • Pre-commit and test workflows now also trigger on dev branch pull requests.

    • Test workflow supports workflow_dispatch for manual triggering.

  • CONTRIBUTING.md covering development setup, project structure, code style, type hint and docstring requirements, branching workflow, and guidance on contributing analysis modules and processing plugins.

Changed

  • Breaking: Particle Tracking output

    • Track key renamed from centroids to coords.

    • Tracks now use a dense representation spanning first to last detection; frames with missing detections have None entries in coords and point_indices.

    • Migration: replace track["centroids"] with track["coords"] and handle None entries where max_missing > 0.

  • Breaking: flatten_particle_features output columns

    • mean_intensity, min_intensity, max_intensity renamed to mean, min, max.

    • Migration: update any downstream code or saved pipelines referencing the old names.

  • Breaking: intersection_crop and crop_square metadata

    • bounds key replaced by intersection_bounds (exclusive-end coordinates).

    • New keys added: intersection_shape, requested_bounds, applied_pad, pad_param.

    • Migration: replace meta["bounds"] with meta["intersection_bounds"].

  • Internal API

    • _load_plugin and _get_plugin_version removed from AFMImageStack; plugin loading is now handled entirely through _resolve_step.

    • apply() now snapshots results for all step types (video filters, stack edits, methods), not only 2D filters.

  • Tooling

    • Pre-commit Python version pinned to 3.11; demo notebook kernels updated to 3.11.

    • markdownlint-cli2 downgraded to v0.10.0 as a workaround for a CI dependency conflict (to be revisited in a future release).

    • Author name updated to “Daniel E. Rollins” in pyproject.toml.

Fixed

  • Numerous typos corrected across docstrings, inline comments, docs, and tests.

  • CLI SKIP_PARAM_NAMES expanded to avoid exposing internal array parameter names (imarray, array, frame, video) in the interactive wizard.

Documentation

  • API reference restructured with captioned sections: Core, Analysis, Analysis Modules, Processing, IO, CLI, GUI.

  • Module-level docstrings added/improved for feature_detection and particle_tracking, including See Also cross-references, version info, and AI transparency notes.

  • processing.rst updated to document the playnano.video_processing plugin entry point and link to the plugins repository.

  • Various improvements to quickstart, processing, and notebook documentation.

0.2.2

Fixed

  • Resolved a bug where the clear processing step unintentionally replaced stack.data with an invalid or uninitialised array, causing corrupted or excessively large Z-values in processed frames. The clear step now correctly clears only the current mask and returns the current working array (arr) without modifying image data.

  • Incorrect mapping of centroid_x and centroid_y in feature flattening logic. Centroids returned by regionprops were interpreted as (row, col) but incorrectly assigned as (x, y).

  • RuntimeWarning caused by invalid value casting during Z-scaling normalization in GIF export. Improved robustness of GIF frame generation when AFM data contains missing or extreme Z-values.

Changed

  • Normalization step now uses np.nan_to_num and np.clip to ensure all values are within the valid range before casting.

  • Updated centroid assignment:

    • centroid_x = centroid[1] (column → x)

    • centroid_y = centroid[0] (row → y)

Added

  • Safe normalization logic for GIF export in create_gif_with_scale_and_timestamp to handle NaN, inf, and out-of-range values before casting to np.uint8.

  • Pytest coverage for:

    • Centroid coordinate mapping

    • Autodetection of object key (tracks vs clusters)

    • Handling of out-of-range indices

    • Column presence

0.2.1

Changed

  • Package renames to all lowercase playnano to follow PEP8 and prevent cross-platform issues with case-sensitivity.

  • The import path is now playnano (lowercase). Update your code: import playnano instead of import playNano.

  • Backward‑compatibility: import playNano still works in v0.2.1 via a shim and emits a DeprecationWarning. The playNano path will be removed in a future release.

  • CLI unchanged: Keep using playnano on the command line.

  • Docs: Versioned documentation with main, stable, and tags; API reference updated to playnano.*.

0.2.0

This release introduces video processing, stack editing, multi-version documentation, and major CLI enhancements.

Added

  • Documentation

    • New Exporting Data page (docs/exporting.rst) covering OME-TIFF, NPZ, HDF5, and GIF export formats with CLI and Python examples.

    • New Processing Operations Reference page (docs/processing-operations-reference.rst) listing all built-in filters, masks, and stack/video operations with parameters.

    • Added version-switcher support for Sphinx with:

      • docs/_static/version-switcher.js and version-switcher.css.

      • Sidebar template docs/_templates/sidebar/versions.html.

    • New versions.json generation and “stable” alias logic in docs build workflow.

    • Support for multi-version documentation builds via sphinx-multiversion.

    • Added project version/commit metadata injection to Sphinx conf.py.

  • Codebase

    • AFMImageStack now registers and resolves new processing groups:

      • video_processing and stack_edit modules added.

    • Added internal state backup mechanism (state_backups attribute) for preserving original metadata.

    • Moved the versioning module for functions from the processing subpackage to the utils subpackage.

  • Docs Generation

    • Automatic inclusion of playNano.analysis.utils.loader, playNano.processing.video_processing, and playNano.processing.stack_edit in the API reference.

  • GitHub

    • Issue templates added for bug reports and feature requests.

Changed

  • Documentation

    • Documents and docstrings updated to correct typos address sphinx build warnings.

    • Instructions for installation from PyPi to the user docs.

    • Clearer instruction for the installation procedure to use notebooks added.

    • Major re-write of processing.rst:

      • Expanded explanation of pipeline structure, operation types, and provenance tracking.

      • Improved CLI/GUI examples, programmatic usage, and plugin registration guidance.

      • index.rst, introduction.rst, gui.rst, and quickstart.rst updated with links to new Exporting and Processing Operations Reference pages.

      • analysis.rst fixed Sphinx link formatting.

      • Improved generated module list formatting for analysis modules.

      • Updated Sphinx conf.py to:

        • Support multi-version builds, version detection, and sidebar switcher.

        • Move src path resolution to a relative form.

        • Reorganize theme and HTML sidebar configuration.

      • Added sphinx-multiversion to pyproject.toml under [project.optional-dependencies.docs].

  • GitHub Actions

    • Overhauled docs.yaml workflow:

      • Builds and deploys versioned docs on main and release tags.

      • Adds PR preview artifact upload.

      • Generates versions.json and root redirect index.

      • Creates “stable” alias for latest release.

    • Renamed job to “Build and Deploy Docs”.

    • Notebooks

      • Added a root search function so hard coded paths to demo data from the tests folder can be accessed wherever jupyter is launched from.

Fixed

  • Documentation

    • Corrected malformed Sphinx links and build warnings across multiple pages.

    • Improved auto-generated module list formatting and spacing.

0.1.0.post1 - 2025-10-14

Changed

  • GitHub

    • Add workflows for pypi publishing

  • Documentation

    • Add badges for tests, PyPi python version and PyPi releases.

    • Added links to the documentation and user guide on github pages.

    • Added a PyPi installation guide to the README and user guide.

    • Some general rewriting and improvements

0.1.0 - 2025-09-17

Added

  • First public release 🎉

  • AFM data loading & playback

    • Load HS‑AFM videos from .h5-jpk and .asd files and folders of .spm and .jpk files.

    • Time‑aware frame navigation and consistent pixel/scale metadata.

  • Processing pipeline with masks & full provenance

    • Sequential filters and masks (e.g., plane removal, row/median alignment, polynomial flatten, Gaussian filtering).

    • Each step is recorded with index, name, parameters, timestamps, and environment details under stack.provenance.

    • Processed snapshots and masks are stored with ordered keys like step_<n>_<name> for reliable inspection and re‑use.

  • Reproducible export & re‑import (analysis‑ready)

    • Save the current stack state (with stages, masks, and provenance) to HDF5 (.h5) or NumPy bundles (.npz).

    • Re‑load bundles later to continue processing and run analyses with the full history intact.

    • Export to OME‑TIFF for interoperability and to GIF (with optional scale bars) for quick sharing and presentation.

  • Interactive GUI (PySide6) for exploration

    • Real‑time playback, frame seeking, and snapshot previews.

    • Z‑range control (auto or manual) to maintain consistent height scaling across frames.

    • Annotations/overlays (i.e. timestamps, raw data label, scale bar) rendered on top of frames.

    • Built‑in dark theme stylesheet for high‑contrast analysis.

  • Analysis framework

    • Build analysis pipelines from built-in and pluggable analysis modules.

    • Built-in analysis modules (e.g., LoG blob detection, DBSCAN/K‑Means/X‑Means clustering, particle tracking).

    • Produces labeled masks, per‑feature properties (area, min/max/mean, bbox, centroid), and summary statistics.

    • Analysis outputs are keyed and traced in provenance for reproducibility.

  • Command Line Interface (CLI)

    • playnano entrypoint to run processing pipelines, export bundles (TIFF/NPZ/HDF5), and create GIFs from the shell.

  • Notebooks

    • Jupyter notebooks included to demonstrate programmatic workflow.

    • Overview notebook covers the whole loading, processing, analysis and export workflow.

    • Processing notebook focuses on processing and export of loaded data.

  • Documentation:

    • Created a Sphinx documentation site on GitHub Pages.

    • User Guide covering installation, quick start, GUI and CLI usage, processing, analysis and exports.

    • API Reference generated with sphinx-autoapi for all packages.

    • CLI reference with examples and typical workflows.

    • Furo theme and MyST Markdown configuration for a clean, consistent look.

Changed

  • N/A (initial public release).

Fixed

  • N/A (initial public release).