From 10c5517b41848954140e2f31f74240da535731cc Mon Sep 17 00:00:00 2001 From: Laurent Guerard Date: Tue, 8 Apr 2025 15:58:03 +0200 Subject: [PATCH 1/4] Add missing methods to changelog and reformatting --- CHANGELOG.md | 112 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 84 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 802e9c22..b0de339c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ detailed information, please refer to the updated API documentation. ### Added +* `imcflibs.strtools.pad_number` to pad a number with leading zeros. +* `imcflibs.pathtools.create_directory` to create a new directory at the + specified path if it does not exist (needed with python 2.7) * Various additions to `imcflibs.imagej.misc`: * `imcflibs.imagej.misc.send_notification_email` to send email notifications upon completion of long-running scripts. @@ -23,45 +26,56 @@ detailed information, please refer to the updated API documentation. * `imcflibs.imagej.misc.sanitize_image_title` to remove special chars and various suffixes from an ImagePlus. * `imcflibs.imagej.misc.subtract_images` to subtract an image from another. - * `imcflibs.imagej.misc.close_images` for closing selected image windows. + * `imcflibs.imagej.misc.close_images` for closing all ImagePluses from a list. * `imcflibs.imagej.misc.get_threshold_value_from_method` to get the value that a selected AutoThreshold method would be using. - * `imcflibs.imagej.misc.write_orderddict_to_csv` to write data from an ordered - dictionary to a CSV file. -* `imcflibs.imagej.labelimage.binary_to_label` for segmenting a binary image to - get a label image (2D/3D). -* `imcflibs.imagej.misc.save_image_in_format` to save an ImagePlus image in a - specified format, such as ImageJ-TIF or OME-TIFF etc., to a given directory. -* `imcflibs.imagej.misc.run_imarisconvert` to convert a given file to Imaris - format using the utility ImarisConvert. Method uses - `imcflibs.imagej.misc.locate_latest_imaris` to find the path to the Imaris - installation. - + * `imcflibs.imagej.misc.write_ordereddict_to_csv` to write data from an ordered + dictionary (or list of ordered dictionaries) to a CSV file. + * `imcflibs.imagej.misc.save_image_in_format` to save an ImagePlus in a + specified format, such as ImageJ-TIF or OME-TIFF etc., to a given directory. + * `imcflibs.imagej.misc.run_imarisconvert` to convert a given file to Imaris + format using the utility ImarisConvert. Method uses + `imcflibs.imagej.misc.locate_latest_imaris` to find the path to the Imaris + installation. +* New functions in `imcflibs.imagej.labelimage`: + * `imcflibs.imagej.labelimage.cookie_cut_labels` to use a label image as a mask + for another label image. Objects might get split or merged depending on the + mask. + * `imcflibs.imagej.labelimage.binary_to_label` for segmenting a binary image to + get a label image (2D/3D). + * `imcflibs.imagej.labelimage.relate_label_images` to relate two label images + (2D/3D) using the 3D Association plugin from the 3DImageJSuite. + * `imcflibs.imagej.labelimage.dilate_labels_2d` to dilate a label image slice by + slice. Works for 2D or 3D images. * New `imcflibs.imagej.objects3d` submodule, providing: - * `imcflibs.imagej.objects3d.population3d_to_imgplus` to turn - an Objects3DPopulation into an ImagePlus (2D/3D). + * `imcflibs.imagej.objects3d.population3d_to_imgplus` to turn an + Objects3DPopulation into an ImagePlus (2D/3D). * `imcflibs.imagej.objects3d.imgplus_to_population3d` to get the Objects3DPopulation from an ImagePlus (2D/3D). * `imcflibs.imagej.objects3d.segment_3d_image` to threshold an image into a labeled stack. * `imcflibs.imagej.objects3d.get_objects_within_intensity` to filter a population of 3D objects by intensity. + * `imcflibs.imagej.objects3d.maxima_finder_3d` to find local maxima in a + 3D image. + * `imcflibs.imagej.objects3d.seeded_watershed` to perform a seeded watershed + segmentation on a binary image using seeds points. * New `imcflibs.imagej.bdv` submodule, providing BigDataViewer related functions: * New classes: * `ProcessingOptions` to store all options on how to process the dataset. * `DefinitionOptions` to store all options on how to define the dataset. - * `imcflibs.imagej.bdv.check_processing_input` to sanitize and clarify - the acitt input selection. - * `imcflibs.imagej.bdv.get_processing_settings` to generate the strings - needed for the processing. + * `imcflibs.imagej.bdv.check_processing_input` to sanitize and clarify the + acitt input selection. + * `imcflibs.imagej.bdv.get_processing_settings` to generate the strings needed + for the processing. * `imcflibs.imagej.bdv.backup_xml_files` to create a backup of BDV-XML files. * `imcflibs.imagej.bdv.define_dataset_auto` to run "Define Multi-View Dataset" using the "Auto-Loader" option. * `imcflibs.imagej.bdv.define_dataset_manual` to run "Define Multi-View Dataset" using the "Manual Loader" option. - * `imcflibs.imagej.bdv.resave_as_h5` to resave the dataset in H5 to - make it compatible with BigDataViewer/BigStitcher. + * `imcflibs.imagej.bdv.resave_as_h5` to resave the dataset in H5 to make it + compatible with BigDataViewer/BigStitcher. * `imcflibs.imagej.bdv.flip_axes` tocall BigStitcher's "Flip Axes" command. * `imcflibs.imagej.bdv.phase_correlation_pairwise_shifts_calculation` to calculate pairwise shifts using Phase Correlation. @@ -77,14 +91,56 @@ detailed information, please refer to the updated API documentation. propagating transformation parameters to other channels. * `imcflibs.imagej.bdv.fuse_dataset` to call BigStitcher's "Fuse Multi-View Dataset" command. -* New `imcflibs.imagej.trackmate` submodule to provide helper functions to interface with Trackmate: - * Multiple functions to set up Trackmate settings with different detectors, such as `cellpose`, `StarDist` or a `sparseLAP tracker`. - * `imcflibs.imagej.trackmate.spot_filtering` to create settings to filter detected spots based on optional thresholds for quality, area, circularity & intensity. - * `imcflibs.imagej.trackmate.track_filtering` to create settings to filter detected tracks based upon optional distances, such as maximum linking, gap closing, track splitting & merging and maximum frame gap. - * `imcflibs.imagej.trackmate.run_trackmate` to run Fiji's Trackmate plugin on an open ImagePlus with given settings, which can be set up with available methods in the `imcflibs.imagej.trackmate` submodule. The method then returns a label image. -* New `imcflibs.imagej.omerotools` submodule, providing helper functions to connect to OMERO using user credentials, fetch and upload an image, retrieve a dataset, or save ROIs to OMERO. - -* `imcflibs.pathtools.create_directory` to create a new directory at the specified path. +* New `imcflibs.imagej.trackmate` submodule to provide helper functions to + interface with Trackmate: + * Multiple functions to set up Trackmate settings with different detectors, + such as `cellpose`, `StarDist` or a `log detector`. + * `imcflibs.imagej.trackmate.spot_filtering` to create settings to filter + detected spots based on optional thresholds for quality, area, circularity & + intensity. + * `imcflibs.imagej.trackmate.sparse_lap_tracker` to create default settings for the + sparse LAP tracker. + * `imcflibs.imagej.trackmate.track_filtering` to create settings to filter + detected tracks based upon optional distances, such as maximum linking, gap + closing, track splitting & merging and maximum frame gap. + * `imcflibs.imagej.trackmate.run_trackmate` to run Fiji's Trackmate plugin on + an open ImagePlus with given settings, which can be set up with available + methods in the `imcflibs.imagej.trackmate` submodule. The method then + returns a label image. +* New `imcflibs.imagej.omerotools` submodule, providing helper functions to + connect to OMERO using user credentials, fetch and upload an image, retrieve a + dataset, or save ROIs to OMERO. + * `imcflibs.imagej.omerotools.parse_url` to parse the OMERO URL and get a list + of `ImageWrappers` from multiple image or datasets IDs. + * `imcflibs.imagej.omerotools.connect` to connect to OMERO using user + credentials. + * `imcflibs.imagej.omerotools.fetch_image` to fetch an image from OMERO using + the image ID. + * `imcflibs.imagej.omerotools.upload_image_to_omero` to upload a local image to + OMERO and returning the new image ID. + * `imcflibs.imagej.omerotools.add_keyvalue_annotation` to add an annotation to an + OMERO object. + * `imcflibs.imagej.omerotools.delete_keyvalue_annotations` to delete + annotations from an OMERO object. + * `imcflibs.imagej.omerotools.find_dataset` to find a dataset in OMERO using + the dataset ID. + * `imcflibs.imagej.get_acquisition_metadata` to get the acquisition metadata + from an image in OMERO. + * `imcflibs.imagej.omerotools.get_info_from_original_metadata` to get the + original metadata from an image in OMERO. + * `imcflibs.imagej.omerotools.create_table_columns` to create OMERO table + headings from a list of column names. + * `imcflibs.imagej.omerotools.upload_array_as_omero_table` to upload a table + to OMERO. + * `imcflibs.imagej.omerotools.save_rois_to_omero` to save ROIs to OMERO. +* New `imcflibs.imagej.shading` module for everything background correction. + * `imcflibs.imagej.shading.simple_flatfield_correction` to perform a + simple flatfield correction to an ImagePlus. +* `imcflibs.imagej.projection.project_stack` to project a stack using + different projection methods, such as `max`, `min`, `mean`, `sum` or + `standard_deviation` using a defined axis. +* `imcflibs.imagej.prefs.set_default_ij_options` to configure ImageJ default + options for consistency. ## 1.4.0 From fcb2bc6a1c3892e76d0a65bfb0ecbd4a249ab93d Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter Date: Tue, 8 Apr 2025 15:06:09 +0200 Subject: [PATCH 2/4] Attempt to configure codecov reports With the lack of possible unit-testing for the Java-only parts, we unfortunately need to have ultra-relaxed coverage reports, otherwise they will quickly become annoying and disliked. --- .github/codecov.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000..40446366 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,11 @@ +coverage: + precision: 0 + round: nearest + range: "0...75" + # notification blocks + # https://docs.codecov.io/docs/codecovyml-reference#section-coverage-notify + notify: + status: + project: + patch: + changes: From dde74d9e2283ba0f1e764563033340ef51d57ea7 Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter Date: Tue, 8 Apr 2025 16:12:35 +0200 Subject: [PATCH 3/4] Validate and fix codecov.yml --- .github/codecov.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 40446366..eba40389 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,11 +1,13 @@ coverage: precision: 0 round: nearest - range: "0...75" + range: + - 0 + - 75 # notification blocks # https://docs.codecov.io/docs/codecovyml-reference#section-coverage-notify - notify: - status: - project: - patch: - changes: + # notify: + # status: + # project: + # patch: + # changes: off From 6eabd3ee8f26400a94cc29591e20c888d2f1fd1f Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter Date: Tue, 8 Apr 2025 16:21:29 +0200 Subject: [PATCH 4/4] Rewraps (line length) --- CHANGELOG.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0de339c..d0829349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,8 @@ detailed information, please refer to the updated API documentation. * `imcflibs.imagej.misc.close_images` for closing all ImagePluses from a list. * `imcflibs.imagej.misc.get_threshold_value_from_method` to get the value that a selected AutoThreshold method would be using. - * `imcflibs.imagej.misc.write_ordereddict_to_csv` to write data from an ordered - dictionary (or list of ordered dictionaries) to a CSV file. + * `imcflibs.imagej.misc.write_ordereddict_to_csv` to write data from an + ordered dictionary (or list of ordered dictionaries) to a CSV file. * `imcflibs.imagej.misc.save_image_in_format` to save an ImagePlus in a specified format, such as ImageJ-TIF or OME-TIFF etc., to a given directory. * `imcflibs.imagej.misc.run_imarisconvert` to convert a given file to Imaris @@ -38,15 +38,15 @@ detailed information, please refer to the updated API documentation. `imcflibs.imagej.misc.locate_latest_imaris` to find the path to the Imaris installation. * New functions in `imcflibs.imagej.labelimage`: - * `imcflibs.imagej.labelimage.cookie_cut_labels` to use a label image as a mask - for another label image. Objects might get split or merged depending on the - mask. - * `imcflibs.imagej.labelimage.binary_to_label` for segmenting a binary image to - get a label image (2D/3D). + * `imcflibs.imagej.labelimage.cookie_cut_labels` to use a label image as a + mask for another label image. Objects might get split or merged depending on + the mask. + * `imcflibs.imagej.labelimage.binary_to_label` for segmenting a binary image + to get a label image (2D/3D). * `imcflibs.imagej.labelimage.relate_label_images` to relate two label images (2D/3D) using the 3D Association plugin from the 3DImageJSuite. - * `imcflibs.imagej.labelimage.dilate_labels_2d` to dilate a label image slice by - slice. Works for 2D or 3D images. + * `imcflibs.imagej.labelimage.dilate_labels_2d` to dilate a label image slice + by slice. Works for 2D or 3D images. * New `imcflibs.imagej.objects3d` submodule, providing: * `imcflibs.imagej.objects3d.population3d_to_imgplus` to turn an Objects3DPopulation into an ImagePlus (2D/3D). @@ -98,8 +98,8 @@ detailed information, please refer to the updated API documentation. * `imcflibs.imagej.trackmate.spot_filtering` to create settings to filter detected spots based on optional thresholds for quality, area, circularity & intensity. - * `imcflibs.imagej.trackmate.sparse_lap_tracker` to create default settings for the - sparse LAP tracker. + * `imcflibs.imagej.trackmate.sparse_lap_tracker` to create default settings + for the sparse LAP tracker. * `imcflibs.imagej.trackmate.track_filtering` to create settings to filter detected tracks based upon optional distances, such as maximum linking, gap closing, track splitting & merging and maximum frame gap. @@ -116,10 +116,10 @@ detailed information, please refer to the updated API documentation. credentials. * `imcflibs.imagej.omerotools.fetch_image` to fetch an image from OMERO using the image ID. - * `imcflibs.imagej.omerotools.upload_image_to_omero` to upload a local image to - OMERO and returning the new image ID. - * `imcflibs.imagej.omerotools.add_keyvalue_annotation` to add an annotation to an - OMERO object. + * `imcflibs.imagej.omerotools.upload_image_to_omero` to upload a local image + to OMERO and returning the new image ID. + * `imcflibs.imagej.omerotools.add_keyvalue_annotation` to add an annotation to + an OMERO object. * `imcflibs.imagej.omerotools.delete_keyvalue_annotations` to delete annotations from an OMERO object. * `imcflibs.imagej.omerotools.find_dataset` to find a dataset in OMERO using