ePSIC-DLS / particlespy

Package for analysing particles in electron microscopy data sets.
GNU General Public License v3.0
20 stars 10 forks source link

Adding manual segmentation #16

Closed TomSlater closed 5 years ago

TomSlater commented 5 years ago

Description of the change

This PR adds a manual segmentation tab to SegUI, allowing users to manually create a mask for a single image. Segmentation is done by left-clicking and dragging a selection around a specific particle, followed by right-clicking in the middle of the selection. The generated mask can be saved using the save button and can be input to ParticleAnalysis by passing 'UI' as the mask argument.

Progress of the PR

Minimal example of the bug fix or the new feature


>>> import hyperspy.api as hs
>>> data = hs.load('Data/JEOL HAADF Image.dm4')
>>> import ParticleSpy.api as ps
>>> ps.SegUI(data)
>>> # Use the manual segmentation and hit save.
>>> particles = ps.ParticleAnalysis(data,params=ps.parameters(),mask='UI')
codecov[bot] commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@8ee3c4d). Click here to learn what that means. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #16   +/-   ##
=========================================
  Coverage          ?   55.34%           
=========================================
  Files             ?       13           
  Lines             ?      645           
  Branches          ?        0           
=========================================
  Hits              ?      357           
  Misses            ?      288           
  Partials          ?        0
Impacted Files Coverage Δ
ParticleSpy/ParticleAnalysis.py 73.75% <66.66%> (ø)