Skip to content

Commit

Permalink
modified test script to remove commented out code
Browse files Browse the repository at this point in the history
modified make_local_connectivity_* to print status
  • Loading branch information
ccraddock committed Sep 13, 2013
1 parent d79525c commit 01de6fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion make_local_connectivity_ones.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def make_local_connectivity_ones( maskfile, outfile ):

# loop over all of the voxels in the mask
for i in range(0,m):
if i % 100 == 0: print 'voxel# ', i
if i % 1000 == 0: print 'voxel #', i

# calculate the voxels that are in the 3D neighborhood
# of the center voxel
Expand Down
3 changes: 1 addition & 2 deletions make_local_connectivity_scorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def make_local_connectivity_scorr( infile, maskfile, outfile, thresh ):
sparse_w=[[]]

for i in range(0,m):
if i % 1000 == 0: print 'voxel #', i
# convert index into 3D and calculate neighbors
ndx3d=indx_1dto3d(iv[i],sz[:-1])+neighbors
# convert resulting 3D indices into 1D
Expand Down Expand Up @@ -193,8 +194,6 @@ def make_local_connectivity_scorr( infile, maskfile, outfile, thresh ):
sparse_i=append(sparse_i,ondx1d,0)
sparse_j=append(sparse_j,(ondx1d[nndx])*ones(len(ondx1d)))
sparse_w=append(sparse_w,R[nndx,:],1)
if i % 100 == 0:
print "Completed voxel # %d"%(i)


# insure that the weight vector is the correct shape
Expand Down
1 change: 1 addition & 0 deletions make_local_connectivity_tcorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def make_local_connectivity_tcorr( infile, maskfile, outfile, thresh ):

# loop over all of the voxels in the mask
for i in range(0,m):
if i % 1000 == 0: print 'voxel #', i
# calculate the voxels that are in the 3D neighborhood
# of the center voxel
ndx3d=indx_1dto3d(iv[i],sz[:-1])+neighbors
Expand Down
24 changes: 10 additions & 14 deletions pyClusterROI_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
# this scripts requires NumPy (numpy.scipy.org), SciPy (www.scipy.org), and
# NiBabel (http://niftilib.sourceforge.net/pynifti/) and the pyClusterROI
# toolbox to be installed in a directory that is accessible through PythonPath
# import sys

# this is how you would add a directory to the search path, this is useful if
# you are running this script from a directory other than the directory where
# the pyClusterROI is installed. Or if for some reason your NumPy, SciPy, or
# NiBabel libraries are in a non-standard location, do this before you import
# the files/libraries that require the change in path
# import sys
# sys.path.append("/home/user/python_toolboxes")

# import the different functions we will use from pyClusterROI
Expand All @@ -78,14 +78,10 @@
from make_image_from_bin import *
from make_image_from_bin_renum import *

#import mkl

from time import time

T0 = time()

#mkl.set_num_threads = 4

# the name of the maskfile that we will be using
maskname="gm_maskfile.nii.gz"

Expand All @@ -100,19 +96,19 @@
# the easiest is random clustering which doesn't require any functional
# data, just the mask
print 'ones connectivity'
#make_local_connectivity_ones( maskname, 'rm_ones_connectivity.npy')
make_local_connectivity_ones( maskname, 'rm_ones_connectivity.npy')


# construct the connectivity matrices using tcorr and a r>0.5 threshold

#for idx, in_file in enumerate(infiles[:1]):
#
# # construct an output filename for this file
# outname='rm_tcorr_conn_'+str(idx)+'.npy'
#
# print 'tcorr connectivity',in_file
# # call the funtion to make connectivity
# make_local_connectivity_tcorr( in_file, maskname, outname, 0.5 )
for idx, in_file in enumerate(infiles):

# construct an output filename for this file
outname='rm_tcorr_conn_'+str(idx)+'.npy'

print 'tcorr connectivity',in_file
# call the funtion to make connectivity
make_local_connectivity_tcorr( in_file, maskname, outname, 0.5 )


# construct the connectivity matrices using scorr and a r>0.5 threshold
Expand Down

0 comments on commit 01de6fd

Please sign in to comment.