Giter VIP home page Giter VIP logo

healthy-notebooks's People

Contributors

vincent1bt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

healthy-notebooks's Issues

Mask, Crop and PAd for nii files

@vincent1bt Thanks for sharing your code tutorial.

I work with nii ct files.

With your code, I have been able to convert into hu and window the nii files fine.

But the mask, pad and crop just doesn't work. Any reason for this?

Masking output on regular and HU file
image

Cropping output on regular and HU file
image

Padding output on regular and HU file
image

I supply a single axial nii array slice to the functions for comparion and they don't work. Please help!

resampled_image display issue

Followed the steps explained in notebook

I would like to know whay my resampled_image space showing (302, 302, 0). I believe that migh t be reason it's not displaying in plt.imshow

resampled_image = resample(first_image, image_thickness, pixel_spacing)

array([], shape=(302, 302, 0), dtype=uint16)

np.squeeze(resampled_image).shape
(302, 302, 0)

plt.imshow(resampled_image)


TypeError Traceback (most recent call last)
in
----> 1 plt.imshow(resampled_image)

~/anaconda3/lib/python3.7/site-packages/matplotlib/pyplot.py in imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, data, **kwargs)
2681 filternorm=filternorm, filterrad=filterrad, imlim=imlim,
2682 resample=resample, url=url, **({"data": data} if data is not
-> 2683 None else {}), **kwargs)
2684 sci(__ret)
2685 return __ret

~/anaconda3/lib/python3.7/site-packages/matplotlib/init.py in inner(ax, data, *args, **kwargs)
1599 def inner(ax, *args, data=None, **kwargs):
1600 if data is None:
-> 1601 return func(ax, *map(sanitize_sequence, args), **kwargs)
1602
1603 bound = new_sig.bind(ax, *args, **kwargs)

~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
367 f"%(removal)s. If any parameter follows {name!r}, they "
368 f"should be pass as keyword, not positionally.")
--> 369 return func(*args, **kwargs)
370
371 return wrapper

~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
367 f"%(removal)s. If any parameter follows {name!r}, they "
368 f"should be pass as keyword, not positionally.")
--> 369 return func(*args, **kwargs)
370
371 return wrapper

~/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)
5669 resample=resample, **kwargs)
5670
-> 5671 im.set_data(X)
5672 im.set_alpha(alpha)
5673 if im.get_clip_path() is None:

~/anaconda3/lib/python3.7/site-packages/matplotlib/image.py in set_data(self, A)
688 or self._A.ndim == 3 and self._A.shape[-1] in [3, 4]):
689 raise TypeError("Invalid shape {} for image data"
--> 690 .format(self._A.shape))
691
692 if self._A.ndim == 3:

TypeError: Invalid shape (302, 302, 0) for image data

Sample data

Hi Vincent,

Could you share the sample data of AD.ipynb?

ad-2d.zip
cn-2d.zip

It would be nice to run it on Collab.

Thanks and happy holidays

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.