def map_ima_to_2D_hist(xinput, yinput, bins_arr):
"""Image to volume histogram mapping (kind of inverse histogram).
Parameters
----------
xinput : TODO
First image, which is often the intensity image (eg. T1w).
yinput : TODO
Second image, which is often the gradient magnitude image
derived from the first image.
bins_arr : TODO
Array of bins.
Returns
-------
vox2pixMap : TODO
Voxel to pixel mapping.
"""
dgtzData = np.digitize(xinput, bins_arr)-1
dgtzGra = np.digitize(yinput, bins_arr)-1
nr_bins = len(bins_arr)-1 # subtract 1 (more borders than containers)
vox2pixMap = sub2ind(nr_bins, dgtzData, dgtzGra) # 1D
return vox2pixMap
评论列表
文章目录