You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to use my 3D imaging data when assigning locations.
I kept on getting the following errors: “IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed “
After running the command: “locations_from_image = novosparc.gm.create_target_space_from_image(tissue_path)”
The tissue path leads to a binarized .tif 3D expression image.
I ended changing the function in the following way:
locations = np.array([(x, y, z) for x in range(img_width) for y in range(img_height) for z in range(img_depth)
if sum(img[z, y, x, :] == np.array([0, 0, 0]))])
It would be good if this could be implemented in novosparc.
Best,
Shachar
The text was updated successfully, but these errors were encountered:
Hey,
I am unable to use my 3D imaging data when assigning locations.
I kept on getting the following errors: “IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed “
After running the command: “locations_from_image = novosparc.gm.create_target_space_from_image(tissue_path)”
The tissue path leads to a binarized .tif 3D expression image.
I ended changing the function in the following way:
tissue_path = '/…/_template_binarized_inverted.tif'
img = io.imread(tissue_path)
img_width = img.shape[2]
img_height = img.shape[1]
img_depth = img.shape[0]
locations = np.array([(x, y, z) for x in range(img_width) for y in range(img_height) for z in range(img_depth)
if sum(img[z, y, x, :] == np.array([0, 0, 0]))])
It would be good if this could be implemented in novosparc.
Best,
Shachar
The text was updated successfully, but these errors were encountered: