Example #1
0
#
#    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
# This can take a _really_ long time
for idx, in_file in enumerate(infiles):

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

    print "scorr connectivity", in_file
    # call the funtion to make connectivity
    make_local_connectivity_scorr(in_file, maskname, outname, 0.5)

##### Step 2. Individual level clustering
# next we will do the individual level clustering, this is not performed for
# group-mean clustering, remember that for these functions the output name
# is a prefix that will have K and .npy added to it by the functions. We
# will perform this for clustering between 100, 150 and 200 clusters
NUM_CLUSTERS = [100, 150, 200]

# For random custering, this is all we need to do, there is no need for group
# level clustering, remember that the output filename is a prefix, and
binfile_parcellate("rm_ones_connectivity.npy", "rm_ones_cluster", NUM_CLUSTERS)

# for tcorr
for idx, in_file in enumerate(infiles):
# control mkl
import mkl
mkl.set_num_threads(int(sys.argv[1]))


###
# 1. SETUP
###

obase = "/home2/data/Projects/CWAS/age+gender/01_resolution/spatial_cluster"

# functions for connectivity metric
from make_local_connectivity_scorr import *

# name of the maskfile that we will be using
roidir = "/home2/data/Projects/CWAS/share/age+gender/analysis/01_resolution/rois"
maskfile = path.join(roidir, "mask_4mm.nii.gz")

# subject id and functional path
sid = int(sys.argv[2])
infile = sys.argv[3]


###
# 2. Generate Individual Connectivity Matrices
###

outfile = path.join(obase, "scorr_conn_%03i.npy" % sid)
make_local_connectivity_scorr( infile, maskfile, outfile, 0.5 )
Example #3
0
#
#    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
# This can take a _really_ long time
for idx, in_file in enumerate(infiles):

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

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

##### Step 2. Individual level clustering
# next we will do the individual level clustering, this is not performed for 
# group-mean clustering, remember that for these functions the output name
# is a prefix that will have K and .npy added to it by the functions. We
# will perform this for clustering between 100, 150 and 200 clusters
NUM_CLUSTERS = [100,150,200]

# For random custering, this is all we need to do, there is no need for group
# level clustering, remember that the output filename is a prefix, and 
binfile_parcellate('rm_ones_connectivity.npy','rm_ones_cluster',NUM_CLUSTERS)

# for tcorr
for idx, in_file in enumerate(infiles):
Example #4
0
if len(sys.argv) != 4:
    sys.exit("Usage: %s num-threads subject-id input-functional" % sys.argv[0])

# control mkl
import mkl
mkl.set_num_threads(int(sys.argv[1]))

###
# 1. SETUP
###

obase = "/home2/data/Projects/CWAS/age+gender/01_resolution/spatial_cluster"

# functions for connectivity metric
from make_local_connectivity_scorr import *

# name of the maskfile that we will be using
roidir = "/home2/data/Projects/CWAS/share/age+gender/analysis/01_resolution/rois"
maskfile = path.join(roidir, "mask_4mm.nii.gz")

# subject id and functional path
sid = int(sys.argv[2])
infile = sys.argv[3]

###
# 2. Generate Individual Connectivity Matrices
###

outfile = path.join(obase, "scorr_conn_%03i.npy" % sid)
make_local_connectivity_scorr(infile, maskfile, outfile, 0.5)