Skip to content

Commit 5066553

Browse files
committed
BUG: RGB images could not return number of components
1 parent 3f962d8 commit 5066553

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ants/core/ants_image_io.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ def from_numpy(
8282
image direction
8383
8484
has_components : boolean
85-
whether the image has components
85+
whether the image has vector components.
86+
87+
is_rgb : boolean
88+
whether the image is RGB. This implies has_components=True.
8689
8790
Returns
8891
-------

src/antsImage.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ void local_antsImage(nb::module_ &m) {
108108
m.def("getComponents", &getComponents<itk::VectorImage<double,2>>);
109109
m.def("getComponents", &getComponents<itk::VectorImage<double,3>>);
110110
m.def("getComponents", &getComponents<itk::VectorImage<double,4>>);
111+
m.def("getComponents", &getComponents<itk::Image<itk::RGBPixel<unsigned char>,2>>);
112+
m.def("getComponents", &getComponents<itk::Image<itk::RGBPixel<unsigned char>,3>>);
111113

112114
m.def("getShape", &getShape<itk::Image<unsigned char,2>>);
113115
m.def("getShape", &getShape<itk::Image<unsigned char,3>>);

0 commit comments

Comments
 (0)