|
a |
|
b/docs/other/ANTsR_Comparison.md |
|
|
1 |
|
|
|
2 |
```R |
|
|
3 |
library(ANTsR) |
|
|
4 |
img <- antsImageRead( getANTsRData("r16") , 2 ) |
|
|
5 |
img <- resampleImage( img, c(64,64), 1, 0 ) |
|
|
6 |
mask <- getMask(img) |
|
|
7 |
segs1 <- atropos( a = img, m = '[0.2,1x1]', c = '[2,0]', i = 'kmeans[3]', x = mask ) |
|
|
8 |
``` |
|
|
9 |
|
|
|
10 |
```python |
|
|
11 |
import ants |
|
|
12 |
img = ants.image_read(ants.get_ants_data('r16')) |
|
|
13 |
img = ants.resample_image(img, (64,64), 1, 0) |
|
|
14 |
mask = ants.get_mask(img) |
|
|
15 |
ants.atropos(a = img, m = '[0.2,1x1]', c = '[2,0]', i = 'kmeans[3]', x = mask ) |
|
|
16 |
``` |