InsightSoftwareConsortium / InsightSoftwareConsortium/ITKSphinxExamples

VectorImage Python example

Đang mở
#121 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Good first issue
Ngôn ngữ chính
Jupyter Notebook
Star
59
Fork
70
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
12

Mô tả

Transferred from https://github.com/InsightSoftwareConsortium/ITK/issues/548 :

### Description

An example of how to read and write an Image with an unknown number of Components will be great. The VectorImage is wrapped in itk python and it works great but there is no usage example.

### Expected behavior

An example at the ITKExamples would be great.

### Actual behavior

There is no example of this feature.

### Additional Information

```
Dimension = 3
ComponentType = itk.ctype('float')
OutputImageType = itk.VectorImage[ComponentType, Dimension]

out_img = OutputImageType.New()
out_img.SetNumberOfComponentsPerPixel(40)

size = itk.Size[Dimension]()
size.Fill(64)

index = itk.Index[Dimension]()
index.Fill(0)

RegionType = itk.ImageRegion[Dimension]
region = RegionType()
region.SetIndex(index)
region.SetSize(size)

out_img.SetRegions(region)
out_img.SetDirection(img.GetDirection())
out_img.SetOrigin(img.GetOrigin())
out_img.SetSpacing(img.GetSpacing())
out_img.Allocate()
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.