Skip to content
Snippets Groups Projects
  1. Feb 13, 2025
    • Pierre Tocquin's avatar
      feat(internode_analysis,manual_editing): enhance internode processing and add manual editing tool · e1e44ae4
      Pierre Tocquin authored
      Updated internode_analysis.ijm to version 1.2 with improvements in handling image inputs, enhanced morphological measurement processes, and added user interactions for dynamic validation. Additionally, introduced a new ImageJ macro script manual_editing.ijm for annotating nodes and internodes, which assists users in manually selecting and modifying ROIs. Also changed logging level from debug to info in process_pipeline.py for better visibility of the image splitting process.
      e1e44ae4
  2. Feb 04, 2025
    • Pierre Tocquin's avatar
      fix(process_pipeline): handle large images by splitting before saving · c4d6ef4f
      Pierre Tocquin authored
      The modification addresses the issue of handling excessively large images by splitting them into two parts if they exceed 2 billion pixels. This change prevents memory issues during processing and ensures successful saving by storing each part separately. Logging has been updated to reflect the new paths where the image parts are saved.
      c4d6ef4f
  3. Jan 08, 2025
    • Pierre Tocquin's avatar
      fix(segmentation): correct edge detection in segmentation mask · d6cf3db5
      Pierre Tocquin authored
      Replaced the condition to check for any non-zero elements at the edges of the cluster mask using np.any(). This fixes a bug where clusters on the edge were incorrectly identified due to improper zero checks, potentially improving segmentation accuracy.
      d6cf3db5
    • Pierre Tocquin's avatar
      feat(config): add configurable segment and image size limits · fb5d9c5b
      Pierre Tocquin authored
      Added 'segment_size' and 'max_image_size' as required config keys to allow dynamic configuration of image processing constraints. This change enables customizing subsample size and maximum image size directly through the configuration, improving flexibility and control over processing large segmented images.
      fb5d9c5b
  4. Jan 07, 2025
    • Pierre Tocquin's avatar
      feat(dependencies): add imagecodecs to requirements.txt · e074fee3
      Pierre Tocquin authored
      Add the imagecodecs library to the list of dependencies in requirements.txt for improved image processing support. This addition may enhance performance or enable new functionality when dealing with various image formats. It's important to ensure compatibility with existing libraries and test the application for any potential integration issues arising from this change.
      e074fee3
  5. Dec 24, 2024
    • Pierre Tocquin's avatar
      feat(process_pipeline): add subsampling for large segmented images · a08f8a59
      Pierre Tocquin authored
      Added functionality to subsample large segmented images for processing in memory-constrained environments. The script now checks image size and subsamples if necessary, processes each segment, and reassembles the final corrected image. This change prevents memory overflow issues with very large images. Additionally, edge cluster handling was improved by skipping clusters that touch the image border to ensure cleaner segmentation results.
      a08f8a59
  6. Dec 15, 2024
    • Pierre Tocquin's avatar
      chore(logging): change log level from debug to info · 3932a940
      Pierre Tocquin authored
      Updated the logging level from debug to info for better visibility of label evaluation in the image segmentation process. This adjustment helps ensure that key processing steps are logged with a prominence suitable for regular monitoring, rather than being hidden in debug-level logs.
      3932a940
  7. Dec 14, 2024
    • Pierre Tocquin's avatar
      refactor(pipeline): remove unused parameter from segmentation correction · cd94602c
      Pierre Tocquin authored
      The parameter `closing_kernel_size` was removed from the `correct_segmentation_issues` function as it was not being used in the function logic. Additionally, the default value for `area_threshold` was increased from 50 to 750, and the range for `aspect_ratio_min` was adjusted from 1.5 to 1 to better filter true nodes of Ranvier based on empirical observations.
      cd94602c
    • Pierre Tocquin's avatar
      fix(config): remove `closing_kernel_size` from required keys · 8bec9b7e
      Pierre Tocquin authored
      The `closing_kernel_size` parameter was removed from the list of required configuration keys in the `load_config` function. This change might be necessary if the parameter is optional or deprecated, ensuring that config validation aligns with actual usage or expected defaults.
      8bec9b7e
    • Pierre Tocquin's avatar
      refactor(segmentation): simplify process by removing unused code · fcc827cd
      Pierre Tocquin authored
      Removed outdated code sections related to contour handling and closing_kernel_size, streamlining the segmentation correction function. Implemented a median blur filter at the beginning of the function to enhance image smoothing. These changes simplify the pipeline and focus on preserving large red clusters with valid aspect ratios without additional complex operations.
      fcc827cd
    • Pierre Tocquin's avatar
      fix(pipeline): correct binary mask initialization for contour detection · d11ee95d
      Pierre Tocquin authored
      Change the initialization of `cluster_mask` from zeros to a full 255 value image in `correct_segmentation_issues()` function. This modification ensures that the mask used for contour extraction is fully white, which is necessary for accurate segmentation and contour operations. The previous zero-initialized mask led to incorrect contour identifications.
      d11ee95d
  8. Dec 13, 2024
  9. Dec 12, 2024
    • Pierre Tocquin's avatar
      refactor(segmentation): simplify cluster filtering logic · 5cd9b2b5
      Pierre Tocquin authored
      Removed the `bad_cluster` flag and simplified the logic for handling clusters in the segmentation correction process. Small clusters below the area threshold are now directly ignored, streamlining the flow and reducing unnecessary checks. This change improves code readability without altering functionality.
      5cd9b2b5
    • Pierre Tocquin's avatar
      fix(segmentation): reset bad_cluster flag inside loop · 0bb80e0f
      Pierre Tocquin authored
      Move the initialization of the bad_cluster variable inside the loop to ensure it is reset for each label evaluation. This resolves a logic error where bad_cluster might incorrectly retain a previous state, affecting segmentation issue correction.
      0bb80e0f
    • Pierre Tocquin's avatar
      refactor(process_pipeline): improve readability of cluster check condition · dbf64b22
      Pierre Tocquin authored
      Updated the condition to explicitly compare `bad_cluster` with `True` for improved readability and clarity, ensuring the logic is easily understandable.
      dbf64b22
    • Pierre Tocquin's avatar
      refactor(segmentation): remove unused bad_cluster variable · 612d5b4c
      Pierre Tocquin authored
      The variable 'bad_cluster' was commented out and not utilized in the logic flow. This commit eliminates the redundancy by removing the unnecessary assignments and aligning code execution with intended functionality.
      612d5b4c
    • Pierre Tocquin's avatar
      refactor(segmentation): revise handling of small and invalid clusters · 2ac5371d
      Pierre Tocquin authored
      Removed the set `true_red_clusters` and replaced conditional checks with a boolean flag `bad_cluster` to streamline the decision process for handling small or invalid clusters. This change ensures that any cluster not meeting criteria is consistently processed by modifying pixel values based on contour presence, improving code clarity and maintainability.
      2ac5371d
    • Pierre Tocquin's avatar
      fix(segmentation): handle clusters with incorrect aspect ratios · 8ad4cc1d
      Pierre Tocquin authored
      Add logic to process clusters failing the aspect ratio test in the segmentation correction function. This change involves executing additional code for creating a binary mask of contours when clusters do not meet the defined aspect ratio criteria. This ensures better handling and processing of image segmentation anomalies.
      8ad4cc1d
    • Pierre Tocquin's avatar
      refactor(segmentation): update red cluster detection and comment out unused logic · 5916f1ad
      Pierre Tocquin authored
      Changed the segmentation process by updating the connected components function to use a specific labeling algorithm. Enhanced handling of red clusters by adding a method to modify pixels based on contour analysis and adjacency. Removed small red cluster processing and blue region filling logic, which were not used in this context, potentially preparing for future reimplementation or optimization.
      5916f1ad
  10. Dec 11, 2024
    • Pierre Tocquin's avatar
      refactor(segmentation): simplify nerve segment fusion using distance transform · 5cfceba8
      Pierre Tocquin authored
      Replaced contour-based fusion with a distance transform approach for filling interruptions in nerve segments, improving code simplicity and potentially performance. The redundant function for calculating minimum distances between contours was removed, and morphological operations were added to clean up the fused mask.
      5cfceba8
    • Pierre Tocquin's avatar
      refactor(segmentation): replace cv2.pointPolygonTest with custom distance function · 7c6b429f
      Pierre Tocquin authored
      Replaced the use of cv2.pointPolygonTest with a new custom function min_distance_between_contours to accurately calculate the minimum distance between two contours. This change removes dependency on point-polygon testing and ensures correct contour merging under the specified threshold distance.
      7c6b429f
    • Pierre Tocquin's avatar
      refactor(pipeline): improve nerve segmentation with contour merging · 6401c3cc
      Pierre Tocquin authored
      Replaced the commented-out morphological closing method with a new approach based on contour detection and merging for blue regions (nerve segments). This method identifies and merges close contours, improving segmentation by filling interruptions more accurately. Removed unused code to clean up the function.
      6401c3cc
    • Pierre Tocquin's avatar
      chore(cleanup): remove internode filtering script · b1f6a5c4
      Pierre Tocquin authored
      The `internode_filtering.ijm` script has been deleted. This file performed image processing tasks related to internode analysis, including segmenting and analyzing images, user validation of regions, morphological transformations, and measurement extraction. The removal suggests that the script is either obsolete or replaced by another process or tool. Ensure any dependencies on this script are updated or removed accordingly.
      b1f6a5c4
    • Pierre Tocquin's avatar
      feat(internode-filtering): add new script for internode region analysis · 8c5d1836
      Pierre Tocquin authored
      Introduce a script for the Teasing Analysis Tool that processes segmented images to analyze and curate internode regions. This tool supports user interaction for validation, applies morphological transformations to improve accuracy, extracts skeleton traces, and computes morphological measurements. Outputs include cleaned ROIs and measurement data saved in specified formats. The script requires ImageJ version 1.54f or later.
      8c5d1836
    • Pierre Tocquin's avatar
      fix(segmentation): correct conversion logic for small red clusters · 1714f9d1
      Pierre Tocquin authored
      Adjusted the condition to convert small red clusters to blue if any blue pixels are present in the neighborhood, instead of comparing the count to white pixels. This ensures more consistent identification of node areas in images.
      1714f9d1
  11. Dec 10, 2024
    • Pierre Tocquin's avatar
      feat(image-analysis): add internode analysis script · f1751605
      Pierre Tocquin authored
      Introduce a new ImageJ macro script for analyzing and tracing internode regions in segmented images. The tool performs morphological transformations and allows user validation to refine regions of interest, ultimately outputting cleaned ROIs and measurement data. This script is designed to enhance image processing workflows by providing automated internode identification and trace extraction, improving the accuracy and efficiency of data analysis for relevant biological research applications.
      f1751605
  12. Dec 05, 2024
    • Pierre Tocquin's avatar
      feat(logging): integrate logging system into process pipeline · 3e4ee492
      Pierre Tocquin authored
      The `process_pipeline.py` script now includes a logging system configured to provide timestamps and log levels, replacing print statements for better visibility and traceability in processing steps. The function `configure_logging` has been added to set up logging based on the log level specified in the configuration file. This change enhances the ability to monitor and debug the automated processing of CZI images, with log levels adjustable via configuration to suit different verbosity needs.
      3e4ee492
    • Pierre Tocquin's avatar
      refactor(process_pipeline): comment out resource cleanup and logging · f4c3ada3
      Pierre Tocquin authored
      The deletion of masks, garbage collection, and logging has been commented out in the correct_segmentation_issues function. This change may have been made to debug or test other parts of the code without interference from these operations. Consider potential impacts on memory usage and performance, especially in large-scale processing tasks.
      f4c3ada3
    • Pierre Tocquin's avatar
      refactor(process): remove unused blue region filling code · d37154a0
      Pierre Tocquin authored
      The code segment responsible for filling interruptions in nerve segments (blue regions) has been commented out. This includes the creation of a mask, applying morphological operations, and updating pixel values. These changes suggest that the functionality was either obsolete or no longer needed, which can help in maintaining cleaner and more efficient code.
      d37154a0
    • Pierre Tocquin's avatar
      chore(logging): add debug prints to track segmentation process · d2752606
      Pierre Tocquin authored
      Added print statements throughout the `correct_segmentation_issues` function to provide detailed tracing of label evaluation, removal of small red clusters, filling interruptions in blue regions, and application of a blur filter. This aids in debugging by making it easier to follow the execution flow and understand which parts of the image processing pipeline are being executed.
      d2752606
  13. Dec 04, 2024
    • Pierre Tocquin's avatar
      feat(memory-management): add memory usage logging and resource cleanup · 11000cca
      Pierre Tocquin authored
      Introduce a utility function to log memory usage at various stages of processing, improving the ability to monitor and manage resource consumption. Add calls to garbage collection and log memory usage after critical operations in segmentation correction to optimize performance and prevent memory leaks.
      11000cca
    • Pierre Tocquin's avatar
      fix(pipeline): correct variable name for image deletion · 3dd4d970
      Pierre Tocquin authored
      The commit rectifies a bug in the `save_image` function where the incorrect variable `image` was used instead of `image_path` when deleting the original image, ensuring the removal operation targets the correct file. This prevents errors and ensures proper cleanup of files during the image processing workflow.
      3dd4d970
    • Pierre Tocquin's avatar
      refactor(pipeline): replace resizing with image-saving logic · dc782583
      Pierre Tocquin authored
      Removed the resizing step and its associated code comments for TIFF images in favor of a new `save_image` function that saves images with LZW compression. This change includes skipping the deletion of intermediate TIFF files, now calling `os.remove` only after saving. Additionally, added print statements in `correct_segmentation_issues` for better debugging and status updates.
      dc782583
    • Pierre Tocquin's avatar
      feat(image-processing): handle large image resizing with patch processing · ccbafc50
      Pierre Tocquin authored
      Modified the `resize_image` function to process images in smaller patches, preventing memory overflow when resizing large images. Added an optional `patch_size` parameter, defaulting to 1024, to specify the size of these patches. This approach allows for controlled memory usage and efficient resizing of very large images without sacrificing performance.
      ccbafc50
    • Pierre Tocquin's avatar
      feat(image-processing): switch from cv2 to tiff for image writing · 9b1c97ff
      Pierre Tocquin authored
      Changed the image saving functionality from using OpenCV's `cv2.imwrite` to TIFF's `tiff.imwrite` function without compression. This modification is aimed at enhancing compatibility with TIFF image format features. Ensure that the TIFF library is available in your environment to avoid runtime errors.
      9b1c97ff
    • Pierre Tocquin's avatar
      fix(pipeline): remove segmented TIFF file after processing · b23c29a3
      Pierre Tocquin authored
      The change ensures that the segmented TIFF file is deleted after processing, freeing up disk space and preventing potential storage issues. This aligns with the existing logic for removing other intermediate TIFF files.
      b23c29a3
  14. Dec 03, 2024
    • Pierre Tocquin's avatar
      feat(docs): add initial README for CZI to Ilastik processing pipeline · 2aa350f2
      Pierre Tocquin authored
      The newly added README provides a comprehensive overview of the automated pipeline for processing microscopy images from CZI format to TIFF, including segmentation using Ilastik. It details features, setup instructions, dependencies, usage guidelines, and troubleshooting tips, significantly improving documentation and aiding user understanding and implementation of the process.
      2aa350f2
    • Pierre Tocquin's avatar
      feat(process): enhance segmentation correction with additional parameters · bdf52039
      Pierre Tocquin authored
      Added new configuration options (`area_threshold`, `closing_kernel_size`, `aspect_ratio_min`, `aspect_ratio_max`) for improved segmentation correction in processing pipeline. These changes preserve true nodes of Ranvier by filtering based on cluster size and aspect ratio, and fill interruptions in nerve segments using morphological operations. Updated the function and documentation to reflect these enhancements. This improves accuracy and reliability of image segmentation results.
      bdf52039
  15. Dec 02, 2024
Loading