Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 01697a3b authored by MALANDAIN Gregoire's avatar MALANDAIN Gregoire
Browse files

remove some unecessary test

parent c307f35e
No related branches found
No related tags found
No related merge requests found
......@@ -149,30 +149,25 @@ namespace vt {
std::string proc = "copy_img_to_py_array";
py::object o;
if (img.dims() != 1) {
std::cerr << proc << ": is not implemented for vectorial images" << std::endl;
}
else {
std::type_index type = img.type();
if (type == std::type_index(typeid(double))) {
o = _copy_img_to_py_array<double>(img);
} else if (type == std::type_index(typeid(unsigned char))) {
o = _copy_img_to_py_array<unsigned char>(img);
} else if (type == std::type_index(typeid(char))) {
o = _copy_img_to_py_array<char>(img);
} else if (type == std::type_index(typeid(unsigned short int))) {
o = _copy_img_to_py_array<unsigned short>(img);
} else if (type == std::type_index(typeid(short int))) {
o = _copy_img_to_py_array<short>(img);
} else if (type == std::type_index(typeid(unsigned int))) {
o = _copy_img_to_py_array<unsigned int>(img);
} else if (type == std::type_index(typeid(int))) {
o = _copy_img_to_py_array<int>(img);
} else if (type == std::type_index(typeid(float))) {
o = _copy_img_to_py_array<float>(img);
} else {
std::cerr << proc << ": is not implemented for this type "<< std::endl;
}
std::type_index type = img.type();
if (type == std::type_index(typeid(double))) {
o = _copy_img_to_py_array<double>(img);
} else if (type == std::type_index(typeid(unsigned char))) {
o = _copy_img_to_py_array<unsigned char>(img);
} else if (type == std::type_index(typeid(char))) {
o = _copy_img_to_py_array<char>(img);
} else if (type == std::type_index(typeid(unsigned short int))) {
o = _copy_img_to_py_array<unsigned short>(img);
} else if (type == std::type_index(typeid(short int))) {
o = _copy_img_to_py_array<short>(img);
} else if (type == std::type_index(typeid(unsigned int))) {
o = _copy_img_to_py_array<unsigned int>(img);
} else if (type == std::type_index(typeid(int))) {
o = _copy_img_to_py_array<int>(img);
} else if (type == std::type_index(typeid(float))) {
o = _copy_img_to_py_array<float>(img);
} else {
std::cerr << proc << ": is not implemented for this type "<< std::endl;
}
return o;
}
......@@ -265,31 +260,27 @@ namespace vt {
std::string proc = "mv_img_pointer_to_py_array";
py::object o;
if (img.dims() != 1) {
std::cerr << proc << ": is not implemented for vectorial images" << std::endl;
}
else {
std::type_index type = img.type();
if (type == std::type_index(typeid(double))) {
o = _mv_img_pointer_to_py_array<double>(img);
} else if (type == std::type_index(typeid(unsigned char))) {
o = _mv_img_pointer_to_py_array<unsigned char>(img);
} else if (type == std::type_index(typeid(char))) {
o = _mv_img_pointer_to_py_array<char>(img);
} else if (type == std::type_index(typeid(unsigned short int))) {
o = _mv_img_pointer_to_py_array<unsigned short>(img);
} else if (type == std::type_index(typeid(short int))) {
o = _mv_img_pointer_to_py_array<short>(img);
} else if (type == std::type_index(typeid(unsigned int))) {
o = _mv_img_pointer_to_py_array<unsigned int>(img);
} else if (type == std::type_index(typeid(int))) {
o = _mv_img_pointer_to_py_array<int>(img);
} else if (type == std::type_index(typeid(float))) {
o = _mv_img_pointer_to_py_array<float>(img);
} else {
std::cerr << proc << ": is not implemented for this type " << std::endl;
}
std::type_index type = img.type();
if (type == std::type_index(typeid(double))) {
o = _mv_img_pointer_to_py_array<double>(img);
} else if (type == std::type_index(typeid(unsigned char))) {
o = _mv_img_pointer_to_py_array<unsigned char>(img);
} else if (type == std::type_index(typeid(char))) {
o = _mv_img_pointer_to_py_array<char>(img);
} else if (type == std::type_index(typeid(unsigned short int))) {
o = _mv_img_pointer_to_py_array<unsigned short>(img);
} else if (type == std::type_index(typeid(short int))) {
o = _mv_img_pointer_to_py_array<short>(img);
} else if (type == std::type_index(typeid(unsigned int))) {
o = _mv_img_pointer_to_py_array<unsigned int>(img);
} else if (type == std::type_index(typeid(int))) {
o = _mv_img_pointer_to_py_array<int>(img);
} else if (type == std::type_index(typeid(float))) {
o = _mv_img_pointer_to_py_array<float>(img);
} else {
std::cerr << proc << ": is not implemented for this type " << std::endl;
}
return o;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment