Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@
^man/figures/relabel-workflow\.png$
^man/figures/sample-browser\.png$
^man/figures/settings-dialog\.png$
^man/figures/class-review\.png$
13 changes: 8 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ClassiPyR
Title: A Shiny App for Manual Image Classification and Validation of IFCB Data
Version: 0.1.1
Version: 0.2.0
Authors@R: c(
person("Anders", "Torstensson", email = "anders.torstensson@smhi.se", role = c("aut", "cre"),
comment = c("Swedish Meteorological and Hydrological Institute", ORCID = "0000-0002-8283-656X")),
Expand All @@ -9,9 +9,10 @@ Authors@R: c(
)
Description: A Shiny application for manual classification and validation of
Imaging FlowCytobot (IFCB) plankton images. Supports loading classifications
from CSV files or MATLAB classifier output, drag-select for batch operations,
and exports classifications in MATLAB-compatible format for use with the
'ifcb-analysis' toolbox.
from CSV, HDF5 (.h5), or MATLAB classifier output, directly from remote
IFCB Dashboard instances, or via live CNN prediction through a Gradio API.
Features drag-select for batch operations and exports classifications in
MATLAB-compatible format for use with the 'ifcb-analysis' toolbox.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand All @@ -20,7 +21,8 @@ Imports:
shinyjs,
shinyFiles,
bslib,
iRfcb,
curl,
iRfcb (>= 0.8.1),
dplyr,
DT,
jsonlite,
Expand All @@ -30,6 +32,7 @@ Imports:
Suggests:
testthat (>= 3.0.0),
covr,
hdf5r,
knitr,
rmarkdown,
pkgdown
Expand Down
20 changes: 20 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,53 @@
export(copy_images_to_class_folders)
export(create_empty_changes_log)
export(create_new_classifications)
export(download_dashboard_adc)
export(download_dashboard_autoclass)
export(download_dashboard_image_single)
export(download_dashboard_images)
export(download_dashboard_images_bulk)
export(download_dashboard_images_individual)
export(export_all_db_to_mat)
export(export_all_db_to_png)
export(export_db_to_mat)
export(export_db_to_png)
export(filter_to_extracted)
export(get_config_dir)
export(get_dashboard_cache_dir)
export(get_db_path)
export(get_default_db_dir)
export(get_file_index_path)
export(get_sample_paths)
export(get_settings_path)
export(import_all_mat_to_db)
export(import_mat_to_db)
export(import_png_folder_to_db)
export(init_python_env)
export(is_valid_sample_name)
export(list_annotated_samples_db)
export(list_annotation_metadata_db)
export(list_classes_db)
export(list_dashboard_bins)
export(load_annotations_db)
export(load_class_annotations_db)
export(load_class_list)
export(load_file_index)
export(load_from_classifier_mat)
export(load_from_csv)
export(load_from_db)
export(load_from_h5)
export(load_from_mat)
export(parse_dashboard_url)
export(read_roi_dimensions)
export(rescan_file_index)
export(run_app)
export(sanitize_string)
export(save_annotations_db)
export(save_class_review_changes_db)
export(save_file_index)
export(save_sample_annotations)
export(save_validation_statistics)
export(scan_png_class_folder)
export(update_annotator)
importFrom(DBI,dbConnect)
importFrom(DBI,dbDisconnect)
Expand All @@ -43,9 +59,13 @@ importFrom(DBI,dbWriteTable)
importFrom(DT,renderDT)
importFrom(RSQLite,SQLite)
importFrom(bslib,bs_theme)
importFrom(curl,curl_fetch_disk)
importFrom(curl,curl_fetch_memory)
importFrom(curl,new_handle)
importFrom(dplyr,filter)
importFrom(iRfcb,ifcb_annotate_samples)
importFrom(iRfcb,ifcb_create_manual_file)
importFrom(iRfcb,ifcb_download_dashboard_data)
importFrom(iRfcb,ifcb_extract_pngs)
importFrom(iRfcb,ifcb_get_mat_variable)
importFrom(jsonlite,fromJSON)
Expand Down
24 changes: 24 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# ClassiPyR 0.2.0

## New features

- **Live Prediction**: Added a "Predict" button in Sample Mode that classifies all images in the loaded sample using a remote CNN model via `iRfcb::ifcb_classify_images()`. Configure the Gradio API URL and model in Settings > Live Prediction. The model dropdown is populated dynamically from the Gradio server. Predictions respect the classification threshold setting, skip manually reclassified images, and new class names from the model are added to the class list automatically. A per-image progress bar shows classification progress.
- **IFCB Dashboard support**: Connect directly to remote IFCB Dashboard instances (e.g. `https://habon-ifcb.whoi.edu/`) without downloading data locally. Toggle between "Local Folders" and "IFCB Dashboard" in Settings, enter a Dashboard URL (with optional `?dataset=` parameter), and browse samples from the API. Images are downloaded on demand and cached locally. Optionally load dashboard auto-classifications for validation mode. Supports MAT export by downloading ADC files on demand, with graceful fallback to SQLite-only when ADC is unavailable.
- **Dashboard class review optimization**: Class review mode with a dashboard source now downloads individual PNG images instead of entire zip archives, making it much faster when reviewing a single class across many samples.
- **Configurable dashboard download settings**: Dashboard mode now exposes parallel downloads, sleep time, timeout, and max retries in an "Advanced Download Settings" section in Settings. Previously these were hardcoded.
- **Local classification files in dashboard mode**: The Classification Folder setting is now available in dashboard mode. When configured, local CSV/H5/MAT classification files take priority over dashboard auto-classifications, with dashboard autoclass as a fallback.
- New exported functions: `parse_dashboard_url()`, `list_dashboard_bins()`, `download_dashboard_images()`, `download_dashboard_images_bulk()`, `download_dashboard_image_single()`, `download_dashboard_images_individual()`, `download_dashboard_adc()`, `download_dashboard_autoclass()`, and `get_dashboard_cache_dir()` for programmatic dashboard access.
- **Class Review Mode**: View and reclassify all annotated images of a specific class across the entire database. Switch to class review via the mode toggle in the sidebar, select a class, and load all matching images from all samples at once. Changes are saved as row-level updates to the database.
- New exported functions: `list_classes_db()`, `load_class_annotations_db()`, and `save_class_review_changes_db()` for programmatic class review operations.
- Added **Import PNG → SQLite** button in Settings > Import / Export. Imports annotations from a folder of PNG images organized in class-name subfolders (e.g. exported by ClassiPyR or other tools). Folder names follow the iRfcb convention where trailing `_NNN` suffixes are stripped.
- When importing PNG folders with class names not in the current class list, a **class mapping dialog** lets users remap unmatched classes to existing ones or add them as new classes.
- Overwrite warning dialog shown when imported samples already exist in the database.
- New exported functions: `scan_png_class_folder()` for scanning PNG class folder structures, and `import_png_folder_to_db()` for programmatic bulk import.
- **HDF5 classification support**: Load classifications from `.h5` files produced by [iRfcb](https://github.com/EuropeanIFCBGroup/iRfcb) (>= 0.8.0). Requires the optional `hdf5r` package.
- **Classification threshold toggle**: New "Apply classification threshold" checkbox in Settings controls whether thresholded or raw predictions are used, for all classification formats (CSV, H5, MAT).
- **Skip class from PNG export**: New option in Settings to exclude a specific class (e.g. "unclassified") from PNG output.

## UI improvements

- The **class list editor** now shows the number of annotated images per class in parentheses, queried from the SQLite database.

# ClassiPyR 0.1.1

## New features
Expand Down
Loading