question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maybe a binary striplog is a special thing? Where the main component property is True or False… then you could allow operations like dilate and erode. (Can’t really see how you could allow this on non-binary logs).

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rgmyrcommented, Mar 21, 2019

Did some more hacky stuff (to get around non-numeric components, etc.) and came up with this for the grey version (with three components mapping to log values of [1,2,3]):

grey_morphology_demo

1reaction
rgmyrcommented, Mar 21, 2019

This is a little hacky so I won’t PR it, but here’s an example:

from scipy.ndimage import morphology

for iv in s:
    iv.data.update(iv.primary)

def dilate(s, field, height=0.75, step=0.01):
    
    blog, basis, _ = s.to_log(step=step, field='pay', return_meta=True)
    
    blog = morphology.binary_dilation(blog, structure=np.ones(int(height/step)))
    
    return Striplog.from_log(blog, cutoff=0.5, components=comps[::-1], basis=basis)
    

def erode(s, field, height=0.75, step=0.01):
    
    blog, basis, _ = s.to_log(step=step, field='pay', return_meta=True)
    
    blog = morphology.binary_erosion(blog, structure=np.ones(int(height/step)))
    
    return Striplog.from_log(blog, cutoff=0.5, components=comps[::-1], basis=basis)


dilated = dilate(s, 'pay')
for iv in dilated:
    iv.data.update(iv.primary)

eroded = erode(s, 'pay')
for iv in eroded:
    iv.data.update(iv.primary)

opened = dilate(eroded, 'pay')

closed = erode(dilated, 'pay')

I’ve double checked that the blog array comes out right, but for some reason it seems like the components get swapped and I have to use comps[::-1] list in from_log. Don’t know why that’s happening.

In any case, I made the structuring element a bit large for emphasis, but here’s the plot:

binary_morphology_demo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Binary striplog · Issue #95 - GitHub
Maybe a binary striplog is a special thing? Where the main component property is True or False... then you could allow operations like ......
Read more >
Striplog - agile/code documentation
striplog facilitates the loading, processing, and analysis of striplogs and other sequential ... How to work with binary logs · Merge overlapping striplogs...
Read more >
StripLog 8.5.1 - WellSight Systems Inc.
Automatically import ROP, Gas and other data from gas detectors and EDR systems. High-Quality Output. Clear, precise, professional quality printed strip logs.
Read more >
striplog Changelog - pyup.io
The Striplog constructor now creates Components if it is given miscellaneous data. ... Added binary morphology filters to ``Striplog`` object.
Read more >
FileViewPro
Browse All WellSight StripLog Files ... V2C, WellSight Systems, Encoded Files, WellSight Systems HASP SRM License Information Data, WellSight StripLog ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found