Releases: DataLab-Platform/Sigima
v1.0.5
Sigima Version 1.0.5 (2025-12-19)
ℹ️ This is a hotfix release addressing a packaging issue where French translations were missing from the previous release package. This release contains no functional changes compared to version 1.0.4 - it only ensures that the compiled translation files (.mo) are properly included in the distribution package.
🛠️ Bug fixes:
- Packaging: Fixed missing French translation files in release package
- Previous release packages were missing compiled .mo translation files, causing the application to display only English text regardless of locale settings
- Updated build process to ensure all translation files are properly included in distribution packages
- No functional code changes - this is purely a packaging fix to restore internationalization support
Sigima Version 1.0.4 (2025-12-18)
🛠️ Bug fixes:
-
Image processing: LUT range incorrectly copied to result: Fixed processed images showing incorrect contrast because LUT range was copied from original
- When processing an image (e.g., subtracting offset), the result image inherited the original's LUT range (
zscalemin/zscalemax), causing incorrect visualization when data values changed significantly - Example: After subtracting ~50 lsb background from an image with LUT 50-200, the result (data range ~-5 to ~175) was still displayed with the original 50-200 LUT, making parts of the image appear clipped or invisible
- Fixed by adding image-specific
dst_1_to_1,dst_2_to_1, anddst_n_to_1wrapper functions insigima.proc.image.basethat reset the LUT range after copying the source image - The
ImageObj.copy()method remains unchanged (a copy should faithfully copy all attributes) - the fix is applied at the processing layer where it belongs - Added regression test
test_image_offset_correction_lut_rangeinoffset_correction_unit_test.py - This closes Issue #9 - LUT range incorrectly copied when processing images
- When processing an image (e.g., subtracting offset), the result image inherited the original's LUT range (
-
Backwards-defined rectangular ROI causes NaN statistics: Fixed rectangular ROI coordinate normalization when defined in reverse direction
- When a rectangular ROI was drawn graphically "backwards" in DataLab (from bottom-right to top-left instead of top-left to bottom-right), statistics analysis returned NaN values
- The
RectangularROI.rect_to_coords()method was producing negative Δx and Δy values whenx1 < x0ory1 < y0 - Fixed by normalizing coordinates using min/max to ensure Δx and Δy are always positive
- ROI mask generation now works correctly regardless of the direction in which the rectangle was drawn
- Added regression test
test_backwards_drawn_rectangleinroi_coords_unit_test.py
-
Grid ROI - Missing spacing parameters for non-uniform grids: Fixed grid ROI extraction to support non-uniform feature spacing
- Grid ROI extraction previously assumed evenly distributed features (spacing = width/nx), which failed for images where features don't fill the entire grid area
- Example:
laser_spot_array_raw.pnghas laser spots spaced ~300 pixels apart, but the grid was defined over 3100×3100 pixels, causing incorrect ROI placement - Added
xstepandysteppercentage parameters (1-200%, default 100%) toROIGridParamto specify spacing between ROI centers - Updated
generate_image_grid_roi()function to use separate step calculation:dx_step = dx_cell * p.xstep / 100.0 - Position calculation now uses:
x0 = src.x0 + (ic + 0.5) * dx_step + xtrans - 0.5 * dx(preserving backward compatibility) - Default values (100%) maintain exact original behavior for existing workflows
- This allows precise ROI placement for gapped grids (e.g., laser spot arrays, sample arrays) by adjusting spacing independently of ROI size
-
Signal result title formatting: Fixed duplicate suffix in result titles for image-to-signal functions
- When computing radial profile or other operations using
new_signal_result, the suffix (e.g., center coordinates) was appearing twice in the title - Example:
radial_profile(i019)|center=(192.500, 192.500)|center=(192.500, 192.500)instead ofradial_profile(i019)|center=(192.500, 192.500) - The
new_signal_resultfunction insigima/proc/base.pywas adding the suffix twice: once via the formatter and once explicitly - Removed the redundant suffix addition - the formatter's
format_1_to_1_titlemethod already handles suffix formatting correctly - Affects functions like
radial_profile,histogram, and other image-to-signal conversions - This closes Issue #8 - Duplicate suffix in result title when using
new_signal_result
- When computing radial profile or other operations using
-
HDF5 serialization with detection ROIs: Fixed workspace save failure when images contain ROIs generated by blob detection
- Saving DataLab workspace to HDF5 format failed with
NotImplementedError: cannot serialize 'rectangle' of type <enum 'DetectionROIGeometry'> - The
store_roi_creation_metadata()function was storing theDetectionROIGeometryenum directly in geometry attributes - Fixed by storing the enum's string value instead of the enum object itself
- This allows proper HDF5 serialization while preserving the information needed for
apply_detection_rois()to recreate ROIs - This closes Issue #7 - HDF5 Serialization Fails for Detection ROI Geometry Enum
- Saving DataLab workspace to HDF5 format failed with
-
CSV numeric data import: Fixed numeric columns being incorrectly interpreted as datetime values (Issue #6)
- When importing CSV files with large numeric values (e.g., frequencies in Hz like
4.884e+06), the data was incorrectly converted to datetime timestamps - The
pd.to_datetime()function was interpreting numeric values as nanoseconds since Unix epoch, corrupting the original data - Added check to skip columns with numeric dtypes in datetime detection - real datetime columns are loaded as string (
object) dtype - Numeric data (frequencies, voltages, etc.) is now correctly preserved during CSV import
- When importing CSV files with large numeric values (e.g., frequencies in Hz like
📚 Documentation:
-
Parameter usage documentation: Improved documentation for parameters requiring signal/image context (Issue #5)
- Added comprehensive documentation explaining the
update_from_obj()pattern for parameters likeZeroPadding1DParam - Clarified that
sigima.paramsis the recommended import location for all parameter classes - Enhanced
ZeroPadding1DParamclass docstring with usage example and "Important" admonition - Added new section in
sigima.paramsmodule listing all parameters requiringupdate_from_obj() - Created new example
doc/examples/features/zero_padding.pydemonstrating proper parameter initialization
- Added comprehensive documentation explaining the
-
New ROI grid example: Added example demonstrating the grid ROI feature
- Introduced
laser_spot_array.pngtest image (6×6 laser spot array) to help debug an issue reported in DataLab - Created new example
doc/examples/features/roi_grid.pyshowcasing thegenerate_image_grid_roi()function - Example covers: loading images, extracting sub-regions, generating ROI grids, configuring size/translation/step parameters, understanding direction labels, and extracting individual spots
- Introduced
v1.0.4
Sigima Version 1.0.4 (2025-12-18)
🛠️ Bug fixes:
-
Image processing: LUT range incorrectly copied to result: Fixed processed images showing incorrect contrast because LUT range was copied from original
- When processing an image (e.g., subtracting offset), the result image inherited the original's LUT range (
zscalemin/zscalemax), causing incorrect visualization when data values changed significantly - Example: After subtracting ~50 lsb background from an image with LUT 50-200, the result (data range ~-5 to ~175) was still displayed with the original 50-200 LUT, making parts of the image appear clipped or invisible
- Fixed by adding image-specific
dst_1_to_1,dst_2_to_1, anddst_n_to_1wrapper functions insigima.proc.image.basethat reset the LUT range after copying the source image - The
ImageObj.copy()method remains unchanged (a copy should faithfully copy all attributes) - the fix is applied at the processing layer where it belongs - Added regression test
test_image_offset_correction_lut_rangeinoffset_correction_unit_test.py - This closes Issue #9 - LUT range incorrectly copied when processing images
- When processing an image (e.g., subtracting offset), the result image inherited the original's LUT range (
-
Backwards-defined rectangular ROI causes NaN statistics: Fixed rectangular ROI coordinate normalization when defined in reverse direction
- When a rectangular ROI was drawn graphically "backwards" in DataLab (from bottom-right to top-left instead of top-left to bottom-right), statistics analysis returned NaN values
- The
RectangularROI.rect_to_coords()method was producing negative Δx and Δy values whenx1 < x0ory1 < y0 - Fixed by normalizing coordinates using min/max to ensure Δx and Δy are always positive
- ROI mask generation now works correctly regardless of the direction in which the rectangle was drawn
- Added regression test
test_backwards_drawn_rectangleinroi_coords_unit_test.py
-
Grid ROI - Missing spacing parameters for non-uniform grids: Fixed grid ROI extraction to support non-uniform feature spacing
- Grid ROI extraction previously assumed evenly distributed features (spacing = width/nx), which failed for images where features don't fill the entire grid area
- Example:
laser_spot_array_raw.pnghas laser spots spaced ~300 pixels apart, but the grid was defined over 3100×3100 pixels, causing incorrect ROI placement - Added
xstepandysteppercentage parameters (1-200%, default 100%) toROIGridParamto specify spacing between ROI centers - Updated
generate_image_grid_roi()function to use separate step calculation:dx_step = dx_cell * p.xstep / 100.0 - Position calculation now uses:
x0 = src.x0 + (ic + 0.5) * dx_step + xtrans - 0.5 * dx(preserving backward compatibility) - Default values (100%) maintain exact original behavior for existing workflows
- This allows precise ROI placement for gapped grids (e.g., laser spot arrays, sample arrays) by adjusting spacing independently of ROI size
-
Signal result title formatting: Fixed duplicate suffix in result titles for image-to-signal functions
- When computing radial profile or other operations using
new_signal_result, the suffix (e.g., center coordinates) was appearing twice in the title - Example:
radial_profile(i019)|center=(192.500, 192.500)|center=(192.500, 192.500)instead ofradial_profile(i019)|center=(192.500, 192.500) - The
new_signal_resultfunction insigima/proc/base.pywas adding the suffix twice: once via the formatter and once explicitly - Removed the redundant suffix addition - the formatter's
format_1_to_1_titlemethod already handles suffix formatting correctly - Affects functions like
radial_profile,histogram, and other image-to-signal conversions - This closes Issue #8 - Duplicate suffix in result title when using
new_signal_result
- When computing radial profile or other operations using
-
HDF5 serialization with detection ROIs: Fixed workspace save failure when images contain ROIs generated by blob detection
- Saving DataLab workspace to HDF5 format failed with
NotImplementedError: cannot serialize 'rectangle' of type <enum 'DetectionROIGeometry'> - The
store_roi_creation_metadata()function was storing theDetectionROIGeometryenum directly in geometry attributes - Fixed by storing the enum's string value instead of the enum object itself
- This allows proper HDF5 serialization while preserving the information needed for
apply_detection_rois()to recreate ROIs - This closes Issue #7 - HDF5 Serialization Fails for Detection ROI Geometry Enum
- Saving DataLab workspace to HDF5 format failed with
-
CSV numeric data import: Fixed numeric columns being incorrectly interpreted as datetime values (Issue #6)
- When importing CSV files with large numeric values (e.g., frequencies in Hz like
4.884e+06), the data was incorrectly converted to datetime timestamps - The
pd.to_datetime()function was interpreting numeric values as nanoseconds since Unix epoch, corrupting the original data - Added check to skip columns with numeric dtypes in datetime detection - real datetime columns are loaded as string (
object) dtype - Numeric data (frequencies, voltages, etc.) is now correctly preserved during CSV import
- When importing CSV files with large numeric values (e.g., frequencies in Hz like
📚 Documentation:
-
Parameter usage documentation: Improved documentation for parameters requiring signal/image context (Issue #5)
- Added comprehensive documentation explaining the
update_from_obj()pattern for parameters likeZeroPadding1DParam - Clarified that
sigima.paramsis the recommended import location for all parameter classes - Enhanced
ZeroPadding1DParamclass docstring with usage example and "Important" admonition - Added new section in
sigima.paramsmodule listing all parameters requiringupdate_from_obj() - Created new example
doc/examples/features/zero_padding.pydemonstrating proper parameter initialization
- Added comprehensive documentation explaining the
-
New ROI grid example: Added example demonstrating the grid ROI feature
- Introduced
laser_spot_array.pngtest image (6×6 laser spot array) to help debug an issue reported in DataLab - Created new example
doc/examples/features/roi_grid.pyshowcasing thegenerate_image_grid_roi()function - Example covers: loading images, extracting sub-regions, generating ROI grids, configuring size/translation/step parameters, understanding direction labels, and extracting individual spots
- Introduced
v1.0.3
Version 1.0
Sigima Version 1.0.3 (2025-12-03)
🛠️ Bug fixes:
-
Signal data type validation: Fixed integer arrays not being automatically converted to float64
- Integer input arrays are now automatically converted to float64 instead of raising errors
- Validation applied consistently across all signal data setters:
set_xydata(),x,y,dx,dy - Improves usability by accepting integer inputs (common in test data and calibration values) while maintaining computational precision
- Raises clear
ValueErrorfor truly invalid dtypes with helpful error message listing valid types
-
Signal axis calibration: Added
replace_x_by_other_y()function to replace signal X coordinates with Y values from another signal- Addresses missing functionality for wavelength calibration and similar use cases where calibration data is stored in a separate signal's Y values
- This operation was previously impossible, even if the ambiguous X-Y mode feature existed and seemed related to this use case (but this feature performs resampling/interpolation, which is not desired here)
- The new function directly uses Y arrays from both signals without interpolation, requiring signals to have the same number of points
- Takes two signals: first provides Y data for output, second provides Y data to become X coordinates
- Automatically transfers metadata: X label/unit from second signal's Y label/unit, Y label/unit preserved from first signal
- Typical use case: spectroscopy wavelength calibration (combine absorption measurements with wavelength scale)
- This closes Issue #4 - Missing functionality: Replace X coordinates with Y values from another signal for calibration
-
Signal title formatting:
- Polynomial signal titles: Fixed polynomial signal title generation to display mathematical notation (e.g.,
1+2x-3x²+4x³) instead of verbose parameter listing (e.g.,polynomial(a0=1,a1=2,a2=-3,a3=4,a4=0,a5=0)) - The
PolyParam.generate_title()method now constructs proper mathematical expressions with correct sign handling, coefficient simplification (e.g.,xinstead of1x,-xinstead of-1x), and exponent notation using^symbol - Improves readability in DataLab GUI and signal listings by presenting polynomials in standard mathematical form
- Zero coefficients are automatically omitted from the expression (e.g.,
1+x+x³when a2=0) - Handles edge cases including all-zero polynomials (returns
"0"), single terms, and negative coefficients - This closes Issue #3 - Polynomial signal titles should use mathematical notation instead of parameter listing
- Polynomial signal titles: Fixed polynomial signal title generation to display mathematical notation (e.g.,
-
ROI data extraction:
- Fixed
ValueError: zero-size array to reduction operation minimum which has no identityerror when computing statistics on images with ROI extending beyond canvas boundaries - The
ImageObj.get_data()method now properly clips ROI bounding boxes to image boundaries - When a ROI is completely outside the image bounds, returns a fully masked 1x1 array (containing NaN) to avoid zero-size array errors in statistics computations
- Partial overlap ROIs are correctly handled by clipping coordinates to valid image ranges
- This fix ensures robust statistics computation regardless of ROI position relative to image boundaries
- This closes Issue #1 -
ValueErrorwhen computing statistics on ROI extending beyond image boundaries
- Fixed
Sigima Version 1.0.2 (2025-11-12)
✨ New features and enhancements:
-
New parametric image types: Added five new parametric image generation types for testing and calibration
- Checkerboard pattern: Alternating squares for camera calibration and spatial frequency analysis. Parameters include square size, offset, and min/max values
- Sinusoidal grating: Frequency response testing with configurable spatial frequencies (fx, fy), phase, amplitude, and DC offset
- Ring pattern: Concentric circular rings for radial analysis. Configurable period, width, center position, and amplitude range
- Siemens star: Resolution testing pattern with radial spokes. Parameters include number of spokes, inner/outer radius, center position, and value range
- 2D sinc function: PSF/diffraction modeling with cardinal sine function. Configurable amplitude, center, scale factor (sigma), and DC offset
-
GeometryResult.value property: New convenience property for easy script access to computed geometry values
- Supports POINT, MARKER, and SEGMENT shapes
- Returns
(x, y)tuple for POINT and MARKER shapes (both coordinates accessible) - Returns
floatlength for SEGMENT shapes (calculated viasegments_lengths()) - Return type annotation:
float | tuple[float, float] - Provides intuitive API: unpack coordinates with
x, y = result.valueor get length withlength = result.value - Comprehensive error handling for unsupported shapes and multi-row results
-
Signal analysis functions return GeometryResult: Changed
x_at_y()andy_at_x()to return geometry results for better visualizationx_at_y()now returnsGeometryResultwithMARKERkind (previously returnedTableResult)y_at_x()now returnsGeometryResultwithMARKERkind (previously returnedTableResult)- Both functions return coordinates as
[x, y]in N×2 array format for cross marker display - Enables proper marker visualization in DataLab GUI (displayed as cross markers on plots)
- Script-friendly API: use
.valueproperty to easily extract coordinates as(x, y)tuple - Example:
x, y = proxy.compute_x_at_y(params).valueprovides direct access to both coordinates - Breaking change: Scripts accessing results as tables need to update to use
.valueproperty or.coordsarray
🛠️ Bug fixes:
-
Detection functions:
-
Contour detection: Removed ROI creation support from
ContourShapeParamas it doesn't make sense for contour detection use cases. TheContourShapeParamclass no longer inherits fromDetectionROIParam, and thecontour_shape()function no longer callsstore_roi_creation_metadata(). ROI creation remains available for other detection methods (blob detection, 2D peak detection) where it is appropriate. -
ROI creation error handling: Enhanced error handling in
create_image_roi_around_points()function to provide clearer error messages:- Now raises
ValueErrorwhen calculated ROI size is too small (points too close together) - Improved error messages to help users understand the cause of failures
- Validates ROI geometry parameter more explicitly
- Better handling of edge cases in automatic ROI sizing
- Now raises
-
-
Public API:
- Made
BaseObj.roi_has_changedmethod private (by renaming toBaseObj.__roi_has_changed) to avoid accidental external usage. This would interfere with the internal mask refresh mechanism that relies on controlled access to this method. The method is not part of the public API and should not be called directly by applications.
- Made
Sigima Version 1.0.1 (2025-11-05)
✨ New features and enhancements:
-
Detection ROI creation: Generic mechanism for ROI creation across all detection functions
- New
DetectionROIParamparameter class providing standardized ROI creation fieldscreate_rois: Boolean flag to enable/disable ROI creation (default: False)roi_geometry: Enum selecting ROI shape (RECTANGLE or CIRCLE, default: RECTANGLE)
- New
DetectionROIGeometryenum insigima.enumswith RECTANGLE and CIRCLE options - All detection parameter classes now inherit from
DetectionROIParam:Peak2DDetectionParam: 2D peak detectionContourShapeParam: Contour shape fittingBlobDOGParam,BlobDOHParam,BlobLOGParam,BlobOpenCVParam: Blob detection methodsHoughCircleParam: Hough circle detection
- New
store_roi_creation_metadata()helper function:- Stores ROI creation intent in
GeometryResult.attrsdictionary - Called within computation functions to communicate ROI preferences
- Does not violate function purity (no object modification)
- Stores ROI creation intent in
- New
apply_detection_rois()helper function:- Creates ROIs on image objects based on
GeometryResult.attrsmetadata - Returns
Trueif ROIs were created,Falseotherwise - Handles both rectangle and circle geometries
- Automatically calculates optimal ROI size based on feature spacing
- Can be called by applications outside computation functions
- Creates ROIs on image objects based on
- Metadata-based architecture maintains separation of concerns:
- Computation functions remain pure (no side effects)
- Applications control when/how ROIs are created
- Works seamlessly with multiprocessing engines (e.g., DataLab processors)
- Comprehensive test coverage with
validate_detection_rois()helper in test suite
- New
-
Automatic
func_nameinjection for result objects- The
@computation_functiondecorator now automatically injects the function name intoTableResultandGeometryResultobjects - When a computation function returns a result object with
func_name=None, the decorator sets it to the function's name usingdataclasses.replace() - Ensures systematic assignment of
func_namefor proper result tracking and display - Implementation uses direct
isinstance()type checking forTableResultandGeometryResult - Applies to both main decorator wrapper (with DataSet parameters) and simple passthrough wrapper
- Eliminates need for manual
func_nameassignment in computation functions
- The
-
Image ROI creation utility: New
create_image_roi_around_points()function insigima.objects.image.roi- Creates rectangular or circular ROIs around a set of point coordinates
*...
- Creates rectangular or circular ROIs around a set of point coordinates
v1.0.2
sigima 1.0.2
💥 New features and enhancements:
-
New parametric image types: Added five new parametric image generation types for testing and calibration
- Checkerboard pattern: Alternating squares for camera calibration and spatial frequency analysis. Parameters include square size, offset, and min/max values
- Sinusoidal grating: Frequency response testing with configurable spatial frequencies (fx, fy), phase, amplitude, and DC offset
- Ring pattern: Concentric circular rings for radial analysis. Configurable period, width, center position, and amplitude range
- Siemens star: Resolution testing pattern with radial spokes. Parameters include number of spokes, inner/outer radius, center position, and value range
- 2D sinc function: PSF/diffraction modeling with cardinal sine function. Configurable amplitude, center, scale factor (sigma), and DC offset
-
GeometryResult.value property: New convenience property for easy script access to computed geometry values
- Supports POINT, MARKER, and SEGMENT shapes
- Returns
(x, y)tuple for POINT and MARKER shapes (both coordinates accessible) - Returns
floatlength for SEGMENT shapes (calculated viasegments_lengths()) - Return type annotation:
float | tuple[float, float] - Provides intuitive API: unpack coordinates with
x, y = result.valueor get length withlength = result.value - Comprehensive error handling for unsupported shapes and multi-row results
-
Signal analysis functions return GeometryResult: Changed
x_at_y()andy_at_x()to return geometry results for better visualizationx_at_y()now returnsGeometryResultwithMARKERkind (previously returnedTableResult)y_at_x()now returnsGeometryResultwithMARKERkind (previously returnedTableResult)- Both functions return coordinates as
[x, y]in N×2 array format for cross marker display - Enables proper marker visualization in DataLab GUI (displayed as cross markers on plots)
- Script-friendly API: use
.valueproperty to easily extract coordinates as(x, y)tuple - Example:
x, y = proxy.compute_x_at_y(params).valueprovides direct access to both coordinates - Breaking change: Scripts accessing results as tables need to update to use
.valueproperty or.coordsarray
🛠️ Bug fixes:
-
Detection functions:
-
Contour detection: Removed ROI creation support from
ContourShapeParamas it doesn't make sense for contour detection use cases. TheContourShapeParamclass no longer inherits fromDetectionROIParam, and thecontour_shape()function no longer callsstore_roi_creation_metadata(). ROI creation remains available for other detection methods (blob detection, 2D peak detection) where it is appropriate. -
ROI creation error handling: Enhanced error handling in
create_image_roi_around_points()function to provide clearer error messages:- Now raises
ValueErrorwhen calculated ROI size is too small (points too close together) - Improved error messages to help users understand the cause of failures
- Validates ROI geometry parameter more explicitly
- Better handling of edge cases in automatic ROI sizing
- Now raises
-
-
Public API:
- Made
BaseObj.roi_has_changedmethod private (by renaming toBaseObj.__roi_has_changed) to avoid accidental external usage. This would interfere with the internal mask refresh mechanism that relies on controlled access to this method. The method is not part of the public API and should not be called directly by applications.
- Made
sigima 1.0.1
💥 New features and enhancements:
-
Detection ROI creation: Generic mechanism for ROI creation across all detection functions
- New
DetectionROIParamparameter class providing standardized ROI creation fieldscreate_rois: Boolean flag to enable/disable ROI creation (default: False)roi_geometry: Enum selecting ROI shape (RECTANGLE or CIRCLE, default: RECTANGLE)
- New
DetectionROIGeometryenum insigima.enumswith RECTANGLE and CIRCLE options - All detection parameter classes now inherit from
DetectionROIParam:Peak2DDetectionParam: 2D peak detectionContourShapeParam: Contour shape fittingBlobDOGParam,BlobDOHParam,BlobLOGParam,BlobOpenCVParam: Blob detection methodsHoughCircleParam: Hough circle detection
- New
store_roi_creation_metadata()helper function:- Stores ROI creation intent in
GeometryResult.attrsdictionary - Called within computation functions to communicate ROI preferences
- Does not violate function purity (no object modification)
- Stores ROI creation intent in
- New
apply_detection_rois()helper function:- Creates ROIs on image objects based on
GeometryResult.attrsmetadata - Returns
Trueif ROIs were created,Falseotherwise - Handles both rectangle and circle geometries
- Automatically calculates optimal ROI size based on feature spacing
- Can be called by applications outside computation functions
- Creates ROIs on image objects based on
- Metadata-based architecture maintains separation of concerns:
- Computation functions remain pure (no side effects)
- Applications control when/how ROIs are created
- Works seamlessly with multiprocessing engines (e.g., DataLab processors)
- Comprehensive test coverage with
validate_detection_rois()helper in test suite
- New
-
Automatic
func_nameinjection for result objects- The
@computation_functiondecorator now automatically injects the function name intoTableResultandGeometryResultobjects - When a computation function returns a result object with
func_name=None, the decorator sets it to the function's name usingdataclasses.replace() - Ensures systematic assignment of
func_namefor proper result tracking and display - Implementation uses direct
isinstance()type checking forTableResultandGeometryResult - Applies to both main decorator wrapper (with DataSet parameters) and simple passthrough wrapper
- Eliminates need for manual
func_nameassignment in computation functions
- The
-
Image ROI creation utility: New
create_image_roi_around_points()function insigima.objects.image.roi- Creates rectangular or circular ROIs around a set of point coordinates
- Automatically calculates optimal ROI size based on minimum distance between points
- Handles boundary conditions to keep ROIs within valid image coordinates
- Supports both "rectangle" and "circle" geometry types
- Designed for creating ROIs around detected features (peaks, blobs, etc.)
- Centralizes ROI creation logic previously duplicated across applications
-
Annotations API: New public API for managing annotations on Signal and Image objects
- Added
get_annotations()method: Returns a list of annotations in versioned JSON format - Added
set_annotations(annotations)method: Sets annotations from a list (replaces existing annotations) - Added
add_annotation(annotation)method: Adds a single annotation to the object - Added
clear_annotations()method: Removes all annotations from the object - Added
has_annotations()method: Returns True if the object has any annotations - Annotations are stored in object metadata with versioning support (currently version "1.0")
- Each annotation is a dictionary with keys such as
type,item_class, anditem_json(for example) - Provides clean separation between generic annotation storage and visualization-specific details
- Enables applications to manage plot annotations (shapes, labels, etc.) independently of ROIs
- Fully compatible with DataLab's PlotPy adapter pattern for visualization
- Added
🛠️ Bug fixes:
-
2D peak detection: Fixed architectural violation in
peak_detection()computation function- Removed direct ROI creation from computation function (was modifying input objects)
- Computation functions decorated with
@computation_function()must be pure (no side effects) - Removed line 128:
obj.roi = create_image_roi(...)which violated this principle - ROI creation now handled by applications in their presentation layer
- DataLab uses new
create_image_roi_around_points()utility for this purpose - Maintains separation of concerns: Sigima computes results, applications create visual representations
- Fixes regression where ROIs were not appearing in DataLab's processor-based workflow
-
Parameter classes: Removed default titles from generic
OrdinateParamandAbscissaParamclasses- These parameter classes are reused across multiple computation functions (e.g.,
full_width_at_y,x_at_y) - Default titles like "Ordinate" created redundancy when displayed with function names in analysis results
- Titles are now empty by default, allowing applications to provide context-specific titles when needed
- Improves clarity when the same parameter class is used by different functions
- These parameter classes are reused across multiple computation functions (e.g.,
-
Result HTML representation: Improved color contrast for dark mode
- Changed result title color in
to_html()methods from standard blue (#0000FF) to a lighter shade (#5294e2) - Affects TableResult and GeometryResult HTML output
- Provides better visibility in dark mode while maintaining good appearance in light mode
- Improves readability when results are displayed in applications with dark themes
- Changed result title color in
-
Fixed pulse features extraction with ROI signals. When extracting pulse features from signals with ROIs, the start/end range parameters (which apply to the full signal) were being used on ROI-extracted data, causing incorrect results. Now
extract_pulse_features()detects when the parameter ranges are outside the ROI's x-range and automatically switches to auto-detection mode. Additionally,extract_pulse_features()insigima.tools.signal.pulsenow properly initializesNoneranges usingget_start_range()andget_end_range()with...
v1.0.1
Release notes
The sigima library is part of the DataLab open-source platform.
See DataLab roadmap page for future and past milestones.
sigima 1.0.1
💥 New features and enhancements:
-
Detection ROI creation: Generic mechanism for ROI creation across all detection functions
- New
DetectionROIParamparameter class providing standardized ROI creation fieldscreate_rois: Boolean flag to enable/disable ROI creation (default: False)roi_geometry: Enum selecting ROI shape (RECTANGLE or CIRCLE, default: RECTANGLE)
- New
DetectionROIGeometryenum insigima.enumswith RECTANGLE and CIRCLE options - All detection parameter classes now inherit from
DetectionROIParam:Peak2DDetectionParam: 2D peak detectionContourShapeParam: Contour shape fittingBlobDOGParam,BlobDOHParam,BlobLOGParam,BlobOpenCVParam: Blob detection methodsHoughCircleParam: Hough circle detection
- New
store_roi_creation_metadata()helper function:- Stores ROI creation intent in
GeometryResult.attrsdictionary - Called within computation functions to communicate ROI preferences
- Does not violate function purity (no object modification)
- Stores ROI creation intent in
- New
apply_detection_rois()helper function:- Creates ROIs on image objects based on
GeometryResult.attrsmetadata - Returns
Trueif ROIs were created,Falseotherwise - Handles both rectangle and circle geometries
- Automatically calculates optimal ROI size based on feature spacing
- Can be called by applications outside computation functions
- Creates ROIs on image objects based on
- Metadata-based architecture maintains separation of concerns:
- Computation functions remain pure (no side effects)
- Applications control when/how ROIs are created
- Works seamlessly with multiprocessing engines (e.g., DataLab processors)
- Comprehensive test coverage with
validate_detection_rois()helper in test suite
- New
-
Automatic
func_nameinjection for result objects- The
@computation_functiondecorator now automatically injects the function name intoTableResultandGeometryResultobjects - When a computation function returns a result object with
func_name=None, the decorator sets it to the function's name usingdataclasses.replace() - Ensures systematic assignment of
func_namefor proper result tracking and display - Implementation uses direct
isinstance()type checking forTableResultandGeometryResult - Applies to both main decorator wrapper (with DataSet parameters) and simple passthrough wrapper
- Eliminates need for manual
func_nameassignment in computation functions
- The
-
Image ROI creation utility: New
create_image_roi_around_points()function insigima.objects.image.roi- Creates rectangular or circular ROIs around a set of point coordinates
- Automatically calculates optimal ROI size based on minimum distance between points
- Handles boundary conditions to keep ROIs within valid image coordinates
- Supports both "rectangle" and "circle" geometry types
- Designed for creating ROIs around detected features (peaks, blobs, etc.)
- Centralizes ROI creation logic previously duplicated across applications
-
Annotations API: New public API for managing annotations on Signal and Image objects
- Added
get_annotations()method: Returns a list of annotations in versioned JSON format - Added
set_annotations(annotations)method: Sets annotations from a list (replaces existing annotations) - Added
add_annotation(annotation)method: Adds a single annotation to the object - Added
clear_annotations()method: Removes all annotations from the object - Added
has_annotations()method: Returns True if the object has any annotations - Annotations are stored in object metadata with versioning support (currently version "1.0")
- Each annotation is a dictionary with keys such as
type,item_class, anditem_json(for example) - Provides clean separation between generic annotation storage and visualization-specific details
- Enables applications to manage plot annotations (shapes, labels, etc.) independently of ROIs
- Fully compatible with DataLab's PlotPy adapter pattern for visualization
- Added
🛠️ Bug fixes:
-
2D peak detection: Fixed architectural violation in
peak_detection()computation function- Removed direct ROI creation from computation function (was modifying input objects)
- Computation functions decorated with
@computation_function()must be pure (no side effects) - Removed line 128:
obj.roi = create_image_roi(...)which violated this principle - ROI creation now handled by applications in their presentation layer
- DataLab uses new
create_image_roi_around_points()utility for this purpose - Maintains separation of concerns: Sigima computes results, applications create visual representations
- Fixes regression where ROIs were not appearing in DataLab's processor-based workflow
-
Parameter classes: Removed default titles from generic
OrdinateParamandAbscissaParamclasses- These parameter classes are reused across multiple computation functions (e.g.,
full_width_at_y,x_at_y) - Default titles like "Ordinate" created redundancy when displayed with function names in analysis results
- Titles are now empty by default, allowing applications to provide context-specific titles when needed
- Improves clarity when the same parameter class is used by different functions
- These parameter classes are reused across multiple computation functions (e.g.,
-
Result HTML representation: Improved color contrast for dark mode
- Changed result title color in
to_html()methods from standard blue (#0000FF) to a lighter shade (#5294e2) - Affects TableResult and GeometryResult HTML output
- Provides better visibility in dark mode while maintaining good appearance in light mode
- Improves readability when results are displayed in applications with dark themes
- Changed result title color in
-
Fixed pulse features extraction with ROI signals. When extracting pulse features from signals with ROIs, the start/end range parameters (which apply to the full signal) were being used on ROI-extracted data, causing incorrect results. Now
extract_pulse_features()detects when the parameter ranges are outside the ROI's x-range and automatically switches to auto-detection mode. Additionally,extract_pulse_features()insigima.tools.signal.pulsenow properly initializesNoneranges usingget_start_range()andget_end_range()with thefractionparameter. This ensures pulse features extracted from a signal with ROIs match the features extracted from individually extracted ROI signals. -
Fixed ROI extraction for signals: ROIs are no longer incorrectly copied to destination signals when extracting ROIs. When using
extract_roi()orextract_rois(), the extracted signals now have no ROI defined, which is the expected behavior since the extracted data already represents the ROI itself. This fixes the issue where extracted signals would inherit the source signal's ROI definitions. -
Fixed pulse features computation to be ROI-exclusive when ROIs are defined. Previously,
TableKind.PULSE_FEATURESincorrectly computed results for both the whole object and each ROI. This made no sense for pulse analysis, where defining ROIs indicates the presence of multiple pulses, making whole-object features irrelevant. NowPULSE_FEATUREScorrectly computes only on ROIs when they exist, otherwise on the whole object.TableKind.STATISTICSandTableKind.CUSTOMmaintain the expected behavior (whole object + ROIs). -
Fixed
ValueErrorinchoose_savgol_window_auto()when processing small data arrays (e.g., ROI segments). The function now properly constrains the Savitzky-Golay window length to be strictly less than the array size, as required by scipy'smode='interp'option. This fixes the issue when extracting pulse features from small ROI segments in signals. -
Modified
RadialProfileParamto allow initialization of the dataset even when the associated image object is not yet set (call toupdate_from_obj). This is useful when creating the parameter object before assigning the image, enabling more flexible workflows. -
Removed unused
signals_to_array()function fromsigima.proc.signal.arithmeticmodule. This function was not used anywhere in the codebase and has been replaced by direct NumPy array construction in__signals_y_to_array()and__signals_dy_to_array()functions, for internal use only. -
ROI coordinate setters: Fixed bugs in
set_physical_coords()andset_indices_coords()methods- Fixed
RectangularROI.set_physical_coords(): Now correctly stores coordinates in delta format[x0, y0, dx, dy]instead of corner format[x0, y0, x1, y1]whenindices=True - Fixed
BaseSingleROI.set_indices_coords(): Now correctly converts the inputcoordsparameter instead ofself.coordswhenindices=False - These methods were implemented for API completeness but were not used in the Sigima/DataLab codebase
- Added comprehensive unit tests covering all ROI types (rectangular, circular, polygonal) and edge cases
- Fixed
sigima 1.0.0
💥 New features and enhancements:
- Signals to image conversion: New feature to combine multiple signals into a 2D image
- New computation function
signals_to_image()insigima.proc.signal.arithmetic - Takes a list of signals and combines them into an image by stacking Y-arrays
- Two orientation modes:
- Rows: Each signal becomes a row in the image (default)
- Columns: Each signal becomes a column in the image
- Optional normalization:
- Supports multiple normalization methods (Z-score, Min-Max, Maximum)
- Normalizes each signal independently before stacking
- Useful for visualizing signals with different amplitude ranges
- Validates that...
- New computation function
v1.0.0 - First Public Release
The sigima library is part of the DataLab open-source platform.
See DataLab roadmap page for future and past milestones.
sigima 1.0.0
💥 New features and enhancements:
-
Signals to image conversion: New feature to combine multiple signals into a 2D image
- New computation function
signals_to_image()insigima.proc.signal.arithmetic - Takes a list of signals and combines them into an image by stacking Y-arrays
- Two orientation modes:
- Rows: Each signal becomes a row in the image (default)
- Columns: Each signal becomes a column in the image
- Optional normalization:
- Supports multiple normalization methods (Z-score, Min-Max, Maximum)
- Normalizes each signal independently before stacking
- Useful for visualizing signals with different amplitude ranges
- Validates that all signals have the same size before combining
- New parameter class
SignalsToImageParamwith orientation and normalization settings - New enum
SignalsToImageOrientationfor specifying row/column orientation - Comprehensive validation tests for all combinations of parameters
- Ideal for creating spectrograms, heatmaps, or waterfall displays from signal collections
- New computation function
-
Non-uniform coordinate support for images: Added comprehensive support for non-uniform pixel coordinates
ImageObjnow supports both uniform and non-uniform coordinate systems:- Uniform coordinates: defined by origin (
x0,y0) and pixel spacing (dx,dy) - Non-uniform coordinates: defined by coordinate arrays (
xcoords,ycoords)
- Uniform coordinates: defined by origin (
- New methods for coordinate manipulation:
set_coords(): Set non-uniform X and Y coordinate arraysis_uniform_coords: Property to check if coordinates are uniform
- New computation function
set_uniform_coords(): Convert non-uniform to uniform coordinates- Automatically extracts uniform spacing from non-uniform arrays
- Handles numerical precision issues from linspace-generated arrays
- Preserves image data while transforming coordinate system
- Enhanced
calibration()function with polynomial support:- Now supports polynomial calibration up to cubic order:
dst = a0 + a1*src + a2*src² + a3*src³ - Parameter class changed from
a, b(linear) toa0, a1, a2, a3(polynomial) - Works on X-axis, Y-axis (creating non-uniform coordinates), and Z-axis (data values)
- Linear calibration is a special case with
a2=0, a3=0 - Automatically handles conversion between uniform and non-uniform coordinate systems
- Now supports polynomial calibration up to cubic order:
- Enhanced I/O support:
- HDF5 format now serializes/deserializes non-uniform coordinates
- Coordinated text files support non-uniform coordinate arrays
- All geometric operations updated to handle both coordinate types:
- Coordinate transformations preserve or create appropriate coordinate system
- ROI operations work seamlessly with both uniform and non-uniform coordinates
-
DateTime support for signal data: Added comprehensive datetime handling for signal X-axis data
- Automatic detection and conversion of datetime columns when reading CSV files
- Detects datetime values in the first or second column (handling index columns)
- Validates datetime format and ensures reasonable date ranges (post-1900)
- Converts datetime strings to float timestamps for efficient computation
- Preserves datetime metadata for proper display and export
- New
SignalObjmethods for datetime manipulation:set_x_from_datetime(): Convert datetime objects/strings to signal X data with configurable time units (s, ms, μs, ns, min, h)get_x_as_datetime(): Retrieve X values as datetime objects for display or exportis_x_datetime(): Check if signal contains datetime data
- Enhanced CSV export to preserve datetime format when writing signals with datetime X-axis
- New constants module (
sigima.objects.signal.constants) defining datetime metadata keys and time unit conversion factors - Comprehensive unit tests covering datetime conversion, I/O roundtrip, and edge cases
- Example test data file with real-world temperature/humidity logger data (
datetime.txt)
- Automatic detection and conversion of datetime columns when reading CSV files
-
New client subpackage: Migrated DataLab client functionality to
sigima.client- Added
sigima.client.remote.SimpleRemoteProxyfor XML-RPC communication with DataLab - Added
sigima.client.base.SimpleBaseProxyas abstract base class for DataLab proxies - Included comprehensive unit tests and API documentation
- Maintains headless design principle (GUI components excluded)
- Enables remote control of DataLab application from Python scripts and Jupyter notebooks
- Client functionality is now directly accessible:
from sigima import SimpleRemoteProxy
- Added
-
New image ROI feature: Added inverse ROI functionality for image ROIs
- Added
insideparameter toBaseSingleImageROIbase class, inherited by all image ROI types (PolygonalROI,RectangularROI,CircularROI) - When
inside=True, ROI represents the region inside the shape (inverted behavior) - When
inside=False(default), ROI represents the region outside the shape (original behavior) - Fully integrated with serialization (
to_dict/from_dict) and parameter conversion (to_param/from_param) - Signal ROIs (
SegmentROI) are unaffected as the concept doesn't apply to 1D intervals - Optimal architecture with zero code duplication - all
insidefunctionality implemented once in the base class - Individual ROI classes no longer need custom constructors, inheriting directly from base class
- Added
-
New image operation:
- Convolution.
-
New image format support:
- Coordinated text image files: Added support for reading coordinated text files (
.txtextension), similar to the Matris image format.- Supports both real and complex-valued image data with optional error images.
- Automatically handles NaN values in the data.
- Reads metadata including units (X, Y, Z) and labels from file headers.
- Coordinated text image files: Added support for reading coordinated text files (
-
New image analysis features:
- Horizontal and vertical projections
- Compute the horizontal projection profile by summing values along the y-axis (
sigima.proc.image.measurement.horizontal_projection). - Compute the vertical projection profile by summing values along the x-axis (
sigima.proc.image.measurement.vertical_projection).
- Compute the horizontal projection profile by summing values along the y-axis (
- Horizontal and vertical projections
-
New curve fitting algorithms: Complete curve fitting framework with
sigima.tools.signal.fittingmodule:- Core fitting functions: Comprehensive set of curve fitting algorithms for scientific data analysis:
linear_fit: Linear regression fittingpolynomial_fit: Polynomial fitting with configurable degreegaussian_fit: Gaussian profile fitting for peak analysislorentzian_fit: Lorentzian profile fitting for spectroscopyvoigt_fit: Voigt profile fitting (convolution of Gaussian and Lorentzian profiles)exponential_fit: Single exponential fitting with overflow protectionpiecewiseexponential_fit: Piecewise exponential (raise-decay) fitting with advanced parameter estimationplanckian_fit: Planckian (blackbody radiation) fitting with correct physics implementationtwohalfgaussian_fit: Asymmetric peak fitting with separate left/right parametersmultilorentzian_fit: Multi-peak Lorentzian fitting for complex spectrasinusoidal_fit: Sinusoidal fitting with FFT-based frequency estimationcdf_fit: Cumulative Distribution Function fitting using error functionsigmoid_fit: Sigmoid (logistic) function fitting for S-shaped curves
- Advanced piecewise exponential (raise-decay) fitting: Enhanced algorithm with:
- Standard piecewise exponential model:
y = a_left*exp(b_left*x) + a_right*exp(b_right*x) + y0 - Multi-start optimization strategy for robust convergence to global minimum
- Support for both positive and negative exponential rates (growth and decay components)
- Comprehensive parameter bounds validation to prevent optimization errors
- Standard piecewise exponential model:
- Enhanced asymmetric peak fitting: Advanced
twohalfgaussian_fitwith:- Separate baseline offsets for left and right sides (
y0_left,y0_right) - Independent amplitude parameters (
amp_left,amp_right) for better asymmetric modeling - Robust baseline estimation using percentile-based methods
- Separate baseline offsets for left and right sides (
- Technical features: All fitting functions include:
- Automatic initial parameter estimation from data characteristics
- Proper bounds enforcement ensuring optimization stability
- Comprehensive error handling and parameter validation
- Consistent dataclass-based parameter structures
- Full test coverage with synthetic and experimental data validation
- Core fitting functions: Comprehensive set of curve fitting algorithms for scientific data analysis:
-
New common signal/image feature:
- Added
phase(argument) feature to extract the phase information from complex signals or images. - Added operation to create complex-valued signal/image from real and imaginary parts.
- Added operation to create complex-valued signal/image from magnitude and phase.
- Standard deviation of the selected signals or images (this complements the "Average" feature).
- Generate new signal or image: Poisson noise.
- Add noise to the selected signals or images.
- Gaussian, Poisson or uniform noise can be added.
- New utility functions to generate file basenames.
- Deconvolution in the frequency domain.
- Added
-
New ROI features:
- Improved single ROI title handling, using default title based on the index of the ROI when no title is provided.
- Added
combine_withmethod to ROI objects (SignalROIandImageROI) to return a new ROI that combines the current ROI with another one (union) and handling duplicate ROIs. - Image ROI transformations:
- Before this change, image...
v0.2.0 - Preliminary release
Bump version to 0.2.0 and update development status to Beta
v0.1.0 - Preliminary release
sigima 0.1.0
This first version of the library is the result of the externalization of the signal and image processing features from the DataLab main repository.