kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns

Overview

kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns. The library builds on the tools for multi-dimensional data analysis provided by the HyperSpy library.

Launch binder Gitter chat Documentation status Build status Coverage status PyPI version Downloads per month Zenodo DOI All Contributors

  • User guide and API reference: https://kikuchipy.org. The guide consists of Jupyter Notebooks with many links to detailed explanations of the input parameters and output of functions and class methods (the API reference). The notebooks can be inspected statically on the web page or via nbviewer, downloaded and run locally, or run interactively in the browser by clicking the Binder link above and navigating to the doc/user_guide directory. We hope you find them useful!
  • License: kikuchipy is released under the GPLv3+ license.
  • Cite: If you find this project useful, please cite the DOI above.
  • Changelog: The library is in an alpha stage, so there will be breaking changes with each release. Please see the changelog for all developments.

Contributors

Thanks goes to these wonderful people (emoji key):


Eric Prestat

💻 🚧

Håkon Wiik Ånes


Lars Lervik

🐛 💻 📖 💬 👀 ⚠️

Ole Natlandsmyr

💻 📖 💬 👀 ⚠️

Tina Bergh

💻 👀

This project follows the all-contributors specification. Contributions of any kind welcome! Please see our contributing guide for information on how best to contribute (or just explain what you want to do in an issue).

