Skip to content

Instantly share code, notes, and snippets.

View YaronBlinder's full-sized avatar

Yaron blinder YaronBlinder

View GitHub Profile
$ git pull origin workbench
Username for 'https://github.com': yaronblinder
From https://github.com/f0cal/edenis-v4msti
* branch workbench -> FETCH_HEAD
* [new branch] workbench -> origin/workbench
CONFLICT (rename/rename): Rename "Tests/calculateFVD/roipoly.py"->"v4msti/calcul ateFVD/roipoly.py" in branch "HEAD" rename "Tests/calculateFVD/roipoly.py"->"tes ts/calculateFVD/roipoly.py" in "99739439186a36bab17c6b0aaa5c873a1ae710b2"
CONFLICT (rename/rename): Rename "Tests/calculateFVD/length_calculator_ported.py "->"v4msti/calculateFVD/length_calculator_ported.py" in branch "HEAD" rename "Te sts/calculateFVD/length_calculat
$ GIT_CURL_VERBOSE=1 git clone -vvv https://github.com/f0cal/edenis-v4msti
Cloning into 'edenis-v4msti'...
* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
* Trying 192.30.253.113...
* Connected to github.com (192.30.253.113) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
from .calculateSC import *
from cv2 import imread
import pandas as pd
from wolong.base import BasePlugin
from wolong.cli import entrypoint
class CalcSCPlugin(BasePlugin): # REQUIRED
consumes_cols = ['filenames'] # REQUIRED
provides_cols = ['SpatialCorrelation'] # REQUIRED
class CalcSCPlugin(BasePlugin): # REQUIRED
consumes_cols = ['filenames'] # REQUIRED
provides_cols = ['SpatialCorrelation'] # REQUIRED
def __init__(self, df):
super(CalcSCPlugin, self).__init__(df) # REQUIRED
def process(self, window_size): # TYPICAL
def _helper(filenames):
SC = calculateSC(filenames,spatial_correlation=True,window_size=window_size)
function FVD = calculateFVD(filename, black, intensity_threshold, size_threshold)
% Prompt user for filename.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%prompt={'File name (including extension'}; % Bring up prompt to ask for file name for processing
%def={'example.tif'}; % Predefined answer
%dlgTitle='Input Parameters (all files must be in current directory)'; % Title of prompt
%lines=1; % Lines in prompt
%Resize='on'; % Allow resizing
% answer=inputdlg(prompt,dlgTitle,lines,def,Resize); % Record response
@YaronBlinder
YaronBlinder / Zhang_Suen_Odd.m
Created August 10, 2016 02:03
Zhang_Suen_Odd
function out = Zhang_Suen_Odd(nhood);
sum1 = sum(nhood(:))-nhood(5); % Sum over neighborhood of a given pixel excluding center pixel
condition_1 = (3<=sum1)&(sum1<=6); % Condition 1 = pixel must have between 3 and 6 nonzero neighbors
ring1 = [nhood(1) nhood(4) nhood(7) nhood(8) nhood(9) nhood(6) nhood(3) nhood(2)]; % Create array from surrounding pixels starting with top left neighbor
ring2 = [ring1(2:8) ring1(1)]; % Same as ring1 but start at top middle entry
crossing_number = sum((1-ring1).*ring2); % Compute crossing number
condition_2 = crossing_number==1; % Condition 2: crossing number is equal to 1
product1 = nhood(4).*nhood(8).*nhood(6); % Odd iteration will only delete pixels at top left corner, right side, and bottom
product2 = nhood(8).*nhood(6).*nhood(2);
condition_3 = (product1==0)&(product2==0);
@YaronBlinder
YaronBlinder / Traceback.txt
Created August 9, 2016 18:24
test_Zhang_Suen_ported
$ nosetests test_calculateFVD.py:test_Zhang_Suen_ported
E
======================================================================
ERROR: test_calculateFVD.test_Zhang_Suen_ported(array([[ 0.47107946, -0.97497669, 1.07764687, -0.04557485, -1.05282552,
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\mrbli_000\Desktop\Python\Anaconda\lib\site-packages\nose\case.py", line 198, in runTest
self.test(*self.arg)
File "<decorator-gen-2>", line 2, in Zhang_Suen_ported
File "C:\Users\mrbli_000\Desktop\f0cl\edenis-confidential\testrepo\edenis-v4msti\tests\calculateFVD\rt_insert.py", line 8, in _wrapper
%This is what stdfilt actually runs after checking the input - Y.B.
function J = algstdfilt(I,h)
% Main algorithm used by stdfilt function. See stdfilt for more
% details
% No input validation is done in this function.
% Copyright 2013-2015 The MathWorks, Inc.
def im2double_m(img, *args, **kwargs):
# return normalize(img.astype(np.float64), None, 0.0, 1.0, NORM_MINMAX)
img = img.astype(np.float64)
min_val = np.min(img.ravel())
max_val = np.max(img.ravel())
out = img*max_val/(max_val - min_val)
out = out/(255.0)
return out
import decorator
class RuntimeInsertionManager(object):
def insert_with_args(self, *args, **dargs):
@decorator.decorator
def _wrapper(wrapped, *_args, **_dargs):
if hasattr(self, 'callback'):
return self.callback(wrapped, _args, _dargs, args, dargs)
return wrapped(*_args, **_dargs)
return _wrapper