Version 1.0#
Sigima Version 1.0.6#
đ ď¸ Bug fixes:
Compatibility with scikit-image 0.26.0+: Fixed deprecation warnings and API compatibility issues
scikit-image 0.26.0 introduced breaking changes to
CircleModelandEllipseModelAPIs: old API usedmodel.estimate(contour)+model.params, new API usesmodel.from_estimate(contour)+ property-based access (model.center,model.radius,model.axis_lengths)Added version-aware compatibility layer in
sigima.tools.image.preprocessingwith new helper functionsfit_circle_model()andfit_ellipse_model()that handle both old and new APIsUpdated
get_contour_shapes()insigima.tools.image.detectionto use compatibility functionsUpdated
get_enclosing_circle()insigima.tools.image.geometryto use compatibility functionsUsed
packaging.version.Versionfor robust version checking instead of fragile string parsingEliminates deprecation warnings while maintaining backward compatibility with Python 3.9 and scikit-image < 0.26
This closes Issue #10 - Sigima is not compatible with NumPy 2.4.0 and scikit-image 0.26.0
Compatibility with NumPy 2.4.0: Fixed centroid computation failure with NumPy 2.4.0âs new einsum optimization
NumPy 2.4.0 introduced new einsum optimization used by
scikit-image.measure.centroid()that fails with certain ndarray typesFixed by explicitly converting image data to basic NumPy array before calling
measure.centroid()inget_centroid_auto()functionEnsures compatibility with NumPy 2.4.0+ and scikit-image 0.26.0+ without changing computational results
đŚ Dependencies:
Dependency version constraints: Added maximum version constraints to prevent future compatibility issues
Updated dependency specifications:
NumPy >= 1.22, < 2.5,SciPy >= 1.10.1, < 1.17,scikit-image >= 0.19.2, < 0.27,pandas >= 1.4, < 3.0,PyWavelets >= 1.2, < 2.0New CI job
build_latestruns scheduled tests against latest dependency versions to detect breaking changes earlyPrevents automatic breakage from major dependency updates while allowing controlled upgrades after validation
đ CI/CD improvements:
CI workflow enhancements: Added automated testing against latest dependency versions
New
build_latestjob in GitHub Actions runs on schedule (weekly) and manual dispatchExtracts dependency names from
pyproject.tomland installs latest available versionsProvides early warning system for upcoming dependency compatibility issues
Enhanced workflow dispatch with configurable job selection for flexible testing scenarios
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 significantlyExample: 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 imageThe
ImageObj.copy()method remains unchanged (a copy should faithfully copy all attributes) - the fix is applied at the processing layer where it belongsAdded regression test
test_image_offset_correction_lut_rangeinoffset_correction_unit_test.pyThis closes Issue #9 - LUT range incorrectly copied when processing images
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 < y0Fixed 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 placementAdded
xstepandysteppercentage parameters (1-200%, default 100%) toROIGridParamto specify spacing between ROI centersUpdated
generate_image_grid_roi()function to use separate step calculation:dx_step = dx_cell * p.xstep / 100.0Position 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 titleExample:
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 explicitlyRemoved the redundant suffix addition - the formatterâs
format_1_to_1_titlemethod already handles suffix formatting correctlyAffects functions like
radial_profile,histogram, and other image-to-signal conversionsThis closes Issue #8 - Duplicate suffix in result title when using
new_signal_result
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 attributesFixed 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 ROIsThis closes Issue #7 - HDF5 Serialization Fails for Detection ROI Geometry Enum
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 timestampsThe
pd.to_datetime()function was interpreting numeric values as nanoseconds since Unix epoch, corrupting the original dataAdded check to skip columns with numeric dtypes in datetime detection - real datetime columns are loaded as string (
object) dtypeNumeric data (frequencies, voltages, etc.) is now correctly preserved during CSV import
đ 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 likeZeroPadding1DParamClarified that
sigima.paramsis the recommended import location for all parameter classesEnhanced
ZeroPadding1DParamclass docstring with usage example and âImportantâ admonitionAdded new section in
sigima.paramsmodule listing all parameters requiringupdate_from_obj()Created new example
doc/examples/features/zero_padding.pydemonstrating proper parameter initialization
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 DataLabCreated new example
doc/examples/features/roi_grid.pyshowcasing thegenerate_image_grid_roi()functionExample covers: loading images, extracting sub-regions, generating ROI grids, configuring size/translation/step parameters, understanding direction labels, and extracting individual spots
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,dyImproves 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 signalAddresses 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^symbolImproves 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 coefficientsThis closes Issue #3 - Polynomial signal titles should use mathematical notation instead of parameter listing
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 boundariesThe
ImageObj.get_data()method now properly clips ROI bounding boxes to image boundariesWhen 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
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.valueComprehensive 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 displayEnables proper marker visualization in DataLab GUI (displayed as cross markers on plots)
Script-friendly API: use
.valueproperty to easily extract coordinates as(x, y)tupleExample:
x, y = proxy.compute_x_at_y(params).valueprovides direct access to both coordinatesBreaking 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
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.
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 optionsAll 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.attrsdictionaryCalled within computation functions to communicate ROI preferences
Does not violate function purity (no object modification)
New
apply_detection_rois()helper function:Creates ROIs on image objects based on
GeometryResult.attrsmetadataReturns
Trueif ROIs were created,FalseotherwiseHandles both rectangle and circle geometries
Automatically calculates optimal ROI size based on feature spacing
Can be called by applications outside computation functions
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
Automatic
func_nameinjection for result objectsThe
@computation_functiondecorator now automatically injects the function name intoTableResultandGeometryResultobjectsWhen 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 displayImplementation uses direct
isinstance()type checking forTableResultandGeometryResultApplies to both main decorator wrapper (with DataSet parameters) and simple passthrough wrapper
Eliminates need for manual
func_nameassignment in computation functions
Image ROI creation utility: New
create_image_roi_around_points()function insigima.objects.image.roiCreates 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 formatAdded
set_annotations(annotations)method: Sets annotations from a list (replaces existing annotations)Added
add_annotation(annotation)method: Adds a single annotation to the objectAdded
clear_annotations()method: Removes all annotations from the objectAdded
has_annotations()method: Returns True if the object has any annotationsAnnotations 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
đ ď¸ Bug fixes:
2D peak detection: Fixed architectural violation in
peak_detection()computation functionRemoved 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 principleROI creation now handled by applications in their presentation layer
DataLab uses new
create_image_roi_around_points()utility for this purposeMaintains 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
OrdinateParamandAbscissaParamclassesThese 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
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
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()methodsFixed
RectangularROI.set_physical_coords(): Now correctly stores coordinates in delta format[x0, y0, dx, dy]instead of corner format[x0, y0, x1, y1]whenindices=TrueFixed
BaseSingleROI.set_indices_coords(): Now correctly converts the inputcoordsparameter instead ofself.coordswhenindices=FalseThese 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
Sigima Version 1.0.0 (2025-10-28)#
⨠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.arithmeticTakes 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 settingsNew enum
SignalsToImageOrientationfor specifying row/column orientationComprehensive validation tests for all combinations of parameters
Ideal for creating spectrograms, heatmaps, or waterfall displays from signal collections
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)
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 coordinatesAutomatically 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=0Automatically handles conversion between uniform and non-uniform coordinate systems
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 factorsComprehensive unit tests covering datetime conversion, I/O roundtrip, and edge cases
Example test data file with real-world temperature/humidity logger data (
datetime.txt)
New client subpackage: Migrated DataLab client functionality to
sigima.clientAdded
sigima.client.remote.SimpleRemoteProxyfor XML-RPC communication with DataLabAdded
sigima.client.base.SimpleBaseProxyas abstract base class for DataLab proxiesIncluded 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
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 intervalsOptimal architecture with zero code duplication - all
insidefunctionality implemented once in the base classIndividual ROI classes no longer need custom constructors, inheriting directly from base class
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.
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).
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) + y0Multi-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
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 modelingRobust baseline estimation using percentile-based methods
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
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.
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 ROI were removed after applying each single computation function.
Now, the geometry computation functions preserve the ROI information across transformations: the transformed ROIs are automatically updated in the image object.
Image ROI coordinates:
Before this change, image ROI coordinates were defined using indices by default.
Now,
ROI2DParamuses physical coordinates by default.Note that ROI may still be defined using indices instead (using
create_image_roifunction).
Image ROI grid:
New
generate_image_grid_roifunction: create a grid of ROIs from an image, with customizable parameters for grid size, spacing, and naming.This function allows for easy extraction of multiple ROIs from an image in a structured manner.
Parameters are handled via the
ROIGridParamclass, which provides a convenient way to specify grid properties:nx/ny: Number of grid cells in the X/Y direction.xsize/ysize: Size of each grid cell in pixels.xtranslation/ytranslation: Translation of the grid in pixels.xdirection/ydirection: Direction of the grid (increasing/decreasing).
New image processing features:
New â2D resamplingâ feature:
This feature allows to resample 2D images to a new coordinate grid using interpolation.
It supports two resampling modes: pixel size and output shape.
Multiple interpolation methods are available: linear, cubic, and nearest neighbor.
The
fill_valueparameter controls how out-of-bounds pixels are handled, with support for numeric values or NaN.Automatic data type conversion ensures proper NaN handling for integer images.
It is implemented in the
sigima.proc.image.resamplingfunction with parameters defined inResampling2DParam.
New âFrequency domain Gaussian filterâ feature:
This feature allows to filter an image in the frequency domain using a Gaussian filter.
It is implemented in the
sigima.proc.image.frequency_domain_gaussian_filterfunction.
New âEraseâ feature:
This feature allows to erase an area of the image using the mean value of the image.
It is implemented in the
sigima.proc.image.erasefunction.The erased area is defined by a region of interest (ROI) parameter set.
Example usage:
import numpy as np import sigima.objects as sio import sigima.proc.image as sipi obj = sio.create_image("test_image", data=np.random.rand(1024, 1024)) p = sio.ROI2DParam.create(x0=600, y0=800, width=300, height=200) dst = sipi.erase(obj, p)
By default, pixel binning changes the pixel size.
Improved centroid estimation:
New
get_centroid_automethod implements an adaptive strategy that chooses between the Fourier-based centroid and a more robust fallback (scikit-image), based on agreement with a projected profile-based reference.Introduced
get_projected_profile_centroidfunction for robust estimation via 1D projections (median or barycentric), offering high accuracy even with truncated or noisy images.These changes improve centroid accuracy and stability in edge cases (e.g. truncated disks or off-center spots), while preserving noise robustness.
See DataLab issue #251 for more details.
New signal processing features:
New âBrick wall filterâ feature:
This feature allows to filter a signal in the frequency domain using an ideal (âbrick wallâ) filter.
It is implemented in
sigima.proc.signal.frequency_filter, along the other frequency domain filtering features (Bessel,Butterworth, etc.).
Enhanced zero padding to support prepend and append. Change default strategy to next power of 2.
Pulse analysis algorithms: Comprehensive pulse feature extraction framework in
sigima.tools.signal.pulsemodule:Core pulse analysis functions: Complete set of algorithms for step and square pulse characterization:
extract_pulse_features: Main function for automated pulse feature extractionheuristically_recognize_shape: Intelligent signal type detection (step, square, or other)detect_polarity: Robust polarity detection using baseline analysis
Advanced timing parameter extraction: Precise measurement algorithms for:
Rise and fall time calculations with configurable start/stop ratios (e.g., 10%-90%)
Timing parameters at specific fractions (x10, x50, x90, x100) of signal amplitude
Full width at half maximum (FWHM) computation for square pulses
Foot duration measurement for pulse characterization
Baseline analysis capabilities: Statistical methods for:
Automatic baseline range detection from signal extremes
Robust baseline level estimation using mean values within ranges
Start and end baseline characterization for differential analysis
Signal validation and error handling: Comprehensive input validation with:
Data array consistency checks and NaN/infinity detection
Signal length validation and range boundary verification
Graceful error handling with descriptive exception messages
PulseFeatures dataclass: Structured result container with all extracted parameters:
Amplitude, polarity, and offset measurements
Timing parameters (rise_time, fall_time, fwhm, x10, x50, x90, x100)
Baseline ranges (xstartmin, xstartmax, xendmin, xendmax)
Signal shape classification and foot duration
Implementation leverages robust statistical methods and provides both high-level convenience functions and low-level building blocks for custom pulse analysis workflows.
Comprehensive uncertainty propagation implementation:
Added mathematically correct uncertainty propagation to ~15 core signal processing functions.
Enhanced
Wrap1to1Funcclass to handle uncertainty propagation for mathematical functions (sqrt,log10,exp,clip,absolute,real,imag).Implemented uncertainty propagation for arithmetic operations (
product_constant,division_constant).Added uncertainty propagation for advanced processing functions (
power,normalize,derivative,integral,calibration).All implementations use proper error propagation formulas with numerical stability handling (NaN/infinity protection).
Optimized for memory efficiency by leveraging
dst_1_to_1automatic uncertainty copying and in-place modifications.Maintains backward compatibility with existing signal processing workflows.
New 2D ramp image generator:
This feature allows to generate a 2D ramp image: z = a(x â xâ) + b(y â yâ) + c
It is implemented in the
sigima.objects.Ramp2DParamparameter class.Example usage:
import sigima.objects as sio param = sio.Ramp2DParam.create(width=100, height=100, a=1.0, b=2.0) image = sio.create_image_from_param(param)
New signal generators: linear chirp, logistic function, Planck function.
New image âExtentâ computed parameters:
Added computed parameters for image extent:
xmin,xmax,ymin, andymax.These parameters are automatically calculated based on the image origin, pixel spacing, and dimensions.
They provide the physical coordinate boundaries of the image for enhanced spatial analysis.
New I/O features:
Added HDF5 format for signal and image objects (extensions
.h5sigand.h5ima) that may be opened with any HDF5 viewer.Added support for MCA (Multi-Channel Analyzer) spectrum file format:
Reading MCA files (
.mcaextension) commonly used in spectroscopy and radiation detectionAutomatically extracts spectrum data and calibration information
Supports energy calibration with interpolation for accurate X-axis values
Parses metadata from multiple sections (PMCA SPECTRUM, DPP STATUS, CALIBRATION)
Handles various encoding formats (UTF-8, Latin-1, CP1252) for maximum compatibility
Added support for FT-Lab signal and image format.
Added functions to read and write metadata and ROIs in JSON format:
sigima.io.read_metadataandsigima.io.write_metadatafor metadata.sigima.io.read_roiandsigima.io.write_roifor ROIs.
Added convenience I/O functions
write_signalsandwrite_imageswithSaveToDirectoryParamsupport:These functions enable batch saving of multiple signal or image objects to a directory with configurable naming patterns.
SaveToDirectoryParamprovides control over file basenames (with Python format string support), extensions, directory paths, and overwrite behavior.Automatic filename conflict resolution ensures unique filenames when duplicates would occur.
Enhanced workflow efficiency for processing and saving multiple objects in batch operations.
⨠Core architecture update: scalar result types
Introduced two new immutable result types:
TableResultandGeometryResult, replacing the legacyResultPropertiesandResultShapeobjects.These new result types are computation-oriented and free of application-specific logic (e.g., Qt, metadata), enabling better separation of concerns and future reuse.
Added a
TableResultBuilderutility to incrementally define tabular computations (e.g., statistics on signals or images) and generate aTableResultobject.All metadata-related behaviors of former result types have been migrated to the DataLab application layer.
Removed obsolete or tightly coupled features such as
from_metadata_entry()andtransform_shapes()from the Sigima core.
This refactoring greatly improves modularity, testability, and the clarity of the scalar computation API.
đ ď¸ Bug fixes:
Fix how data is managed in signal objects (
SignalObj):Signal data is stored internally as a 2D array with shape
(2, n), where the first row is the x data and the second row is the y data: that is thexydataattribute.Because of this, when storing complex Y data, the data type is propagated to the x data, which is not always desired.
As a workaround, the
xproperty now returns the real part of the x data.Furthermore, the
get_datamethod now returns a tuple of numpy arrays instead of a single array, allowing to access both x and y data separately, keeping the original data type.
Fix ROI conversion between physical and indices coordinates:
The conversion between physical coordinates and indices has been corrected (half pixel error was removed).
The
indices_to_physicalandphysical_to_indicesmethods now raise aValueErrorif the input does not contain an even number of elements (x, y pairs).
đ Security fixes:
Dependency vulnerability fix: Fixed CVE-2023-4863 vulnerability in opencv-python-headless
Updated minimum requirement from 4.5.4.60 to 4.8.1.78
Addresses libwebp binaries vulnerability in bundled OpenCV wheels
See DataLab security advisory for details