Comments (3)
also the documentation page is quite sparse.
from antspy.
implemented a lot today.. great slice support, single overlay (will extend to multi-overlay soon). still need to do orientation/resampling stuff.
examples:
>>> ## 2D images ##
>>> import ants
>>> img = ants.image_read(ants.get_data('r16'))
>>> ants.plot(img)
>>> overlay = (img.kmeans_segmentation(k=3)['segmentation']==3)*(img.clone())
>>> ants.plot(img, overlay)
>>> ## 3D images ##
>>> import ants
>>> img3d = ants.image_read(ants.get_data('ch2'))
>>> ants.plot(img3d)
>>> ants.plot(img3d, axis=0, nslices=5) # slice numbers
>>> ants.plot(img3d, axis=1, nslices=5) # different axis
>>> ants.plot(img3d, axis=2, nslices=5) # different slices
>>> ants.plot(img3d, nslices=1) # one slice
>>> ants.plot(img3d, slices=(50,70,90)) # absolute slices
>>> ants.plot(img3d, slices=(0.4,0.6,0.8)) # relative slices
>>> ants.plot(img3d, slices=50) # one absolute slice
>>> ants.plot(img3d, slices=0.6) # one relative slice
>>> ## Overlay Example ##
>>> import ants
>>> img = ants.image_read(ants.get_data('ch2'))
>>> overlay = img.clone()
>>> overlay = overlay*(overlay>105.)
>>> ants.plot(img, overlay)
>>> ## cols ###
>>> ants.plot(img, nslices=12, ncol=4)
>>> ants.plot(img, nslices=12, ncol=6)
from antspy.
update: orientation of images when plotted now matches ANTsR, added domain image map, added cropping and quantile scaling, overlay support, white or black background, etc. Closing :)
from antspy.
Related Issues (20)
- partially initialized module 'ants' has no attribute 'image_read' HOT 1
- The impact of image normalization on antspy HOT 3
- `SyNOnly` registration returns non-identity .mat HOT 3
- example for mask + points multi-metric registration? HOT 4
- lib dependencies HOT 2
- vtk path/import issue on Macbook Pro M3 HOT 5
- ants/lib.cpython-311-darwin.so not valid for use in process: library load disallowed by system policy HOT 1
- Error in outputting deformation field and Jacobian determinant HOT 4
- resample_image_to_target / images_to_matrix HOT 9
- How to output and save deformation fields HOT 6
- compose_ants_transforms change HOT 3
- broken b-spline fitting HOT 2
- B-spline curve fitting failures HOT 1
- Ubuntu Python 3.9 installation error (sha256 mismatch) HOT 3
- potential bug: reference leak when torch is loaded and a function errors HOT 1
- ants.iMath_histogram_equalization HOT 2
- 有没有GPU加速版本的..... HOT 1
- File errors in `ants` folder under home directory crashes ANTsPyx HOT 4
- Encountering the error "RuntimeError: Registration failed with error code 1", when MRA images and T1-weighted images are co-registered with "SyN" HOT 11
- ANTsPy crashes Python when registering two images HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antspy.