scikit-image 0.20.0 (2023-02-28)#
scikit-image is an image processing toolbox built on SciPy that includes algorithms for segmentation, geometric transformations, color space manipulation, analysis, filtering, morphology, feature detection, and more.
For more information, examples, and documentation, please visit our website: https://scikit-image.org
With this release, many of the functions in skimage.measure now support
anisotropic images with different voxel spacings.
Many performance improvements were made, such as support for footprint
decomposition in skimage.morphology
Four new gallery examples were added to the documentation, including the new interactive example “Track solidification of a metallic alloy”.
This release completes the transition to a more flexible
channel_axis parameter for indicating multi-channel images, and
includes several other deprecations that make the API more consistent and
expressive.
Finally, in preparation for the removal of distutils in the upcoming
Python 3.12 release, we replaced our build system with meson and a
static pyproject.toml specification.
This release supports Python 3.8–3.11.
New features and improvements#
- Support footprint decomposition to several footprint generating and consuming functions in - skimage.morphology. By decomposing a footprint into several smaller ones, morphological operations can potentially be sped up. The decomposed footprint can be generated with the new- decompositionparameter of the functions- rectangle,- diamond,- disk,- cube,- octahedron,- ball, and- octagonin- skimage.morphology. The- footprintparameter of the functions- binary_erosion,- binary_dilation,- binary_opening,- binary_closing,- erosion,- dilation,- opening,- closing,- white_tophat, and- black_tophatin- skimage.morphologynow accepts a sequence of 2-element tuples- (footprint_i, num_iter_i)where each entry,- i, of the sequence contains a footprint and the number of times it should be iteratively applied. This is the form produced by the footprint decompositions mentioned above (#5482, #6151).
- Support anisotropic images with different voxel spacings. Spacings can be defined with the new parameter - spacingof the following functions in- skimage.measure:- regionprops,- regionprops_table,- moments,- moments_central,- moments_normalized,- centroid,- inertia_tensor, and- inertia_tensor_eigvals. Voxel spacing is taken into account for the following existing properties in- skimage.measure.regionprops:- area,- area_bbox,- centroid,- area_convex,- extent,- feret_diameter_max,- area_filled,- inertia_tensor,- moments,- moments_central,- moments_hu,- moments_normalized,- perimeter,- perimeter_crofton,- solidity,- moments_weighted_central, and- moments_weighted_hu. The new properties- num_pixelsand- coords_scaledare available as well. See the respective docstrings for more details (#6296).
- Add isotropic binary morphological operators - isotropic_closing,- isotropic_dilation,- isotropic_erosion, and- isotropic_openingin- skimage.morphology. These functions return the same results as their non-isotropic counterparts but perform faster for large circular structuring elements (#6492).
- Add new colocalization metrics - pearson_corr_coeff,- manders_coloc_coeff,- manders_overlap_coeffand- intersection_coeffto- skimage.measure(#6189).
- Support the Modified Hausdorff Distance (MHD) metric in - skimage.metrics.hausdorff_distancevia the new parameter- method. The MHD can be more robust against outliers than the directed Hausdorff Distance (HD) (#5581).
- Add two datasets - skimage.data.protein_transportand- skimage.data.nickel_solidification(#6087).
- Add new parameter - use_gaussian_derivativesto- skimage.feature.hessian_matrixwhich allows the computation of the Hessian matrix by convolving with Gaussian derivatives (#6149).
- Add new parameters - squared_butterworthand- npadto- skimage.filters.butterworth, which support traditional or squared filtering and edge padding, respectively (#6251).
- Support construction of a - skimage.io.ImageCollectionfrom a- load_patternwith an arbitrary sequence as long as a matching- load_funcis provided (#6276).
- Add new parameter - alphato- skimage.metrics.adapted_rand_errorallowing control over the weight given to precision and recall (#6472).
- Add new parameter - binarizeto- skimage.measure.grid_points_in_polyto optionally return labels that tell whether a pixel is inside, outside, or on the border of the polygon (#6515).
- Add new parameter - include_bordersto- skimage.measure.convex_hull_imageto optionally exclude vertices or edges from the final hull mask (#6515).
- Add new parameter - offsetsto- skimage.measure.regionpropsthat optionally allows specifying the coordinates of the origin and affects the properties- coords_scaledand- coords(#3706).
- Add new parameter - disambiguateto- skimage.registration.phase_cross_correlationto optionally disambiguate periodic shifts (#6617).
- Support n-dimensional images in - skimage.filters.farid(Farid & Simoncelli filter) (#6257).
- Support n-dimensional images in - skimage.restoration.wiener(#6454).
- Support three dimensions for the properties - rotationand- translationin- skimage.transform.EuclideanTransformas well as for- skimage.transform.SimilarityTransform.scale(#6367).
- Allow footprints with non-adjacent pixels as neighbors in - skimage.morphology.flood_fill(#6236).
- Support array-likes consistently in - AffineTransform,- EssentialMatrixTransform,- EuclideanTransform,- FundamentalMatrixTransform,- GeometricTransform,- PiecewiseAffineTransform,- PolynomialTransform,- ProjectiveTransform,- SimilarityTransform,- estimate_transform, and- matrix_transformin- skimage.transform(#6270).
Performance#
- Improve performance (~2x speedup) of - skimage.feature.cannyby porting a part of its implementation to Cython (#6387).
- Improve performance (~2x speedup) of - skimage.feature.hessian_matrix_eigvalsand 2D- skimage.feature.structure_tensor_eigenvalues(#6441).
- Improve performance of - skimage.measure.moments_centralby avoiding redundant computations (#6188).
- Reduce import time of - skimage.ioby loading the matplotlib plugin only when required (#6550).
- Incorporate RANSAC improvements from scikit-learn into - skimage.measure.ransacwhich decrease the number of iterations (#6046).
- Improve histogram matching performance on unsigned integer data with - skimage.exposure.match_histograms. (#6209, #6354).
- Reduce memory consumption of the ridge filters - meijering,- sato,- frangi, and- hessianin- skimage.filters(#6509).
- Reduce memory consumption of - blob_dog,- blob_log, and- blob_dohin- skimage.feature(#6597).
- Use minimal required unsigned integer size internally in - skimage.morphology.reconstructionwhich allows to operate the function with higher precision or on larger arrays. Previously, int32 was used. (#6342).
- Use minimal required unsigned integer size in - skimage.filters.rank_orderwhich allows to operate the function with higher precision or on larger arrays. Previously, the returned- labelsand- original_valueswere always of type uint32. (#6342).
Changes and new deprecations#
- Set Python 3.8 as the minimal supported version (#6679). 
- Rewrite - skimage.filters.meijering,- skimage.filters.sato,- skimage.filters.frangi, and- skimage.filters.hessianto match the published algorithms more closely. This change is backward incompatible and will lead to different output values compared to the previous implementation. The Hessian matrix calculation is now done more accurately. The filters will now be correctly set to zero whenever one of the Hessian eigenvalues has a sign which is incompatible with a ridge of the desired polarity. The gamma constant of the Frangi filter is now set adaptively based on the maximum Hessian norm (#6446).
- Move functions in - skimage.future.graphto- skimage.graph. This affects- cut_threshold,- cut_normalized,- merge_hierarchical,- rag_mean_color,- RAG,- show_rag, and- rag_boundary(#6674).
- Return - Falsein- skimage.measure.LineModelND.estimateinstead of raising an error if the model is under-determined (#6453).
- Return - Falsein- skimage.measure.CircleModel.estimateinstead of warning if the model is under-determined (#6453).
- Rename - skimage.filters.inverseto- skimage.filters.inverse_filter.- skimage.filters.inverseis deprecated and will be removed in the next release (#6418, #6701).
- Update minimal supported dependencies to - numpy>=1.20(#6565).
- Update minimal supported dependencies to - scipy>=1.8(#6564).
- Update minimal supported dependencies to - networkx>=2.8(#6564).
- Update minimal supported dependency to - pillow>=9.0.1(#6402).
- Update minimal supported dependency to - setuptools 67(#6754).
- Update optional, minimal supported dependency to - matplotlib>=3.3(#6383).
- Warn for non-integer image inputs to - skimage.feature.local_binary_pattern. Applying the function to floating-point images may give unexpected results when small numerical differences between adjacent pixels are present (#6272).
- Warn if - skimage.registration.phase_cross_correlationreturns only the shift vector. Starting with the next release this function will always return a tuple of three (shift vector, error, phase difference). Use- return_error="always"to silence this warning and switch to this new behavior (#6543).
- Warn in - skimage.metrics.structural_similarity, if- data_rangeis not specified in case of floating point data (#6612).
- Automatic detection of the color channel is deprecated in - skimage.filters.gaussianand a warning is emitted if the parameter- channel_axisis not set explicitly (#6583).
Completed deprecations#
- Remove - skimage.viewerwhich was scheduled for removal in the postponed version 1.0 (#6160).
- Remove deprecated parameter - indicesfrom- skimage.feature.peak_local_max(#6161).
- Remove - skimage.feature.structure_tensor_eigvals(it was replaced by- skimage.feature.structure_tensor_eigenvalues) and change the default parameter value in- skimage.feature.structure_tensorto- order="rc"(#6162).
- Remove deprecated parameter - arrayin favor of- imagefrom- skimage.measure.find_contours(#6163).
- Remove deprecated Qt IO plugin and the - skiviconsole script (#6164).
- Remove deprecated parameter value - method='_lorensen'in- skimage.measure.marching_cubes(#6230).
- Remove deprecated parameter - multichannel; use- channel_axisinstead. This affects- skimage.draw.random_shapes,- skimage.exposure.match_histograms,- skimage.feature.multiscale_basic_features,- skimage.feature.hog,- skimage.feature.difference_of_gaussians,- skimage.filters.unsharp_mask, and- skimage.metrics.structural_similarity. In- skimage.restoration, this affects- cycle_spin,- denoise_bilateral,- denoise_tv_bregman,- denoise_tv_chambolle,- denoise_wavelet,- estimate_sigma,- inpaint_biharmonic, and- denoise_nl_means. In- skimage.segmentation, this affects- felzenszwalb,- random_walker, and- slic. In- skimage.transform, this affects- rescale,- warp_polar,- pyramid_reduce,- pyramid_expand,- pyramid_gaussian, and- pyramid_laplacian. In- skimage.util, this affects- montageand- apply_parallel(#6583).
- Remove deprecated parameter - selem; use- footprintinstead. In- skimage.filters, this affects- median,- autolevel_percentile,- gradient_percentile,- mean_percentile,- subtract_mean_percentile,- enhance_contrast_percentile,- percentile,- pop_percentile,- sum_percentile,- threshold_percentile,- mean_bilateral,- pop_bilateral,- sum_bilateral,- autolevel,- equalize,- gradient,- maximum,- mean,- geometric_mean,- subtract_mean,- median,- minimum,- modal,- enhance_contrast,- pop,- sum,- threshold,- noise_filter,- entropy,- otsu,- windowed_histogram, and- majority. In- skimage.morphology, this affects- flood_fill,- flood,- binary_erosion,- binary_dilation,- binary_opening,- binary_closing,- h_maxima,- h_minima,- local_maxima,- local_minima,- erosion,- dilation,- opening,- closing,- white_tophat,- black_tophat, and- reconstruction(#6583).
- Remove deprecated parameter - max_iterfrom- skimage.filters.threshold_minimum,- skimage.morphology.thin, and- skimage.segmentation.chan_vese; use- max_num_iterinstead (#6583).
- Remove deprecated parameter - max_iterationsfrom- skimage.segmentation.active_contour; use- max_num_iterinstead (#6583).
- Remove deprecated parameter - inputfrom- skimage.measure.label; use- label_imageinstead (#6583).
- Remove deprecated parameter - coordinatesfrom- skimage.measure.regionpropsand- skimage.segmentation.active_contour(#6583).
- Remove deprecated parameter - neighbourhoodfrom- skimage.measure.perimeter; use- neighborhoodinstead (#6583).
- Remove deprecated parameters - heightand- widthfrom- skimage.morphology.rectangle; use- ncolsand- nrowsinstead (#6583).
- Remove deprecated parameter - in_placefrom- skimage.morphology.remove_small_objects,- skimage.morphology.remove_small_holes, and- skimage.segmentation.clear_border; use- outinstead (#6583).
- Remove deprecated parameter - iterationsfrom- skimage.restoration.richardson_lucy,- skimage.segmentation.morphological_chan_vese, and- skimage.segmentation.morphological_geodesic_active_contour; use- num_iterinstead (#6583).
- Remove support for deprecated keys - "min_iter"and- "max_iter"in- skimage.restoration.unsupervised_wiener’s parameter- user_params; use- "min_num_iter"and- "max_num_iter"instead (#6583).
- Remove deprecated functions - greycomatrixand- greycopropsfrom- skimage.feature(#6583).
- Remove deprecated submodules - skimage.morphology.greyand- skimage.morphology.greyreconstruct; use- skimage.morphologyinstead (#6583).
- Remove deprecated submodule - skimage.morphology.selem; use- skimage.morphology.footprintsinstead (#6583).
- Remove deprecated - skimage.future.graph.ncut(it was replaced by- skimage.graph.cut_normalized) (#6685).
Bug fixes#
- Fix round-off error in - skimage.exposure.adjust_gamma(#6285).
- Round and convert output coordinates of - skimage.draw.rectangleto- inteven if the input coordinates use- float. This fix ensures that the output can be used for indexing similar to other draw functions (#6501).
- Avoid unexpected exclusion of peaks near the image border in - skimage.feature.peak_local_maxif the peak value is smaller 0 (#6502).
- Avoid anti-aliasing in - skimage.transform.resizeby default when using nearest neighbor interpolation (- order == 0) with an integer input data type (#6503).
- Use mask during rescaling in - skimage.segmentation.slic. Previously, the mask was ignored when rescaling the image to make choice of compactness insensitive to the image values. The new behavior makes it possible to mask values such as- numpy.nanor- numpy.infinity. Additionally, raise an error if the input- imagehas two dimensions and a- channel_axisis specified - indicating that the image is multi-channel (#6525).
- Fix unexpected error when passing a tuple to the parameter - exclude_borderin- skimage.feature.blog_dogand- skimage.feature.blob_log(#6533).
- Raise a specific error message in - skimage.segmentation.random_walkerif no seeds are provided as positive values in the parameter- labels(#6562).
- Raise a specific error message when accessing region properties from - skimage.measure.regionpropswhen the required- intensity_imageis unavailable (#6584).
- Avoid errors in - skimage.feature.ORB.detect_and_extractby breaking early if the octave image is too small (#6590).
- Fix - skimage.restoration.inpaint_biharmonicfor images with Fortran-ordered memory layout (#6263).
- Fix automatic detection of the color channel in - skimage.filters.gaussian(this behavior is deprecated, see new deprecations) (#6583).
- Fix stacklevel of warning in - skimage.color.lab2rgb(#6616).
- Fix the order of return values for - skimage.feature.hessian_matrixand raise an error if- order='xy'is requested for images with more than 2 dimensions (#6624).
- Fix misleading exception in functions in - skimage.filters.rankthat did not mention that 2D images are also supported (#6666).
- Fix in-place merging of wheights in - skimage.graph.RAG.merge_nodes(#6692).
- Fix growing memory error and silence compiler warning in internal - heappushfunction (#6727).
- Fix compiliation warning about struct initialization in - Cascade.detect_multi_scale(#6728).
Documentation#
New#
- Add gallery example “Decompose flat footprints (structuring elements)” (#6151). 
- Add gallery example “Butterworth Filters” and improve docstring of - skimage.filters.butterworth(#6251).
- Add gallery example “Render text onto an image” (#6431). 
- Add gallery example “Track solidification of a metallic alloy” (#6469). 
- Add gallery example “Colocalization metrics” (#6189). 
- Add support page ( - .github/SUPPORT.md) to help users from GitHub find appropriate support resources (#6171, #6575).
- Add - CITATION.bibto repository to help with citing scikit-image (#6195).
- Add usage instructions for new Meson-based build system with - dev.py(#6600).
Improved & updated#
- Improve gallery example “Measure perimeters with different estimators” (#6200, #6121). 
- Adapt gallery example “Build image pyramids” to more diversified shaped images and downsample factors (#6293). 
- Adapt gallery example “Explore 3D images (of cells)” with interactive slice explorer using plotly (#4953). 
- Clarify meaning of the - weightsterm and rewrite docstrings of- skimage.restoration.denoise_tv_bregmanand- skimage.restoration.denoise_tv_chambolle(#6544).
- Describe the behavior of - skimage.io.MultiImagemore precisely in its docstring (#6290, #6292).
- Clarify that the enabled - watershed_lineparameter will not catch borders between adjacent marker regions in- skimage.segmentation.watershed(#6280).
- Clarify that - skimage.morphology.skeletonizeaccepts an- imageof any input type (#6322).
- Use gridded thumbnails in our gallery to demonstrate the different images and datasets available in - skimage.data(#6298, #6300, #6301).
- Tweak - balancein the docstring example of- skimage.restoration.wienerfor a less blurry result (#6265).
- Document support for Path objects in - skimage.io.imreadand- skimage.io.imsave(#6361).
- Improve error message in - skimage.filters.threshold_multiotsuif the discretized image cannot be thresholded (#6375).
- Show original unlabeled image as well in the gallery example “Expand segmentation labels without overlap” (#6396). 
- Document refactoring of - grey*to- skimage.feature.graymatrixand- skimage.feature.graycopropsin the release 0.19 (#6420).
- Document inclusion criteria for new functionality in core developer guide (#6488). 
- Print the number of segments after applying the Watershed in the gallery example “Comparison of segmentation and superpixel algorithms” (#6535). 
- Expand reviewer guidelines in pull request template (#6208). 
- Provide pre-commit PR instructions in pull request template (#6578). 
- Warn about and explain the handling of floating-point data in the docstring of - skimage.metricts.structural_similarity(#6595).
- Fix intensity autoscaling in animated - imshowin gallery example “Measure fluorescence intensity at the nuclear envelope” (#6599).
- Clarify dependency on - scikit-image[data]and pooch in- INSTALL.rst(#6619).
- Don’t use confusing loop in installation instructions for conda (#6672). 
- Document value ranges of L*a*b* and L*Ch in - lab2xyz,- rgb2lab,- lab2lch, and- lch2labin- skimage.color(#6688, #6697, #6719).
- Use more consistent style in docstring of - skimage.feature.local_binary_pattern(#6736).
Fixes, spelling & minor tweaks#
- Remove deprecated reference and use - skimage.measure.marching_cubesin gallery example “Marching Cubes” (#6377).
- List only the two primary OS-independent methods of installing scikit-image (#6557, #6560). 
- Fix description of - connectivityparameter in the docstring of- skimage.morphology.flood(#6534).
- Fix formatting in the docstring of - skimage.metrics.hausdorff_distance(#6203).
- Fix typo in docstring of - skimage.measure.moments_hu(#6016).
- Fix formatting of mode parameter in - skimage.util.random_noise(#6532).
- Fix broken links in SKIP 3 (#6445). 
- Fix broken link in docstring of - skimage.filters.sobel(#6474).
- Change “neighbour” to EN-US spelling “neighbor” (#6204). 
- Add missing copyrights to LICENSE.txt and use formatting according to SPDX identifiers (#6419). 
- Include - skimage.morphology.footprint_from_sequencein the public API documentation (#6555).
- Correct note about return type in the docstring of - skimage.exposure.rescale_intensity(#6582).
- Stop using the - git://connection protocol and remove references to it (#6201, #6283).
- Update scikit-image’s mailing addresses to the new domain discuss.scientific-python.org (#6255). 
- Remove references to deprecated mailing list in - doc/source/user_guide/getting_help.rst(#6575).
- Use “center” in favor of “centre”, and “color” in favor of “colour” gallery examples (#6421, #6422). 
- Replace reference to - api_changes.rstwith- release_dev.rst(#6495).
- Clarify header pointing to notes for latest version released (#6508). 
- Add missing spaces to error message in - skimage.measure.regionprops(#6545).
- Apply codespell to fix common spelling mistakes (#6537). 
- Add missing space in math directive in normalized_mutual_information’s docstring (#6549). 
- Fix lengths of docstring heading underline in - skimage.morphology.isotropic_functions (#6628).
- Fix plot order due to duplicate examples with the file name - plot_thresholding.py(#6644).
- Get rid of numpy deprecation warning in gallery example - plot_equalize(#6650).
- Fix swapping of opening and closing in gallery example - plot_rank_filters(#6652).
- Get rid of numpy deprecation warning in gallery example - in plot_log_gamma.py(#6655).
- Remove warnings and unnecessary messages in gallery example “Tinting gray-scale images” (#6656). 
- Update the contribution guide to recommend creating the virtualenv outside the source tree (#6675). 
- Fix typo in docstring of - skimage.data.coffee(#6740).
- Add missing backtick in docstring of - skimage.graph.merge_nodes(#6741).
- Fix typo in - skimage.metrics.variation_of_information(#6768).
42 reviewers contributed to this release [alphabetical by first name or login]#
- Abhijeet Parida 
- Albert Y. Shih 
- Alex (sashashura) 
- Alexandre de Siqueira 
- Antony Lee 
- Ben Greiner 
- Carlo Dri 
- Chris Roat 
- Daniele Nicolodi 
- Daria 
- Dudu Lasry 
- Eli Schwartz 
- François Boulogne 
- Gregory Lee 
- Gus Becker 
- Jacob Rosenthal 
- James Gao 
- Jan-Hendrik Müller 
- Jarrod Millman 
- Juan DF 
- Juan Nunez-Iglesias 
- Lars Grüter 
- Malinda (maldil) 
- Marianne Corvellec 
- Mark Harfouche 
- Martijn Courteaux 
- Marvin Albert 
- Matthias Bussonnier 
- Oren Amsalem 
- Ralf Gommers 
- Riadh Fezzani 
- Robert Haase 
- Robin Thibaut 
- Sandeep N Menon 
- Sanghyeok Hyun 
- Sebastian Berg 
- Sebastian Wallkötter 
- Simon-Martin Schröder 
- Stefan van der Walt 
- Thanushi Peiris 
- Thomas Voigtmann 
- Tim-Oliver Buchholz 
