vessap / vessap

Experimental code and examples for: Automated analysis of whole brain vasculature using machine learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some casting might be needed

alecrimi opened this issue · comments

I got the following error:

Models successfully loaded
Volume size: (400, 2048, 2048)
Traceback (most recent call last):
File "test.py", line 173, in
run()
File "test.py", line 154, in run
probs, bins = predict_volume(model=model, data=data, mask=mask, cube_size=args.cube_size, batch_size=args.batch_size, cutoff=args.threshold)
File "test.py", line 113, in predict_volume
volume = get_volume_from_patches(p, divs=divs, offset=(0,5,5,5))
File "C:\Users\Administrator\Documents\annamaria\dvn\utils.py", line 211, in get_volume_from_patches
volume4d = np.zeros(new_shape, dtype=patches5d.dtype)
TypeError: 'float' object cannot be interpreted as an integer

I am solving adding to util.py
def get_volume_from_patches(patches5d, divs = (2,2,2,1), offset=(5,5,5,0)): new_shape = [(ps-of*2)*d for ps,of,d in zip(patches5d.shape[-4:],offset,divs)] #Assure the shape is integer new_shape = [int(i) for i in new_shape]