Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slice indices must be integers or None or have an __index__ method #12

Open
ShibaPrasad opened this issue Dec 6, 2019 · 0 comments
Open

Comments

@ShibaPrasad
Copy link

ShibaPrasad commented Dec 6, 2019

Hi
trying to reproduce the result.
As "from scipy.misc import imresize" can't be used any more .... I am trying to using
from skimage.transform import resize.

changes

lungs[:img_size, :img_size] = imresize(saggital(t_img), [img_size, img_size]) * 1. / 256

mask[:img_size, :img_size][imresize(saggital(pred[i]), [img_size, img_size]) > 128] = 1

gt_mask[:img_size, :img_size][imresize(saggital(y[i][..., 1]), [img_size, img_size]) > 128] = 1

lungs[:img_size, :img_size] = resize(saggital(t_img), [img_size, img_size]) * 1. / 256
mask[:img_size, :img_size][resize(saggital(pred[i]), [img_size, img_size]) > 128] = 1
gt_mask[:img_size, :img_size][resize(saggital(y[i][..., 1]), [img_size, img_size]) > 128] = 1

got below error:
t_img = exposure.rescale_intensity(nib.load(path + df.ix[i]['path']).get_data(), out_range=(0, 1))
Traceback (most recent call last):
File "/user/iibi/skuanar/Downloads/lung-segmentation-3d/lung-segmentation-3d-master/inference.py", line 101, in
lungs[yy * img_size: (yy + 1) * img_size, xx * img_size: (xx + 1) * img_size] = t_img[:, :, -zz]
TypeError: slice indices must be integers or None or have an index method

@ShibaPrasad ShibaPrasad changed the title image resize slice indices must be integers or None or have an __index__ method Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant