AllenInstitute/mouse_connectivity_models

RegionalizedModel.from_voxel_array() method gives ValueError

damingli09 opened this issue · 1 comments

Below is the code that is used to construct a 43 by 43 isocortex connectivity matrix using the spatial model. However, it raises a ValueError as shown below.

cache = VoxelModelCache()

voxel_array, source_mask, target_mask = cache.get_voxel_connectivity_array()

region_ids = np.load('isocortex_id_list.npy') # the 43 isocortex ROIs id here

source_key = source_mask.get_key(region_ids, hemisphere_id=2)

target_key = source_mask.get_key(region_ids, hemisphere_id=2)

regional_model = RegionalizedModel.from_voxel_array(voxel_array, source_key, target_key) # ValueError here: columns of nodes and elements in target_key must be of equal size
regional_model.normalized_connection_density

NCD = regional_model.normalized_connection_density

kamdh commented

Hi @damingli91 if this is still an issue, can you please upload a full script (all imports, etc) as well as any supporting files so we can run it. Thanks!