Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bcdarwin committed Nov 21, 2016
2 parents cfe58aa + f279d8b commit 3493ca1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
New in Version 0.1.18
=====================
* 2to3 fixes
* fix `install_requires` in setup.py

New in Version 0.1.17
=====================
* fix bug in TFCE implementation
Expand Down
11 changes: 6 additions & 5 deletions python/TFCE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from pyminc.volumes.factory import *
from scipy import ndimage, weave
from numpy import *
import operator
from functools import reduce


def tfce(invol, outvol, dh=0.1, E=0.5, H=2.0, negative = False):
Expand All @@ -26,16 +27,16 @@ def tfce(invol, outvol, dh=0.1, E=0.5, H=2.0, negative = False):

# connected components labelling
l = ndimage.label(thresh)
print "L:", l[1]
print("L:", l[1])
# compute the size of each label
sizes = array(ndimage.sum(thresh, l[0], range(l[1]+1)))
sizes = array(ndimage.sum(thresh, l[0], list(range(l[1]+1))))
# modulate label size by voxel volume
sizes = sizes * reduce(operator.mul, invol.separations)
print "sizes", sizes.shape
print("sizes", sizes.shape)

# compute TFCE
if l[1] > 0:
print "inside", h, l[1]
print("inside", h, l[1])
code = """
for (int x=0; x < nx; ++x) {
for (int y=0; y < ny; ++y) {
Expand All @@ -60,7 +61,7 @@ def tfce(invol, outvol, dh=0.1, E=0.5, H=2.0, negative = False):
type_converters=weave.converters.blitz,
compiler='gcc')

print h
print(h)
#outvol.writeFile()
#outvol.closeVolume()

Expand Down
2 changes: 1 addition & 1 deletion python/measure_xcorr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if __name__ == "__main__":

result = compute_xcorr(sourcevol, targetvol, options.mask)

print result
print(result)



Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import sys

setup(name="python-stuffs",
version='0.1.17',
version='0.1.18',
install_requires=['numpy', 'scipy', 'pyminc'],
scripts=["python/TFCE",
"python/smooth_vector",
"python/measure_xcorr",
Expand Down

0 comments on commit 3493ca1

Please sign in to comment.