# Changelog

## [Unreleased] - 2024-12-02

### Enhanced
- **process**
  - **Enhancement:** Segmentation correction with additional parameters.
    - Added new configuration options: `area_threshold`, `closing_kernel_size`, `aspect_ratio_min`, and `aspect_ratio_max` for improved segmentation correction.
    - These changes help in preserving true nodes of Ranvier by filtering based on cluster size and aspect ratio.
    - Introduced morphological operations to fill interruptions in nerve segments.
    - Updated the function and documentation to reflect these enhancements.
    - Overall, this improves the accuracy and reliability of image segmentation results.

### Refactored
- **refactor(image-processing):** Replace cv2 with Tifffile for reading large images to prevent CV_IO_MAX_IMAGE_PIXELS exception with cv2.
  - Switched from using OpenCV (cv2) to Tifffile for reading images, specifically TIFF files, in the `resize_image` function.
  - This change was made due to Tifffile's superior capabilities in handling multi-dimensional image data compared to OpenCV.
  - Removed unnecessary resizing before Ilastik processing to streamline the workflow and avoid redundancy.
  - The update aims to improve workflow efficiency and maintain image quality handling in microscopy applications.
- **refactor(pipeline):** Using the filename without extension for generating TIFF files.
  - This change extracts the base name of the file without its extension when creating output TIFF files.
  - Previously, the full path with extension was used, which could lead to redundant extensions in output filenames.
  - This update ensures clearer and more concise naming conventions for generated files.

### Added
- **feat(image-processing):** Add script for batch processing and resizing images with Ilastik.
  - This new script automates the process of running Ilastik in headless mode for image segmentation while resizing input and output images.
  - Input images are resized using quality-preserving interpolation, whereas segmented outputs use nearest-neighbor interpolation to maintain segmentation integrity.
  - It is designed to handle large batches of images efficiently, supporting user-specified scale factors and ensuring ease of use with command-line arguments.
- **feat(pipeline):** Add script for automating CZI to TIFF processing and analysis.
  - Introduced `process_pipeline.py` to automate conversion of CZI images to TIFF.
  - Integrated analysis with Ilastik and resizing outputs based on YAML configuration.
  - Updated dependencies in `requirements.txt` to support new functionality.


## [Unreleased] - 2024-12-01

### Added
- Script for converting czi mosaic to tif
- Script for running Ilastik in headless mode