Comments
  • Lambert projection

    Lambert projection

    Description of the change

    Continuation of the Gnomonic and Spherical projections already implemented. Allows for the transformation of a vector from Cartesian coordiantes to the Lambert projection. Also allows for transformation both ways between Gnomonic and Lambert projections.

    Progress of the PR

    Minimal example of the bug fix or new feature

    >>> from kikuchipy.projections.lambert_projection import LambertProjection
    >>># From Cartesian to Lambert
    >>>my_cartesian_vector = np.array((1,1,1))
    >>>my_lambert_vector = LambertProjection.project(my_cartesian_vector)
    >>>
    >>># From Lambert to Cartesian
    >>>my_lambert_vector = np.array((1,1))
    >>>my_cartesian_vector = LambertProjection.iproject(my_lambert_vector)
    >>>
    >>># From Lambert to Gnomonic
    >>>my_lambert_vector = np.array((1,1))
    >>>my_gnomonic_vector = LambertProjection.lambert_to_gnomonic(my_lambert_vector)
    >>>
    >>># From Gnomonic to Lambert
    >>>my_gnomonic_vector = np.array((1,1))
    >>>my_lambert_vector = LambertProjection.gnomonic_to_lambert(my_gnomonic_vector)
    >>>
    
    

    For reviewers

    • [x] Check that the PR title is short, concise, and will make sense 1 year later.
    • [x] Check that new functions are imported in corresponding __init__.py.
    • [x] Check that new features, API changes, and deprecations are mentioned in the unreleased section in doc/changelog.rst.
    bug enhancement tests 
    opened by friedkitteh 18
  • Refinement Module

    Refinement Module

    Description of the change

    Methods to refine:

    1. orientations
    2. projection centers
    3. both simultaneously

    The initial orientations are stored in a CrystalMap, with the projection center estimates from an EBSDDetector. The refinement process is made into an optimization problem and uses the user-friendly and efficient numerical routines implemented in scipy.

    Progress of the PR

    Minimal example of the bug fix or new feature

    >>> import kikuchipy as kp
    >>> s = kp.data.nickel_ebsd_large(allow_download=True)
    >>> s.remove_static_background()
    >>> s.remove_dynamic_background()
    >>> mp = kp.data.nickel_ebsd_master_pattern_small(projection="lambert", energy=20)
    >>> r = sampling.get_sample_fundamental(
    ... resolution=4, space_group=mp.phase.space_group.number
    ... )
    >>> detector = kp.detectors.EBSDDetector(
    ... shape=s.axes_manager.signal_shape[::-1],
    ... pc=[0.421, 0.7794, 0.5049],
    ... sample_tilt=70,
    ... convention="tsl",
    ... )
    >>> sim = mp.get_patterns(
    ... rotations=r,
    ... detector=detector,
    ... energy=20,
    ... dtype_out=s.data.dtype,
    ... compute=True
    ... )
    >>> xmap = s.dictionary_indexing(sim, n_slices=10, keep_n=10)
    >>> refined_xmap = s.orientation_refinement(
    ... xmap=xmap, 
    ... master_pattern=mp, 
    ... detector=detector, 
    ... energy=20
    ... )
    

    For reviewers

    • [ ] The PR title is short, concise, and will make sense 1 year later.
    • [ ] New functions are imported in corresponding __init__.py.
    • [ ] New features, API changes, and deprecations are mentioned in the unreleased section in doc/changelog.rst.
    enhancement 
    opened by friedkitteh 16
  • Issue with pattern centre definition in detector class for Oxford/HKL data

    Issue with pattern centre definition in detector class for Oxford/HKL data

    Hi Håkon,

    There seems to have some issues with PC (pattern centre) definition in detector class for Oxford/HKL data. I was testing a dataset acquired from our Oxford Nordlys detector with 640x480 CCD, pixel size ~59.2um using binning 4.

    • The first issue I found is that the L value after PC conversion from Oxford to EMsoft is not consistent with the equations (3) in JPDeGraef19 doi:10.1007/s40192-019-00137-4.

    For example, if the detector is defined as below (PC values were get from one of the raw pattern tiffs' metadata):

    detector = kp.detectors.EBSDDetector(
        shape=s.axes_manager.signal_shape[::-1],
        pc=[ 0.48935617839432832, 0.61856923343313686, 0.49397253582464035],
        convention="oxford",
        px_size=236.8,  # microns
        binning=1,
        tilt=0,
        sample_tilt=70.004152426213111
    )
    detector.pc_emsoft()
    

    Outputs: array([[1.7030115e+00, 1.4228308e+01, 1.4036724e+04]], dtype=float32)

    The third value in the output 14036.724 is different from 18716.010 calculated using [#of pixel in X] * [pixel size] * [PCz]. In fact, I find the output value matches [#of pixel in Y] * [pixel size] * [PCz] perfectly. Is it possible that the #of pixel in X variable has been misused?

    • Secondly, I searched a few different versions of Oxford and EDAX manuals and can confirm that the two vendors are using exactly the same way in defining their pattern centres. Both are positioned with respect to the (0,0) being at the bottom left of the screen; and both are measure as a fraction of the EBSP width. Therefore, within the pattern, x ranges from 0 to 1, y from 0 to H/W (0.75 in our case). And in EMsoft, the PC for Oxford and EDAX should be calculated using exactly the same equations (2) in JPDeGraef19 with Xpc flipped. This calculation seems has already been applied in the latest EMsoft release, as the DI results using corrected PC calculations are extremely good. But I have not read anything about the corrections yet.

    • The third one is about the display of PC in Kikuchipy. I find if I define the detector using the code above and display one of the pattern detector.plot(pattern=s.inav[35, 35].data) Outputs before correction The position is different from the display in Oxford Aztec site6

    I guess this is also because the PCy is measured as a fraction of pattern width rather than height.

    After correction seems about the same after correction

    Please let me know your thoughts on these. Thank you.

    BR, ZX

    bug 
    opened by IMBalENce 13
  • Static pattern matching framework, orientation similarity map and crystal map merging

    Static pattern matching framework, orientation similarity map and crystal map merging

    Static pattern matching and Orientation Similarity Map

    Indexing against pre-computed dictionaries with simulated patterns from for example EMsoft's EMEBSD.f90 program or, hopefully soon, our own sampling from master patterns. Produce a CrystalMap for each dictionary with scores and simulated_indices as properties. A merged CrystalMap and orientation similarity maps as property osm if wanted.

    Depends on #233 and #231.

    Progress of the PR

    Minimal example of the bug fix or new feature

    >>> import numpy as np
    >>> from orix.crystal_map import CrystalMap
    >>> from orix.quaternion import Rotation
    >>> import kikuchipy as kp
    >>> from kikuchipy.indexing import orientation_similarity_map, merge_crystal_maps
    >>> data = np.random.random(10000)
    >>> s = kp.signals.EBSD(data.reshape((10,) * 4))
    >>> s_sim_fe = kp.signals.EBSD(data.reshape((100, 10, 10)))
    >>> s_sim_fe._xmap = CrystalMap(Rotation(np.zeros((100, 4))))  # Dummy
    >>> s_sim_fe._xmap.phases[0].name = "ferrite"
    >>> s_sim_au = kp.signals.EBSD(data.reshape((100, 10, 10)))
    >>> s_sim_au._xmap = CrystalMap(Rotation(np.zeros((100, 4))))
    >>> s_sim_au._xmap.phases[0].name = "austenite"
    >>> xmap_fe, xmap_au = s.match_patterns([s_sim_fe, s_sim_au])  # Keep 50 best
    [########################################] | 100% Completed |  0.1s  # Dask progressbar
    [########################################] | 100% Completed |  0.1s
    >>> xmap = merge_crystal_maps([xmap_fe, xmap_au], mean_n_best=3)
    >>> xmap.osm = orientation_similarity_map(xmap, n_best=20).flatten()
    
    Taking more control of the matching parameters
    
    >>> xmap_au2, xmap_fe2, xmap_merged = s.match_patterns(
        simulations=[s_sim_au, s_sim_fe],
        metric=kp.indexing.similarity_metrics.ndp,  # Normalized dot product
        keep_n=30,
        n_slices=10,
        return_merged_crystal_map=True,
        get_orientation_similarity_map=True
    )
    Matching austenite patterns: 100%|██████████| 10/10 [00:00<00:00, 65.39slice/s, mem=50.2%]  # tqdm progressbar
    Matching ferrite patterns: 100%|██████████| 10/10 [00:00<00:00, 65.83slice/s, mem=50.2%]
    

    Note that the progressbar shows the phase name and memory used.

    For reviewers

    • [x] Check that the PR title is short, concise, and will make sense 1 year later.
    • [x] Check that new functions are imported in corresponding __init__.py.
    • [x] Check that new features, API changes, and deprecations are mentioned in the unreleased section in doc/changelog.rst.
    enhancement 
    opened by onatlandsmyr 12
  • Make EBSD refinement less restrictive regarding CrystalMap

    Make EBSD refinement less restrictive regarding CrystalMap

    Hello Hakon,

    I could index my patterns with no issues, however an error is raised once I try to perform the refinement:

    ValueError: The crystal map shape (28028,) and step sizes [0, 0] aren't compatible with the signal navigation shape (28028,) and step sizes (1.0,) (see EBSD.axes_manager)

    This is how my patterns axes_maneger looks like:

    s.axes_manager
    
    <Axes manager, axes: (28028|155, 128)>
                Name |   size |  index |  offset |   scale |  units 
    ================ | ====== | ====== | ======= | ======= | ====== 
         <undefined> |  28028 |      0 |       0 |       1 | <undefined> 
    ---------------- | ------ | ------ | ------- | ------- | ------ 
         <undefined> |    155 |        |       0 |       1 | <undefined> 
         <undefined> |    128 |        |       0 |       1 | <undefined>
    

    Originally posted by @tmostormujof in https://github.com/pyxem/kikuchipy/issues/525#issuecomment-1133965090

    @tmostormujof, thank you for raising the issue. The error message is raised here:

    https://github.com/pyxem/kikuchipy/blob/87816c8ed8ad8027903511c347b6fa89cbdf85ca/kikuchipy/signals/util/_crystal_map.py#L47-L55

    when either (1) the EBSD navigation shape and CrystalMap shape aren't equivalent or (2) their step sizes aren't the same.

    Regarding a (short term) solution for you: I'm a bit surprised that the CrystalMap step sizes are read as [0, 0], since I would think that the crystal map only had one navigation dimension (28028,) with a step size of 1 by default. What is your crystal map shape? It is not advisable to access or set private properties, but in this case I think it is the simplest solution. Could you try to update the spatial coordinate array of the crystal map xmap returned dictionary indexing by:

    >>> from orix.crystal_map import create_coordinate_arrays
    >>> xmap._x = create_coordinate_arrays(shape=(28028,), step_sizes=(1,))
    # Continue with refinement
    

    Regarding a long term solution: I believe this error is fairly common, and refinement does not use spatial correlation between patterns, so the step size is not critical. I suggest to drop the requirement that the step sizes are equivalent.

    bug enhancement 
    opened by hakonanes 10
  • What's left before a minor release v0.3 late 2020

    What's left before a minor release v0.3 late 2020

    List of issues and PRs that I think should be concluded before we release v0.3:

    • [x] Before all else: #248
    • [x] pattern matching
      • [x] #233
      • [x] #234
    • [x] #239 Sampling of master patterns
    • [x] Add xmap to EBSD signal with crystal orientations as returned by orix after EBSDMasterPattern.get_patterns()
    • [x] #246 Remove setting of master pattern metadata parameters, replace by EBSDMasterPattern class properties
    • ~improve and streamline use of the EBSD.xmap attribute~ This takes a lot of work, see #227, will leave for v0.4 and later.
    • ~improve and streamline use of the EBSD.detector attribute~ This is more work than anticipated, see #277, will leave for v0.4 or v0.3.1.
    • [x] notebook examples included in documentation with nbsphinx (should preferably replace user guide)
      • [x] #237 io
      • [x] #236 pattern processing
      • [x] #244 feature maps
      • [x] #279 virtual backscatter electron imaging
      • [x] #281 geometrical EBSD simulations (+ visualization)
      • [x] #263 master pattern sampling (very simple, not in detail, we need a more thorough notebook later)
      • [x] #263 pattern matching (very simple, not in detail, we need a more thorough notebook later)
      • [x] #247 change scan/pattern size (slicing with inav/isig)
      • [x] #243 visualizing patterns
      • [x] #238 sphinx-gallery from notebooks
    • [x] Fix #230
    • [x] Merge #280
    • [x] Release candidate
    • [x] Release

    I hope we can get this ready for ~late November~ early January.

    @friedkitteh and @onatlandsmyr, please add or change any tasks if necessary.

    maintenance 
    opened by hakonanes 10
  • Some tests accessing matplotlib.axes.Axes.artists fail with Matplotlib 3.5.0b1

    Some tests accessing matplotlib.axes.Axes.artists fail with Matplotlib 3.5.0b1

    Specific tests: https://github.com/hyperspy/hyperspy-extensions-list/runs/3551171059?check_suite_focus=true#step:13:1

    ~Don't know why, but~ this should be fixed. Using matplotlib 3.5 shouldn't break any functionality, just tests.

    Solution: In the tests, we should access the patches (artists) from Axes.patches, since that's what they are. And add them to the axes via Axes.add_patch() instead of Axes.add_artist().

    tests 
    opened by hakonanes 9
  • EBSD signal axes not set correctly in the Bruker h5ebsd reader

    EBSD signal axes not set correctly in the Bruker h5ebsd reader

    Issue reported by @Fred-Ad in #329 (I edited the post to just the relevant parts):

    Hi Hakon, I can load the dataset and produce the s.plot_virtual_bse_intensity(roi) That's a good point, thanks ! However, there is an error when trying vbse_rgb_img = vbse_gen.get_rgb_image(r=red, g=green, b=blue) this gives me this error :

    ---------------------------------------------------------------------------
    IndexError                                Traceback (most recent call last)
    <ipython-input-18-7637d6229fcb> in <module>
    ----> 1 vbse_rgb_img = vbse_gen.get_rgb_image(r=red, g=green, b=blue)
    
    D:\Python\WPy64-3880\python-3.8.8.amd64\lib\site-packages\kikuchipy\generators\virtual_bse_generator.py in get_rgb_image(self, r, g, b, percentiles, normalize, alpha, dtype_out, **kwargs)
        149             for roi in rois:
        150                 if isinstance(roi, tuple):
    --> 151                     roi = self.roi_from_grid(roi)
        152                 roi_image = self.signal.get_virtual_bse_intensity(roi).data
        153                 if isinstance(roi_image, Array):
    
    D:\Python\WPy64-3880\python-3.8.8.amd64\lib\site-packages\kikuchipy\generators\virtual_bse_generator.py in roi_from_grid(self, index)
        251         min_col = cols[min(index[:, 1])]
        252         max_col = cols[max(index[:, 1])] + cols[1]
    --> 253         min_row = rows[min(index[:, 0])]
        254         max_row = rows[max(index[:, 0])] + rows[1]
        255 
    
    IndexError: index 7 is out of bounds for axis 0 with size 6
    

    Perhaps it si due to the count of columns and row, as

    vbse_gen.grid_shape = (10, 10)
    red = [(7, 1), (8, 1), (8, 2), (9, 1), (9, 2)]
    green = [(8, 4), (8, 5), (9, 4), (9, 5)]
    blue = [(7, 8), (8, 7), (8, 8), (9, 7), (9, 8)]
    p = vbse_gen.plot_grid(
        rgb_channels=[red, green, blue],
        visible_indices=True,  # Default
        pattern_idx=(0, 0),  # Default is (0, 0)
    )
    p
    

    gives the following image, with a problem with the squares coordinates. I tried with the Ni datadat, no problem. So it is only due to the hdf5 Bruker file.

    Figure_epTest-coeur_Scan_1_Signal

    Sorry to bother you. Hope this is not a big deal.

    Regards Fred

    Originally posted by @Fred-Ad in https://github.com/pyxem/kikuchipy/discussions/329#discussioncomment-646209

    bug 
    opened by hakonanes 9
  • Average dot product, neighbour dot product matrices, map helper, rework averaging

    Average dot product, neighbour dot product matrices, map helper, rework averaging

    Description of the change

    • Average dot product (ADP) map
    • Neighbour dot product matrices
    • _map_helper: convenient function to create various maps used for both of the above
    • Started internal rework of average neighbours

    Progress of the PR

    Minimal example of the bug fix or new feature

    >>> import kikuchipy as kp
    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> s = kp.signals.EBSD(np.zeros((10, 10, 10, 10)))
    >>> adp = s.get_average_dot_product()
    >>> plt.imshow(adp, cmap="inferno")
    >>> plt.colorbar(label="ADP")
    ...
    >>> window = kp.filters.Window(window="rectangular", shape=(5, 5))
    >>> dp_matrices = s.get_neighbour_dot_product_matrices(window=window)
    

    For reviewers

    • [x] Check that the PR title is short, concise, and will make sense 1 year later.
    • [x] Check that new functions are imported in corresponding __init__.py.
    • [x] Check that new features, API changes, and deprecations are mentioned in the unreleased section in doc/changelog.rst.
    enhancement 
    opened by onatlandsmyr 9
  • Pattern Matching: Compare experimental with simulated data

    Pattern Matching: Compare experimental with simulated data

    Matching diffraction patterns

    Compare experimental and simulated patterns and return keep_n sorted match results. The match result consists of simulation indices and metric results having the shape; (nx*ny, keep_n).

    The functions use dask functionality but accept both dask and numpy arrays as inputs. It is possible to divide the computation by slicing up simulations regardless of inputs being dask or numpy arrays. This is achieved by passing n_slices as keyword to pattern_match.

    Mainly to be used by StaticDictionaryIndexing and DynamicDictionaryIndexing and not directly by the user.

    This PR depends on #231 .

    Progress of the PR

    Minimal example of the bug fix or new feature

    >>> import kikuchipy as kp
    >>> import numpy as np
    >>> from kikuchipy.indexing import pattern_match
    >>> s = kp.signals.EBSD(np.zeros((10, 10, 10, 10)))
    >>> s = kp.signals.EBSD(np.zeros((10, 10, 10, 10)))
    >>> simulated = np.zeros((1000, 10, 10))
    >>> simulation_indices, metric_results = pattern_match(s.data, simulated, keep_n=30, metric="zncc")
    >>> s_best_match = kp.signals.EBSD(simulated[simulation_indices[:, 0]].reshape(10,10))
    

    For reviewers

    • [x] Check that the PR title is short, concise, and will make sense 1 year later.
    • [x] Check that new functions are imported in corresponding __init__.py.
    • [x] Check that new features, API changes, and deprecations are mentioned in the unreleased section in doc/changelog.rst.
    enhancement 
    opened by onatlandsmyr 9
  • Fix data save issue for non-square patterns

    Fix data save issue for non-square patterns

    This is quick patch for fixing data save issue mentioned in #485

    Tested on h5ebsd file saved from Oxford .ebsp data file. The saved pattern dimensions are consistent with original patterns.

    bug tests 
    opened by IMBalENce 8
  • Errors when plotting interactively in notebooks via nbsphinx with PyVista/pythreejs

    Errors when plotting interactively in notebooks via nbsphinx with PyVista/pythreejs

    Interactive plots of EBSD master patterns and Kikuchi simulators using PyVista and pythreejs errors and warns both locally in Jupyterlab and using nbsphinx on Readthedocs (https://readthedocs.org/projects/kikuchipy/builds/18870880/).

    After disabling lighting (initial cause of errors, see identical errors reported in https://github.com/jupyter-widgets/pythreejs/issues/388), many warnings WARNING:traitlets:No handler found for comm target 'comm' are still emitted. I don't know where these come from. The plots display as expected locally when run manually, but nbsphinx is not able to run the notebook correctly (produces error reported in https://github.com/spatialaudio/nbsphinx/issues/549). This is the case both locally and on Readthedocs' servers.

    Switching PyVista/Jupyter backend to panel (https://docs.pyvista.org/user-guide/jupyter/index.html#demo-using-panel) solves this issue. Will try out new backend reported in https://github.com/pyvista/pyvista/issues/3690 once it's available.

    bug documentation 
    opened by hakonanes 0
  • Consider excluding docs and tests from package distribution

    Consider excluding docs and tests from package distribution

    Currently, we're including the tests and docs in the source and built distributions on PyPI. I'm about to add a 4 MB tutorial in a notebook with cell outputs stored, which will increase the distribution size quite a lot. We should consider excluding the docs and tests from the package distribution.

    maintenance 
    opened by hakonanes 0
  • Add dependency file for Binder to use, including optional dependencies

    Add dependency file for Binder to use, including optional dependencies

    We should add a file for Binder to use when setting up the environment, like is done in orix: https://github.com/pyxem/orix/blob/develop/environment.yml.

    help wanted documentation 
    opened by hakonanes 1
  • Projection of EMsoft master patterns from stereographic to Lambert projection struggles with equator

    Projection of EMsoft master patterns from stereographic to Lambert projection struggles with equator

    The projection of an EMsoft master pattern in the stereographic projection to the Lambert projection gives incorrect intensities from vectors on the equator. The below image table shows Lambert projection generated with kikuchipy from an EMsoft master pattern in the stereographic projection in the first column, and a Lambert master pattern created directly in EMsoft (not going from the stereographic projection) in the second column. The second row shows the upper left corner from both master patterns.

    | kikuchipy | EMsoft | | ------------ | ---------- | | lambert_kp | lambert_emsoft | | lambert_kp_edge | lambert_emsoft_edge |

    The blacke edge pixels produced with kikuchipy is a result of the EMsoft master pattern having 0-intensities outside the equator, which are included in most of the edge pixels in the bi-quadratic interpolation of vector intensities on the equator. I don't know to solve this.

    bug help wanted 
    opened by hakonanes 0
  • Support interpolating master pattern for dictionary indexing from several energies

    Support interpolating master pattern for dictionary indexing from several energies

    EMsoft uses an interpolated master pattern for dictionary indexing. The interpolation weights are determined from Monte Carlo simulations. These weights are included in the HDF5 file, which we can read. We should support generating an interpolated master pattern from multiple energies, as is done in EMsoft.

    enhancement 
    opened by hakonanes 0
  • Optimize adaptive histogram equalization

    Optimize adaptive histogram equalization

    The implementation of adaptive histogram equalization (calling scikit-image's equalize_adapthist()) should be optimized.

    Potential optimizations include:

    • Use HyperSpy's improved map() function (seems like this function handles chunks better than the current use of Dask's map_blocks() in kikuchipy)
    • Use the more restricted (and thus faster) private function for rescaling intensities after equalization (https://github.com/pyxem/kikuchipy/blob/develop/kikuchipy/pattern/_pattern.py#L88)
    • Use scikit-image's private function _clahe() directly instead of via the public API (dangerous since the function can change whenever)
    • Use another implementation? See https://stackoverflow.com/questions/43569566/adaptive-histogram-equalization-in-python, https://gist.github.com/sadimanna/52c320ce5c49e200ce398f800d39a2c1.

    The implementation is spread across two files:

    https://github.com/pyxem/kikuchipy/blob/c5df967f13e8058e05d8b5e5dd97594a889cf3ca/kikuchipy/signals/ebsd.py#L800-L888

    which calls

    https://github.com/pyxem/kikuchipy/blob/c5df967f13e8058e05d8b5e5dd97594a889cf3ca/kikuchipy/pattern/chunk.py#L364-L411

    enhancement 
    opened by hakonanes 1
Releases(v0.7.0)
  • v0.7.0(Oct 29, 2022)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    This release adds readers for EBSD patterns in three file formats: Oxford Instrument's h5ebsd format (H5OINA), EDAX TSL's UP1/2 files and a directory of image files.

    New readers for loading master patterns of transmission kikuchi diffraction and electron channeling patterns simulated with EMsoft are also added.

    Finally, EBSD refinement is improved by applying the signal mask to experimental patterns as well, in addition to some internal improvements which combined can improve speeds by a factor of about 2.

    See below, the changelog or the GitHub changelog for all updates from the previous release.

    Added

    • Signal mask passed to EBSD orientation and projection center refinement methods is now applied to the experimental pattern as well. (#573)
    • Dependency imageio needed for reading EBSD patterns in image files. (#570)
    • Reader of an EBSD signal from all images in a directory assuming they are of the same shape and data type. (#570)
    • Reader of an EBSD signal from EDAX TSL's binary UP1/UP2 file formats. (#569)
    • Ability to project simulated patterns from a master pattern using varying projection centers (PCs) in EBSDMasterPattern.get_patterns(). An example is added to the method to show this. (#567)
    • Allow not setting energy parameter in EBSDMasterPattern.get_patterns(), upon which the highest energy available is used. (#567)
    • Improved handling of custom attributes xmap, detector and static_background in EBSD and hemisphere, phase and projection in EBSD/ECP master pattern classes when calling inherited HyperSpy Signal2D methods as_lazy(), change_dtype(), compute(), deepcopy(), set_signal_type() and squeeze(). (#564)
    • Reader of an electron channelig pattern (ECP) master pattern from an EMsoft HDF5 file into an ECPMasterPattern signal. (#564)
    • Reader of a transmission kikuchi diffraction (TKD) master pattern from an EMsoft HDF5 file into an EBSDMasterPattern signal. (#564)
    • ECPMasterPattern class. (#564)
    • Some internal logging which can be controlled via kikuchipy.set_log_level(). (#564)
    • Reader of an EBSD signal from Oxford Instrument's h5ebsd format (H5OINA). (#562)
    • Figures of reference frames of other software added to the documentation. (#552)
    • Whether to show progressbars from most signal methods (except indexing and refinement) can be controlled by passing show_progressbar or by setting HyperSpy's hs.preferences.General.show_progressbar (see their docs for details). (#550)

    Changed

    • Documentation theme from Furo to PyData, as the growing API reference is easier to navigate with the latter. (#574)
    • Use Rodrigues-Frank vector components (Rx, Ry, Rz) instead of Euler angles in EBSD orientation and projection center refinement methods. This means that if refinement is not directly but a Dask array is returned from any of these methods, the data which previously contained Euler angles now contain these vector components. This change was done to speed up refinement. (#573)
    • Most of the EBSD metadata structure is removed, in an effort to move all relevant data to the attributes xmap, static_background, and detector. (#562)
    • h5ebsd plugin split into one plugin for each h5ebsd format (kikuchipy, EDAX TSL, and Bruker Nano). (#562)
    • EBSDDetector.plot() and PCCalibrationMovingScreen.plot() parameter return_fig_ax renamed to return_figure. (#552)
    • Import modules lazily using the specification in PEP 562. (#551)
    • Minimal version of HyperSpy increased to >= 1.7.1. (#550)
    • progressbar parameter to show_progressbar in kikuchipy.data functions which accepts a allow_download parameter. If not given, the value is retreived from HyperSpy's preferences. (#550)

    Deprecated

    • mask parameter in EBSD orientation and projection center refinement is deprecated in favor of signal_mask, and will be removed in version 0.8.0. (#573)
    • projections.ebsd_projections module. (#563)

    Removed

    • EBSDSimulationGenerator and GeometricalEBSDSimulation (use KikuchiPatternSimulator and GeometricalKikuchiPatternSimulation instead) and simulations.features module. (#563)
    • crystallography module. (#563)
    • Options "north" and "south" for property EBSDMasterPattern.hemisphere and in the parameter "hemisphere" in kikuchipy.data.nickel_ebsd_master_pattern_small(); use "upper" and "lower" instead. (#563)
    • Functions remove_static_background(), remove_dynamic_background() and get_image_quality() from chunk module. (#563)
    • Parameter relative in EBSD.remove_static_background(). (#563)
    • Functions ebsd_metadata() and metadata_nodes() which have been deprecated since v0.5. (#550, #562)
    • Print information emitted from EBSD methods like remove_static_background() is removed. (#550)

    Fixed

    • detector attribute of EBSD signal returned from the NORDIF calibration pattern reader is now an EBSDDetector and not just a dictionary. (#569)
    • Silence dask warning about splitting large chunks in EBSD.dictionary_indexing(). Memory use can be controlled by rechunking the dictionary or setting the rechunk or n_per_iteration parameters. (#567)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.1(Jun 17, 2022)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See below, the changelog or the GitHub changelog for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Fixed

    • Incorrect filtering of zone axes labels in geometrical simulations. (#544)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Jun 15, 2022)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    The highlight in this release is a new simulator setup supporting all crystallographic point groups, which is capable of geometrical and kinematical EBSD simulations in the stereographic, Lambert or spherical projections, as well as on the EBSD detector. The new simulator and returned simulation objects replace the existing simulation generator and returned simulation objects, which are deprecated.

    See below, the changelog or the GitHub changelog for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Added

    • EBSDMasterPattern.plot_spherical() for plotting a master pattern in the stereographic projection on the 3D sphere. (#536)
    • Projection of master pattern in the stereographic projection to the square Lambert projection via EBSDMasterPattern.to_lambert(). (#536)
    • New package dependencies on pyvista for 3D plotting and on pythreejs for the docs are introduced. (#536)
    • Reduce time and memory use of the following kikuchipy.signals.EBSD methods by using hyperspy.signal.BaseSignal.map(): remove_static_background(), remove_dynamic_background() and get_image_quality(). (#527)
    • progressbar parameter to functions downloading external datasets in the data module. (#515)
    • Support for Python 3.10. (#504)
    • EBSD.static_background property for easier access to the background pattern. (#475)

    Changed

    • Valid EBSDMasterPattern.hemisphere values from "north" and "south" to "upper" and "lower", respectively, to be in line with orix. (#537)
    • Increase minimal version of diffsims to 0.5. (#537)
    • Chunking of EBSD signal navigation dimensions in EBSD.average_neighbour_patterns() to reduce memory use. (#532)
    • Remove requirement that the crystal map used for EBSD refinement has identical step size(s) to the EBSD signal's navigation axes. This raised an error previously, but now only emits a warning. (#531)
    • Increase minimal version of HyperSpy to 1.7. (#527)
    • Increase minimal version of SciPy to 1.7. (#504)

    Deprecated

    • The kikuchipy.simulations.GeometricalEBSDSimulation class is deprecated and will be removed in version 0.7. Obtain kikuchipy.simulations.GeometricalKikuchiPatternSimulation via kikuchipy.simulations.KikuchiPatternSimulator.on_detector() instead. The kikuchipy.simulations.features module is also deprecated and will be removed in version 0.7. Obtain Kikuchi line and zone axis detector/gnomonic coordinates of a simulation via lines_coordinates() and zone_axes_coordinates() instead. (#537)
    • The kikuchipy.generators.EBSDSimulationGenerator class is deprecated and will be removed in version 0.7. Use the kikuchipy.simulations.KikuchiPatternSimulator class instead. (#537)
    • The kikuchipy.crystallography.matrices module is depreacted and will be removed in version 0.7, access the matrices via diffpy.structure.Lattice attributes instead. (#537)
    • The following functions for processing of pattern chunks in the kikuchipy.pattern.chunk module are deprecated and will be removed in version 0.7: get_image_quality(), remove_dynamic_background() and remove_static_background(). Use the EBSD class for processing of many patterns. (#527, #533)

    Removed

    • The relative parameter in kikuchipy.signals.EBSD.remove_static_background(). The parameter is accepted but not used. Passing it in version 0.7 will result in an error. (#527)

    Fixed

    • Plotting of geometrical simulation markers on rectangular patterns. (#537)
    • Hopefully prevent EBSD refinement tests using random data to fail on Azure. (#465)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.8(May 16, 2022)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See the changelog or https://github.com/pyxem/kikuchipy/compare/v0.5.7...v0.5.8 for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Changed

    • Minimal version of orix is increased to 0.9. (#520)

    Fixed

    • Internal use of orix.vector.Vector3d following orix' 0.9.0 release. (#520)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.7(Jan 10, 2022)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See the changelog for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Fixed

    • EBSD orientation refinement on Windows producing garbage results due to unpredictable behaviour in Numba function which converts Euler triplet to quaternion. (#495)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.6(Jan 2, 2022)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See the changelog or below for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Added

    • Convenience function [get_rgb_navigator()]{.title-ref} to create an RGB signal from an RGB image. (#491)

    Changed

    • Pattern matching notebook to include orientation maps from orix. (#491)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.5(Dec 12, 2021)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See the changelog or below for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes
    • Zhou Xu

    Fixed

    • Not flipping rows and columns when saving non-square patterns to kikuchipy's h5ebsd format. (#486)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.4(Nov 17, 2021)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See the changelog or below for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Added

    • Optional parameters rechunk and chunk_kwargs to EBSD refinement methods to better control possible rechunking of pattern array before refinement. (#470)

    Changed

    • When EBSD refinement methods don't immediately compute, they return a dask array instead of a list of delayed instances. (#470)

    Fixed

    • Memory issue in EBSD refinement due to naive use of dask.delayed. Uses map_blocks() instead. (#470)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.3(Nov 2, 2021)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See below or the changelog for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes
    • Zhou Xu

    Added

    • Printing of speed (patterns per second) of dictionary indexing and refinement. (#461)
    • Restricted newest version of hyperspy>=1.6.5 due to incompatibility with h5py>=3.5. (#461)

    Fixed

    • Handling of projection centers (PCs): Correct conversion from/to EMsoft's convention requires binning factor and detector pixel size. Conversion between TSL/Oxford and Bruker conventions correctly uses detector aspect ratio. (#455)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.2(Sep 11, 2021)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    This patch release was made so that cubochoric orientation sampling is used in the user guide. This is an improvement compared to the orientation sampling previously used. Cubochoric sampling was just made available in orix v0.7.

    See the changelog for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Changed

    • Add gnomonic circles as patches in axes returned from EBSDDetector.plot(). (#445)
    • Restrict lowest supported version of orix to >= 0.7. (#444)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(Sep 1, 2021)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See the changelog for all updates from the previous release.

    Contributors

    • Håkon Wiik Ånes

    Added

    • Automatic creation of a release using GitHub Actions, which will simplify and lead to more frequent patch releases. (#433)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.1rc1(Sep 1, 2021)

    kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    See the changelog for all updates from the previous release.

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Aug 31, 2021)

    kikuchipy 0.5.0 is a minor release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    The most notable addition to this release is the possibility to refine EBSD orientations and/or projection/pattern center (PC) coordinates using SciPy's optimization algorithms. Also, the time to generate a dictionary of simulated EBSD patterns from a master pattern has been reduced substantially. A signal/detector mask can be used with dictionary indexing, and memory usage can be controlled somewhat by setting some parameters.

    Some previously deprecated functionality has been removed, and some existing functionality has been deprecated to be removed in the future. Note that some functionality has also been changed in this release without a previous warning.

    All updates from the previous release are listed below.

    Contributors

    • Eric Prestat
    • Håkon Wiik Ånes
    • Lars Andreas Hastad Lervik

    Added

    • Possibility to specify whether to rechunk experimental and simulated data sets and which data type to use for dictionary indexing. (#419)
    • How to use the new orientation and/or projection center refinements to the pattern matching notebook. (#405)
    • Notebooks to the documentation as shorter or longer "Examples" that don't fit in the user guide. (#403)
    • Refinement module for EBSD refinement. Allows for the refinement of orientations and/or projection center estimates. (#387)

    Changed

    • If a custom metric is to be used for dictionary indexing, it must now be a class inheriting from an abstract SimilarityMetric class. This replaces the previous SimilarityMetric class and the make_similarity_metric() function. (#419)
    • Dictionary indexing parameter n_slices to n_per_iteration. (#419)
    • merge_crystal_maps parameter metric to greater_is_better. (#419)
    • orientation_similarity_map parameter normalized is by default False. (#419)
    • Dependency versions for dask >= 2021.8.1, fixing some memory issues encountered after 2021.3.1, and HyperSpy >= 1.6.4. Remove importlib_metadata from package dependencies. (#418)
    • Performance improvements to EBSD dictionary generation, giving a substantial speed-up. (#405)
    • Rename projection methods from project()/iproject() to vector2xy()/xy2vector(). (#405)
    • URLs of user guide topics have an extra "/user_guide/" added to them. (#403)

    Deprecated

    • Custom EBSD metadata, meaning the Acquisition_instrument.SEM.EBSD.Detector and Sample.Phases nodes, as well as the EBSD set_experimental_parameters() and set_phase_parameters() methods. This will be removed in v0.6 The static_background metadata array will become available as an EBSD property. (#428)

    Removed

    • make_similarity_metric() function is replaced by the need to create a class inheriting from a new abstract SimilarityMetric class, which provides more freedom over preparations of arrays before dictionary indexing. (#419)
    • EBSD.match_patterns() is removed, use EBSD.dictionary_indexing() instead. (#419)
    • kikuchipy.pattern.correlate module. (#419)

    Fixed

    • Allow static background in EBSD metadata to be a Dask array. (#413)
    • Set newest supported version of Sphinx to 4.0.2 so that nbsphinx works. (#403)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jul 8, 2021)

    kikuchipy 0.4.0 is a minor release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    The most notable addition is the reading of uncompressed EBSD patterns from Oxford Instruments' binary .ebsp file format, making users of their detectors able to visualize and analyze their patterns in kikuchipy! Projection/pattern center calibration via the moving screen technique is also added. All updates from the previous release are listed below.

    Contributors

    • Håkon Wiik Ånes

    Added

    • Sample tilt about RD can be passed as part of an EBSDDetector. This can be used when projecting parts of master patterns onto a detector. (#381)
    • Reader for uncompressed EBSD patterns stored in Oxford Instrument's binary .ebsp file format. (#371, #391)
    • Unit testing of docstring examples. (#350)
    • Support for Python 3.9. (#348)
    • Projection/pattern center calibration via the moving screen technique in a kikuchipy.detectors.calibration module. (#322)
    • Three single crystal Si EBSD patterns, from the same sample position but with varying detector distances, to the data module (via external repo). (#320)
    • Reading of NORDIF calibration patterns specified in a setting file into an EBSD signal. (#317)

    Changed

    • Only return figure from kikuchipy.filters.Window.plot() if desired, also add a colorbar only if desired. (#375)

    Deprecated

    • The kikuchipy.pattern.correlate module will be removed in v0.5. Use kikuchipy.indexing.similarity_metrics instead. (#377)
    • Rename the EBSD.match_patterns() method to EBSD.dictionary_indexing(). match_patterns() will be removed in v0.5. (#376)

    Fixed

    • Set minimal requirement of importlib_metadata to v3.6 so Binder can run user guide notebooks with HyperSpy 1.6.3. (#395)
    • Row (y) coordinate array returned with the crystal map from dictionary indexing is correctly sorted. (#392)
    • Deep copying EBSD and EBSDMasterPattern signals carry over, respectively, xmap and detector, and phase, hemisphere and projection properties. (#356)
    • Scaling of region of interest coordinates used in virtual backscatter electron imaging to physical coordinates. (#349)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.4(May 26, 2021)

    kikuchipy 0.3.4 is a patch release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    The release ensures a clean install of kikuchipy will install compatible versions of some dependencies.

    See other changes in the 0.3.x minor release cycle in the changelog.

    Contributors

    • Håkon Wiik Ånes

    Added

    • Restrict newest version of dask<=2021.03.1 and pin version of orix==0.6.0. (#360)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.3(Apr 21, 2021)

    kikuchipy 0.3.3 is a patch release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    The release fixes bugs related to merging of crystal maps, getting markers from a geometrical EBSD simulation, removing the static background in an EBSD signal with non-square patterns, and reading of EBSD patterns from Bruker h5ebsd (HDF5) datasets created with a region of interest.

    See other changes in the 0.3.x minor release cycle in the changelog.

    Contributors

    • Håkon Wiik Ånes
    • Ole Natlandsmyr

    Fixed

    • Reading of EBSD patterns from Bruker h5ebsd with a region of interest (#339)
    • Merging of (typically refined) crystal maps, where either a simulation indices array is not present or the array contains more indices per point than scores. (#335)
    • Bugs in getting plot markers from geometrical EBSD simulation. (#334)
    • Passing a static background pattern to EBSD.remove_static_background() for a non-square detector dataset works. (#331)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Feb 1, 2021)

    kikuchipy 0.3.2 is a patch release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    The release fixes a bug in the creation of the returned CrystalMap(s) after pattern matching with the EBSD.match_patterns() method.

    See other changes in the 0.3.x minor release cycle in the changelog.

    Contributors

    • Håkon Wiik Ånes

    Fixed

    • Deletion of temporary files saved to temporary directories in user guide (#312)
    • Pattern matching sometimes failing to generate a crystal map due to incorrect creation of spatial arrays (#307)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Jan 22, 2021)

    kikuchipy 0.3.1 is a patch release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    The release ensures that Binder finds the GitHub repository and user guide Jupyter Notebooks, so that the latter can be run interactively in the browser.

    See other changes in the 0.3.x minor release cycle in the changelog.

    Contributors

    • Håkon Wiik Ånes

    Fixed

    • Version link Binder uses to make the Jupyter Notebooks run in the browser. (#301)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jan 22, 2021)

    kikuchipy 0.3.0 is a minor release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns.

    Lots of new functionality is added! The most notable additions are generation of a dictionary of simulated EBSD patterns from a master pattern via a detector-sample geometrical model, subsequent crystal orientation determination via pattern matching of experimental patterns to this dictionary, geometrical EBSD simulations of band centeres and zone axes of cubic crystals to plot on top of experimental patterns, and calculation of an average dot product map for an informative spatial representation of an EBSD signal. The user guide is also updated with Jupyter notebooks explaining and showing most of the available functionality, which can be run in the browser via Binder or locally by downloading the notebooks. We would love for you to try them out via https://kikuchipy.org/en/stable!

    All changes from the previous release are listed below in descending chronological order. The contributors are listed in alphabetical order.

    Contributors

    • Håkon Wiik Ånes
    • Lars Andreas Hastad Lervik
    • Ole Natlandsmyr

    Added

    • Calculation of an average dot product map, or just the dot product matrices. (#280)
    • A nice gallery to the documentation with links to each user guide page. (#285)
    • Support for writing/reading an EBSD signal with 1 or 0 navigation axes to/from a kikuchipy h5ebsd file. (#276)
    • Better control over dask array chunking when processing patterns. (#275)
    • User guide notebook showing basic pattern matching. (#263)
    • EBSD.detector property storing an EBSDDetector. (#262)
    • Link to Binder in README and in the notebooks for running them in the browser. (#257)
    • Creation of dictionary of dynamically simulated EBSD patterns from a master pattern in the square Lambert projection. (#239)
    • A data module with a small Nickel EBSD data set and master pattern, and a larger EBSD data set downloadable via the module. Two dependencies, pooch and tqdm, are added along with this module. (#236, #237, #243)
    • Pattern matching of EBSD patterns with a dictionary of pre-computed simulated patterns with known crystal orientations, and related useful tools (#231, #233, #234): (1) A framework for creation of similarity metrics used in pattern matching, (2) computation of an orientation similarity map from indexing results, and (3) creation of a multi phase crystal map from single phase maps from pattern matching.
    • EBSD.xmap property storing an orix CrystalMap. (#226)
    • Dependency on the diffsims package for handling of electron scattering and diffraction. (#220)
    • Square Lambert mapping, and its inverse, from points on the unit sphere to a 2D square grid, as implemented in Callahan and De Graef (2013). (#214)
    • Geometrical EBSD simulations, projecting a set of Kikuchi bands and zone axes onto a detector, which can be added to an EBSD signal as markers. (#204, #219, #232)
    • EBSD detector class to handle detector parameters, including detector pixels' gnomonic coordinates. EBSD reference frame documentation. (#204, #215)
    • Reader for EMsoft's simulated EBSD patterns returned by their EMEBSD.f90 program. (#202)

    Changed

    • The feature maps notebook to include how to obtain an average dot product map and dot product matrices for an EBSD signal. (#280)
    • Averaging EBSD patterns with nearest neighbours now rescales to input data type range, thus loosing relative intensities, to avoid clipping intensities. (#280)
    • Dependency requirement of diffsims from >= 0.3 to >= 0.4. (#282)
    • Name of hemisphere axis in EBSDMasterPattern from "y" to "hemisphere". (#275)
    • Replace Travis CI with GitHub Actions. (#250)
    • The EBSDMasterPattern gets phase, hemisphere and projection properties. (#246)
    • EMsoft EBSD master pattern plugin can read a single energy pattern. Parameter energy_range changed to energy. (#240)
    • Migrate user guide from reST files to Jupyter Notebooks converted to HTML with the nbsphinx package. (#236, #237, #244, #245, #279, #245, #279, #281)
    • Move GitHub repository to the pyxem organization. Update relevant URLs. (#198)
    • Allow scikit-image >= 0.16. (#196)
    • Remove language_version in pre-commit config file. (#195)

    Removed

    • The EBSDMasterPattern and EBSD metadata node Sample.Phases, to be replaced by class attributes. The set_phase_parameters() method is removed from both classes, and the set_simulation_parameters() is removed from the former class. (#246)

    Fixed

    • IndexError in neighbour pattern averaging (#280)
    • Reading of square Lambert projections from EMsoft's master pattern file now sums contributions from asymmetric positions correctly. (#255)
    • NumPy array creation when calculating window pixel's distance to the origin is not ragged anymore. (#221)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0rc1(Jan 21, 2021)

  • v0.2.2(May 24, 2020)

    This is a patch release that fixes reading of EBSD data sets from h5ebsd files with arbitrary scan group names.

    Contributors

    • Håkon Wiik Ånes

    Fixed

    • Allow reading of EBSD patterns from h5ebsd files with arbitrary scan group names, not just "Scan 1", "Scan 2", etc., like was the case before. (#188)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(May 20, 2020)

    This is a patch release that enables installing kikuchipy 0.2 from Anaconda and not just PyPI.

    Contributors

    • Håkon Wiik Ånes

    Changed

    • Use numpy.fft instead of scipy.fft because HyperSpy requires scipy < 1.4 on conda-forge, while scipy.fft was introduced in scipy 1.4. (#180)

    Fixed

    • With the change above, kikuchipy 0.2 should be installable from Anaconda and not just PyPI. (#180)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(May 19, 2020)

    kikuchipy 0.2.0 is a minor release of kikuchipy, an open-source Python library for processing and analysis of electron backscatter diffraction patterns.

    A significant amount of new functionality have been added in this release cycle, as summarized under "Added" below. The API has changed somewhat, see "Changed" below. Details of all development associated with this release are available here.

    Contributors

    • Håkon Wiik Ånes
    • Tina Bergh

    Added

    • Jupyter Notebooks with tutorials and example workflows available via https://github.com/kikuchipy/kikuchipy-demos.
    • Grey scale and RGB virtual backscatter electron (BSE) images can be easily generated with the VirtualBSEGenerator class. The generator return objects of the new signal class VirtualBSEImage, which inherit functionality from HyperSpy's Signal2D class. (#170)
    • EBSD master pattern class and reader of master patterns from EMsoft's EBSD master pattern file. (#159)
    • Python 3.8 support. (#157)
    • The public API has been restructured. The pattern processing used by the EBSD class is available in the kikuchipy.pattern subpackage, and filters/kernels used in frequency domain filtering and pattern averaging are available in the kikuchipy.filters subpackage. (#169)
    • Intensity normalization of scan or single patterns. (#157)
    • Fast Fourier Transform (FFT) filtering of scan or single patterns using SciPy's fft routines and Connelly Barnes' filterfft. (#157)
    • Numba dependency to improve pattern rescaling and normalization. (#157)
    • Computing of the dynamic background in the spatial or frequency domain for scan or single patterns. (#157)
    • Image quality (IQ) computation for scan or single patterns based on N. C. K. Lassen's definition. (#157)
    • Averaging of patterns with nearest neighbours with an arbitrary kernel, e.g. rectangular or Gaussian. (#134)
    • Window/kernel/filter/mask class to handle such things, e.g. for pattern averaging or filtering in the frequency or spatial domain. Available in the kikuchipy.filters subpackage. (#134, #157)

    Changed

    • Renamed five EBSD methods: static_background_correction to remove_static_background, dynamic_background_correction to remove_dynamic_background, rescale_intensities to rescale_intensity, virtual_backscatter_electron_imaging to plot_virtual_bse_intensity, and get_virtual_image to get_virtual_bse_intensity. (#157, #170)
    • Renamed kikuchipy_metadata to ebsd_metadata. (#169)
    • Source code link in the documentation should point to proper GitHub line. This linkcode_resolve in the conf.py file is taken from SciPy. (#157)
    • Read the Docs CSS style. (#157)
    • New logo with a gradient from experimental to simulated pattern (with EMsoft), with a color gradient from the plasma color maps. (#157)
    • Dynamic background correction can be done faster due to Gaussian blurring in the frequency domain to get the dynamic background to remove. (#157)

    Removed

    • Explicit dependency on scikit-learn (it is imported via HyperSpy). (#168)
    • Dependency on pyxem. Parts of their virtual imaging methods are adapted here---a big thank you to the pyxem/HyperSpy team! (#168)

    Fixed

    • RtD builds documentation with Python 3.8 (fixed problem of missing .egg leading build to fail). (#158)
    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(May 11, 2020)

    KikuchiPy is an open-source Python library for processing and analysis of electron backscatter diffraction patterns: https://kikuchipy.readthedocs.io.

    This is a patch release. It is anticipated to be the final release in the 0.1.x series.

    Added

    • Package installation with Anaconda via the conda-forge channel: https://anaconda.org/conda-forge/kikuchipy/.

    Fixed

    • Static and dynamic background corrections are done at float 32-bit precision, and not integer 16-bit.
    • Chunking of static background pattern.
    • Chunking of patterns in the h5ebsd reader.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Jan 9, 2020)

    0.1.2 (2020-01-09)

    KikuchiPy is an open-source Python library for processing and analysis of electron backscatter diffraction patterns: https://kikuchipy.readthedocs.io

    This is a bug-fix release that ensures, unlike the previous bug-fix release, that necessary files are downloaded when installing from PyPI.

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jan 4, 2020)

  • v0.1.0(Jan 4, 2020)

    0.1.0 (2020-01-04)

    We're happy to announce the release of KikuchiPy v0.1.0!

    KikuchiPy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns. The library builds upon the tools for multi-dimensional data analysis provided by the HyperSpy library.

    For more information, a user guide, and the full reference API documentation, please visit: https://kikuchipy.readthedocs.io

    This is the initial pre-release, where things start to get serious... seriously fun!

    Features

    • Load EBSD patterns and metadata from the NORDIF binary format (.dat), or Bruker Nano's or EDAX TSL's h5ebsd formats (.h5) into an EBSD object, e.g. s, based upon HyperSpy's Signal2D class, using s = kp.load(). This ensures easy access to patterns and metadata in the attributes s.data and s.metadata, respectively.

    • Save EBSD patterns to the NORDIF binary format (.dat) and our own h5ebsd format (.h5), using s.save(). Both formats are readable by EMsoft's NORDIF and EMEBSD readers, respectively.

    • All functionality in KikuchiPy can be performed both directly and lazily (except some multivariate analysis algorithms). The latter means that all operations on a scan, including plotting, can be done by loading only necessary parts of the scan into memory at a time. Ultimately, this lets us operate on scans larger than memory using all of our cores.

    • Visualize patterns easily with HyperSpy's powerful and versatile s.plot(). Any image of the same navigation size, e.g. a virtual backscatter electron image, quality map, phase map, or orientation map, can be used to navigate in. Multiple scans of the same size, e.g. a scan of experimental patterns and the best matching simulated patterns to that scan, can be plotted simultaneously with HyperSpy's plot_signals().

    • Virtual backscatter electron (VBSE) imaging is easily performed with s.virtual_backscatter_electron_imaging() based upon similar functionality in pyXem. Arbitrary regions of interests can be used, and the corresponding VBSE image can be inspected interactively. Finally, the VBSE image can be obtained in a new EBSD object with vbse = s.get_virtual_image(), before writing the data to an image file in your desired format with matplotlib's imsave('filename.png', vbse.data).

    • Change scan and pattern size, e.g. by cropping on the detector or extracting a region of interest, by using s.isig or s.inav, respectively. Patterns can be binned (upscaled or downscaled) using s.rebin. These methods are provided by HyperSpy.

    • Perform static and dynamic background correction by subtraction or division with s.static_background_correction() and s.dynamic_background_correction(). For the former connection, relative intensities between patterns can be kept if desired.

    • Perform adaptive histogram equalization by setting an appropriate contextual region (kernel size) with s.adaptive_histogram_equalization().

    • Rescale pattern intensities to desired data type and range using s.rescale_intensities().

    • Multivariate statistical analysis, like principal component analysis and many other decomposition algorithms, can be easily performed with s.decomposition(), provided by HyperSpy.

    • Since the EBSD class is based upon HyperSpy's Signal2D class, which itself is based upon their BaseSignal class, all functionality available to Signal2D is also available to the EBSD class. See HyperSpy's user guide (http://hyperspy.org/hyperspy-doc/current/user_guide/tools.html) for details.

    Contributors to this release (alphabetical by first name)

    • Håkon Wiik Ånes
    • Tina Bergh
    Source code(tar.gz)
    Source code(zip)
Owner
pyxem
multi-dimensional diffraction microscopy
pyxem
QR Generator using GUI with Tinker

BinCat Token System Very simple python script with GUI that generates QR codes. It don't include a QR "decription" tool. It only generate-it and thats

Hipotesi 1 Nov 06, 2021
Program designed to mass edit and watermark all photos in a directory

Photographer-All-In-One This is a program designed for photographers to mass edit or watermark photos (.jpg || .png) You can run this program from any

Brad Martin 2 Nov 23, 2021
LSB Image Steganography Using Python

Steganography is the science that involves communicating secret data in an appropriate multimedia carrier, e.g., image, audio, and video files

Mahmut Can Gönül 2 Nov 04, 2021
An ascii art generator that's actually good. Does edge detection and selects the most appropriate characters.

Ascii Artist An ascii art generator that's actually good. Does edge detection and selects the most appropriate characters. Installing Installing with

18 Jan 03, 2023
Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine.

img2dataset Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine. Also supports

Romain Beaumont 1.4k Jan 01, 2023
Plots the graph of a function with ASCII characters.

ASCII Graph Plotter Plots the graph of a function with ASCII characters. See the change log here. Developed by InformaticFreak (c) 2021 How to use py

InformaticFreak 2 Apr 29, 2022
sK1 2.0 cross-platform vector graphics editor

sK1 2.0 sK1 2.0 is a cross-platform open source vector graphics editor similar to CorelDRAW, Adobe Illustrator, or Freehand. sK1 is oriented for prepr

sK1 Project 238 Dec 04, 2022
A ray tracing render implemented using Taichi language.

A ray tracing render implemented using Taichi language.

Mingrui Zhang 45 Oct 23, 2022
Convert any binary data to a PNG image file and vice versa.

What is PngBin? The name PngBin comes from an image format file extension PNG (Portable Network Graphics) and the word Binary. An image produced by Pn

Nathan Young 87 Dec 22, 2022
Create a QR-code Generator app using only Python.

QR-code_Generator Create a QR-code Generator app using only Python. This apps generated a QR code for a single link. Libraryes used in this app -- py

Soham P Phasalkar 1 Oct 17, 2021
OctoPrint is the snappy web interface for your 3D printer!

OctoPrint OctoPrint provides a snappy web interface for controlling consumer 3D printers. It is Free Software and released under the GNU Affero Genera

OctoPrint 7.1k Jan 03, 2023
With this simple py script you will be able to get all the .png from a folder and generate a yml for Oraxen

Oraxen-item-to-yml With this simple py script you will be able to get all the .png from a folder and generate a yml for Oraxen How to use Install the

Akex 1 Dec 29, 2021
Generative Art Synthesizer - a python program that generates python programs that generates generative art

GAS - Generative Art Synthesizer Generative Art Synthesizer - a python program that generates python programs that generates generative art. Examples

Alexey Borsky 43 Dec 03, 2022
A python script for extracting/removing exif data from images by @AbirHasan2005

Image-Exif A Python script for extracting exif metadata from images. How to use? Using this script you can extract exif data from image and save in .c

Abir Hasan 13 Dec 16, 2022
An example which streams RGB-D images over spout.

Spout RGB-D Example An example which streams RGB-D images over spout with visiongraph. Due to the spout dependency this currently only works on Window

Florian Bruggisser 4 Nov 14, 2022
A suite of useful tools based on 3D interactivity in napari

napari-threedee A suite of useful tools based on 3D interactivity in napari This napari plugin was generated with Cookiecutter using @napari's cookiec

11 Dec 14, 2022
The aim is to extract timeseries water level 2D information for any designed boundaries within the EasyGSH model domain

bct_file_generator_for_EasyGSH The aim is to extract timeseries water level 2D information for any designed boundaries within the EasyGSH model domain

Clayton Soares 1 Jul 08, 2022
Converting Images Into Minecraft Houses

Converting Images Into Minecraft Houses In this particular project, we turned a 2D Image into Minecraft pixel art and then scaled it in 3D such that i

Mathias Oliver Valdbjørn Jørgensen 1 Feb 02, 2022
Extracts random colours from an image

EXTRACT COLOURS This repo contains all the project files. Project Description A Program that extracts 10 random colours from an image and saves the rg

David .K. Danso 3 Dec 13, 2021