Skip to content

Commit

Permalink
few more changes to correct calculation of number of voxels in mask
Browse files Browse the repository at this point in the history
  • Loading branch information
ccraddock committed Sep 13, 2013
1 parent 01de6fd commit 6c4f8a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions make_image_from_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ def make_image_from_bin( image, binfile, mask ):
print "sum",sum(imdat)

# map the binary data to mask
print "shape2",shape(a[0:sum(imdat)])
imdat[imdat>0]=short(a[0:sum(imdat)].flatten())
mask_voxels=(imdat.flatten()>0).sum()
print "shape2",shape(a[0:mask_voxels])
imdat[imdat>0]=short(a[0:mask_voxels].flatten())

# write out the image as nifti
thdr=nim.get_header()
Expand Down
5 changes: 2 additions & 3 deletions pyClusterROI_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
# random clustering

# for both group-mean and 2-level clustering we need to know the number of
# voxels in in the mask, which for us is 32254
mask_voxels=18377#31146
# nonzero voxels in in the mask
mask_voxels=(nb.load(maskname).get_data().flatten()>0).sum()

# group_mean clustering is pretty simple, input the connectivity files and run.
# we can perform multiple clusterings with this function, so once again the
Expand All @@ -171,7 +171,6 @@
group_mean_binfile_parcellate( tcorr_conn_files,\
'rm_group_mean_tcorr_cluster', NUM_CLUSTERS,mask_voxels);


# now group mean cluster scorr files
scorr_conn_files=['rm_scorr_conn_0.npy','rm_scorr_conn_1.npy',\
'rm_scorr_conn_2.npy']
Expand Down

0 comments on commit 6c4f8a0

Please sign in to comment.