Skip to content

Commit

Permalink
Removes tx and ty arguments in get_ellipse
Browse files Browse the repository at this point in the history
  • Loading branch information
Niru Maheswaranathan committed Apr 26, 2016
1 parent 98f4a0b commit 6f7d9ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 66 deletions.
58 changes: 1 addition & 57 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,61 +1,5 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
build/
_build/
dist/

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite
*.sqlite3
*.netrwhist

# OS generated files #
######################
.idea/*
*.egg-info/
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# Other
######################
*.swp
*.sublime-project
*.sublime-workspace
*.un~

# Data
######################
*.mat
*.npz
.cache/*
.coverage
htmlcov/
tags
12 changes: 3 additions & 9 deletions pyret/filtertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,12 @@ def get_regionprops(spatial_filter, threshold=10.0):
return regionprops(label(normalize_spatial(spatial_filter) >= threshold))


def get_ellipse(tx, ty, spatial_filter, pvalue=0.6827):
def get_ellipse(spatial_filter, pvalue=0.6827):
"""
Get the parameters of an ellipse fit to a spatial receptive field
Parameters
----------
tx : array_like
spatial sampling along the x-axis
ty : array_like
spatial sampling along the y-axis
spatial_filter : array_like
The spatial receptive field to which the ellipse should be fit
Expand All @@ -516,15 +510,15 @@ def get_ellipse(tx, ty, spatial_filter, pvalue=0.6827):
theta : float
angle of rotation of the ellipse from the vertical axis, in radians
"""

# preprocess
zdata = normalize_spatial(spatial_filter, clip_negative=True).ravel()
zdata /= zdata.max()

# get initial parameters
xm, ym = np.meshgrid(tx, ty)
nx, ny = spatial_filter.shape
xm, ym = np.meshgrid(np.arange(nx), np.arange(ny))
pinit = _initial_gaussian_params(xm, ym, zdata)

# optimize
Expand Down

0 comments on commit 6f7d9ff

Please sign in to comment.