From 5750fd7f99324825b5ee2dd57cf960aa9c5a31c3 Mon Sep 17 00:00:00 2001 From: Wim Pomp Date: Fri, 12 Sep 2025 18:03:24 +0200 Subject: [PATCH] Now build SimpleITK into static libs and use (auto)cxx. --- .gitignore | 3 + .gitmodules | 3 + Cargo.toml | 29 +- LICENSE-APACHE => LICENSE | 0 LICENSE-MIT | 23 - README.md | 51 +- SimpleITK | 1 + build.rs | 148 +- cpp/CMakeLists.txt | 9 - cpp/sitk_adapter.cxx | 476 --- cxx/ffi_extra.cxx | 58 + cxx/ffi_extra.h | 20 + merged_lib/CMakeLists.txt | 14 + src/autocxx-ffi-default-gen.rs | 7130 ++++++++++++++++++++++++++++++++ src/lib.rs | 564 +-- src/registration.rs | 645 +++ src/sys.rs | 362 -- 17 files changed, 8110 insertions(+), 1426 deletions(-) create mode 100644 .gitmodules rename LICENSE-APACHE => LICENSE (100%) delete mode 100644 LICENSE-MIT create mode 160000 SimpleITK delete mode 100644 cpp/CMakeLists.txt delete mode 100644 cpp/sitk_adapter.cxx create mode 100644 cxx/ffi_extra.cxx create mode 100644 cxx/ffi_extra.h create mode 100644 merged_lib/CMakeLists.txt create mode 100644 src/autocxx-ffi-default-gen.rs create mode 100644 src/registration.rs delete mode 100644 src/sys.rs diff --git a/.gitignore b/.gitignore index 919a5d6..a4c25e3 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,6 @@ docs/_build/ *.nii *.tif TransformParameters* +/cxx/CMakeLists.txt +/cxx/cmake-build-debug/ +/src/autocxx-ffi-default-gen_unfmt.rs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..98d7b7e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "SimpleITK"] + path = SimpleITK + url = https://github.com/SimpleITK/SimpleITK.git diff --git a/Cargo.toml b/Cargo.toml index e98959a..5fd2a5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "sitk-registration-sys" -version = "2025.3.2" +version = "0.2.0" edition = "2024" -license = "MIT OR Apache-2.0" +license = "Apache-2.0" description = "register and interpolate images" -rust-version = "1.85.0" +rust-version = "1.85.1" authors = ["Wim Pomp "] homepage = "https://github.com/wimpomp/sitk-registration-sys" repository = "https://github.com/wimpomp/sitk-registration-sys" @@ -12,23 +12,32 @@ documentation = "https://docs.rs/sitk-registration-sys" readme = "README.md" keywords = ["registration", "affine", "bspline", "transform"] categories = ["multimedia::images", "science"] +exclude = ["SimpleITK/Testing/*", "SimpleITK/Examples/*", "SimpleITK/Wrapping/*"] [lib] name = "sitk_registration_sys" crate-type = ["cdylib", "rlib"] [dependencies] -anyhow = "1.0.97" -libc = "0.2.170" +anyhow = "1.0.99" +autocxx = "0.30.0" +cxx = "1.0.183" +link-cplusplus = "1.0.12" ndarray = "0.16.1" num = "0.4.3" -one_at_a_time_please = "1.0.1" -serde = { version = "1.0.218", features = ["derive"] } +serde = { version = "1.0.219", features = ["derive"] } serde_yaml = "0.9.33" +tempfile = "3.22.0" [build-dependencies] +autocxx-build = "0.30.0" +cc = "1.2.36" cmake = "0.1.54" -git2 = "0.20.0" +regex = "1.11.2" -[dev-dependencies] -tempfile = "3.18.0" \ No newline at end of file +[profile.dev] +lto = true +strip = "symbols" + +[features] +sitk_no_build = [] # do not build all the C++ stuff, just use the rust code to make docs etc. diff --git a/LICENSE-APACHE b/LICENSE similarity index 100% rename from LICENSE-APACHE rename to LICENSE diff --git a/LICENSE-MIT b/LICENSE-MIT deleted file mode 100644 index 31aa793..0000000 --- a/LICENSE-MIT +++ /dev/null @@ -1,23 +0,0 @@ -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index bcebcb5..a2ef045 100644 --- a/README.md +++ b/README.md @@ -2,30 +2,47 @@ This crate does two things: - find an affine transform or translation that transforms one image into the other -- use bpline or nearest neighbor interpolation to apply a transformation to an image +- use bspline or nearest neighbor interpolation to apply a transformation to an image To do this, [SimpleITK](https://github.com/SimpleITK/SimpleITK.git), which is written in -C++, is used. An adapter library is created to expose the required functionality in SimpleITK -in a shared library. Because of this, compilation of this crate requires quite some time, as -wel as cmake. +C++, is used. An adapter library is created using [autocxx](https://crates.io/crates/autocxx) +to expose the required functionality in SimpleITK. Because of this, compilation of this crate +requires quite some time, several GB of memory, up to 50 GB of hard disk space, as well as +cmake, a C++ compiler, llvm and git. Use at your own risk! ## Examples ### Registration ``` - let image_a = (some Array2); - let iameg_b = (some transformed Array2); - let transform = Transform::register_affine(image_a.view(), image_b.view())?; - println!("transform: {:#?}", transform); +use ndarray::Array2; +use sitk_registration_sys::registration::{AffineTransform, julia_image}; + +let j = julia_image(0f32, 0f32).unwrap(); +let shape = j.shape(); +let origin = [ + ((shape[1] - 1) as f64) / 2f64, + ((shape[0] - 1) as f64) / 2f64, +]; +let s = AffineTransform::new([1.2, 0., 0., 1., 5., 7.], origin, [shape[0], shape[1]]); +let k: Array2<_> = s.transform_image_bspline(j.view()).unwrap().into(); +let t = AffineTransform::register_affine(j.view(), k.view()).unwrap().inverse().unwrap(); +let d = (t.matrix() - s.matrix()).powi(2).sum(); +assert!(d < 0.025, "d: {}, t: {:?}", d, t.parameters); ``` ### Interpolation -``` - let image = (Some Array2); - let shape = image.shape(); - let origin = [ - ((shape[1] - 1) as f64) / 2f64, - ((shape[0] - 1) as f64) / 2f64, - ]; - let transform = Transform::new([1.2, 0., 0., 1., 10., 0.], origin, [shape[0], shape[1]]); - let transformed_image = transform.transform_image_bspline(image.view())?; +``` +use ndarray::Array2; +use sitk_registration_sys::registration::{AffineTransform, julia_image}; + +let j = julia_image(-120f32, 10f32).unwrap(); +let k = julia_image(0f32, 0f32).unwrap(); +let shape = j.shape(); +let origin = [ + ((shape[1] - 1) as f64) / 2f64, + ((shape[0] - 1) as f64) / 2f64, +]; +let transform = AffineTransform::new([1., 0., 0., 1., 120., -10.], origin, [shape[0], shape[1]]); +let n: Array2<_> = transform.transform_image_bspline(j.view()).unwrap().into(); +let d = (k.mapv(|x| x as f64) - n.mapv(|x| x as f64)).powi(2).sum(); +assert!(d <= (shape[0] * shape[1]) as f64); ``` \ No newline at end of file diff --git a/SimpleITK b/SimpleITK new file mode 160000 index 0000000..f0254cc --- /dev/null +++ b/SimpleITK @@ -0,0 +1 @@ +Subproject commit f0254cccec90245c3305cfb6834d2912ebe0e015 diff --git a/build.rs b/build.rs index c64aa88..d672937 100644 --- a/build.rs +++ b/build.rs @@ -1,61 +1,99 @@ -use cmake::Config; -use git2::Repository; -use std::ffi::OsStr; +use std::env; +use std::error::Error; +use std::fs; +use std::io::{Read, Write}; use std::path::PathBuf; +use std::process::Command; -fn main() { - if std::env::var("DOCS_RS").is_err() { - let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR is undefined")); - let mut target_dir = out_dir.clone(); - while target_dir.file_name() != Some(OsStr::new("target")) { - if !target_dir.pop() { - panic!("Could not find target directory"); - } - } +fn main() -> Result<(), Box> { + if env::var("DOCS_RS").is_err() & !cfg!(feature = "sitk_no_build") { + let sitk_dir = PathBuf::from("SimpleITK"); - let sitk_dir = if let Some(d) = target_dir.parent() { - d.join("sitk").to_path_buf() - } else { - target_dir.join("sitk") - }; - if !sitk_dir.exists() { - Repository::clone("https://github.com/SimpleITK/SimpleITK.git", &sitk_dir) - .expect("unable to clone sitk"); - } - - let sitk_build_dir = sitk_dir.join("build"); - if !sitk_build_dir.exists() { - println!("cargo::warning=Simple ITK; this will take a long time..."); - Config::new(sitk_dir.join("SuperBuild")) - .out_dir(&sitk_dir) - .no_build_target(true) - .define("BUILD_TESTING", "OFF") - .define("WRAP_CSHARP", "OFF") - .define("WRAP_JAVA", "OFF") - .define("WRAP_LUA", "OFF") - .define("WRAP_R", "OFF") - .define("WRAP_RUBY", "OFF") - .define("WRAP_TCL", "OFF") - .define("WRAP_PYTHON", "OFF") - .define("WRAP_DEFAULT", "OFF") - .define("SimpleITK_USE_ELASTIX", "ON") - .build(); - } - println!( - "cargo::rustc-env=CMAKE_INSTALL_PREFIX={}", - out_dir.display() - ); - let path = Config::new("cpp") - .very_verbose(true) - .define("Elastix_DIR", sitk_build_dir.join("Elastix-build")) - .define("ITK_DIR", sitk_build_dir.join("ITK-build")) - .define("SimpleITK_DIR", sitk_build_dir.join("SimpleITK-build")) - .define("CMAKE_INSTALL_PREFIX", out_dir) + // use cmake to compile the SimpleITK C++ code + let dst = cmake::Config::new(sitk_dir.join("SuperBuild")) + .no_build_target(true) + .define("BUILD_EXAMPLES", "OFF") + .define("BUILD_TESTING", "OFF") + .define("WRAP_CSHARP", "OFF") + .define("WRAP_JAVA", "OFF") + .define("WRAP_LUA", "OFF") + .define("WRAP_R", "OFF") + .define("WRAP_RUBY", "OFF") + .define("WRAP_TCL", "OFF") + .define("WRAP_PYTHON", "OFF") + .define("WRAP_DEFAULT", "OFF") + .define("SimpleITK_USE_ELASTIX", "ON") .build(); - println!("cargo::rustc-link-arg=-Wl,-rpath,{}", path.display()); - println!("cargo::rustc-link-search={}", path.join("build").display()); - println!("cargo::rustc-link-lib=dylib=sitk_adapter"); - println!("cargo::rerun-if-changed=build.rs"); - println!("cargo::rerun-if-changed=cpp"); + + // there does not seem to be any way to tell cargo to group libraries together + // when linking, so we group all objects together in three big static libraries + let merged_lib = cmake::Config::new("merged_lib") + .out_dir(dst.join("merged_lib")) + .no_build_target(true) + .build(); + + let mut b = autocxx_build::Builder::new( + "src/lib.rs", + ["cxx", dst.join("include/SimpleITK-3.0").to_str().unwrap()], + ) + .extra_clang_args(&["-std=c++17"]) + .build()?; + b.flag("-std=c++17").compile("sitk_autocxx"); + + cc::Build::new() + .include(dst.join("include/SimpleITK-3.0")) + .file("cxx/ffi_extra.cxx") + .compile("sitk_ffi_extra"); + + let cxx_file = dst.join("autocxx-build-dir/rs/autocxx-ffi-default-gen.rs"); + let mut cxx = String::new(); + let _ = fs::File::open(&cxx_file)?.read_to_string(&mut cxx)?; + let ra = regex::Regex::new(r"\s*(#|\s(fn|use|mod|pub|struct|enum)\s)\s*")?; + let rb = regex::Regex::new(r"\s(;)\s")?; + let pointer = regex::Regex::new(r"pub type pointer = root\s+::\s+pointer;")?; + let cpp_string = regex::Regex::new(r"pub mod simple \{")?; + let rb_tree = regex::Regex::new( + r"pub type _Rb_tree_insert_return_type = root :: std :: _Node_insert_return < _Iterator , _NodeHandle >;", + )?; + + { + let mut f = fs::OpenOptions::new() + .write(true) + .truncate(true) + .open(&cxx_file)?; + write!( + f, + "#[allow(unused_imports)]\n#[allow(unsafe_op_in_unsafe_fn)]\n#[allow(clippy::missing_safety_doc)]\n" + )?; + let cxx = ra.replace_all(&cxx, "\n$1"); + let cxx = rb.replace_all(&cxx, "$1\n"); + let cxx = pointer.replace_all(&cxx, r"// $0"); + let cxx = rb_tree.replace_all(&cxx, r"// $0"); + let cxx = + cpp_string.replace_all(&cxx, "pub mod simple {\nuse crate::ffi::ToCppString;"); + write!(f, "{}", cxx)?; + } + fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen_unfmt.rs")?; + Command::new("rustfmt").arg(&cxx_file).status()?; + fs::copy(dst.join(&cxx_file), "src/autocxx-ffi-default-gen.rs")?; + + println!("cargo:warning=merged_lib={}", merged_lib.join("build").display()); + println!("cargo:rustc-link-search={}", merged_lib.join("build").display()); + println!("cargo:rustc-link-lib=static=sitk_ffi_extra"); + println!("cargo:rustc-link-lib=static=sitk"); + println!("cargo:rustc-link-lib=static=elastix"); + println!("cargo:rustc-link-lib=static=itk"); + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-changed=src/lib.rs"); + println!("cargo:rerun-if-changed=cxx/ffi_extra.h"); + println!("cargo:rerun-if-changed=cxx/ffi_extra.cxx"); + } else { + let dst = PathBuf::from(env::var("OUT_DIR")?); + fs::create_dir_all(dst.join("autocxx-build-dir/rs"))?; + fs::copy( + "src/autocxx-ffi-default-gen.rs", + dst.join("autocxx-build-dir/rs/autocxx-ffi-default-gen.rs"), + )?; } + Ok(()) } diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt deleted file mode 100644 index 6a7e7ab..0000000 --- a/cpp/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.16.3) -project(sitk_adapter) -set(ENV{Elastix_DIR} "../sitk/build/Elastix-build" ) -set(ENV{ITK_DIR} "../sitk/build/ITK-build" ) -set(ENV{SimpleITK_DIR} "~../sitk/build/SimpleITK-build" ) -find_package(SimpleITK) -add_library(sitk_adapter SHARED sitk_adapter.cxx) -target_link_libraries (sitk_adapter ${SimpleITK_LIBRARIES}) -install(TARGETS sitk_adapter DESTINATION .) diff --git a/cpp/sitk_adapter.cxx b/cpp/sitk_adapter.cxx deleted file mode 100644 index b65d997..0000000 --- a/cpp/sitk_adapter.cxx +++ /dev/null @@ -1,476 +0,0 @@ -#include -#include -#include -#include - -namespace sitk = itk::simple; - -using namespace std; - - -std::string gen_random(const int len) { - static const char alphanum[] = - "0123456789" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz"; - std::string tmp_s; - tmp_s.reserve(len); - - for (int i = 0; i < len; ++i) { - tmp_s += alphanum[rand() % (sizeof(alphanum) - 1)]; - } - - return tmp_s; -} - - -template -sitk::Image make_image( - unsigned int width, - unsigned int height, - T* image, - sitk::PixelIDValueEnum id -) { - sitk::Image im(width, height, id); - if (id == sitk::PixelIDValueEnum::sitkUInt8) { - uint8_t* b = im.GetBufferAsUInt8(); - memcpy(b, image, width * height); - } else if (id == sitk::PixelIDValueEnum::sitkInt8) { - int8_t* b = im.GetBufferAsInt8(); - memcpy(b, image, width * height); - } else if (id == sitk::PixelIDValueEnum::sitkUInt16) { - uint16_t* b = im.GetBufferAsUInt16(); - memcpy(b, image, width * height * 2); - } else if (id == sitk::PixelIDValueEnum::sitkInt16) { - int16_t* b = im.GetBufferAsInt16(); - memcpy(b, image, width * height * 2); - } else if (id == sitk::PixelIDValueEnum::sitkUInt32) { - uint32_t* b = im.GetBufferAsUInt32(); - memcpy(b, image, width * height * 4); - } else if (id == sitk::PixelIDValueEnum::sitkInt32) { - int32_t* b = im.GetBufferAsInt32(); - memcpy(b, image, width * height * 4); - } else if (id == sitk::PixelIDValueEnum::sitkUInt64) { - uint64_t* b = im.GetBufferAsUInt64(); - memcpy(b, image, width * height * 8); - } else if (id == sitk::PixelIDValueEnum::sitkInt64) { - int64_t* b = im.GetBufferAsInt64(); - memcpy(b, image, width * height * 8); - } else if (id == sitk::PixelIDValueEnum::sitkFloat32) { - float* b = im.GetBufferAsFloat(); - memcpy(b, image, width * height * 4); - } else if (id == sitk::PixelIDValueEnum::sitkFloat64) { - double* b = im.GetBufferAsDouble(); - memcpy(b, image, width * height * 8); - } - return im; -} - - -sitk::Image -interp( - double* transform, - double* origin, - sitk::Image image, - bool bspline_or_nn -) { - try { - vector matrix = {transform[0], transform[1], transform[2], transform[3]}; - vector translation = {transform[4], transform[5]}; - vector ori = {origin[0], origin[1]}; - sitk::AffineTransform t(matrix, translation, ori); - sitk::InterpolatorEnum interpolator = (bspline_or_nn == false) ? sitk::sitkBSpline : sitk::sitkNearestNeighbor; - image = sitk::Resample(image, t, interpolator); - return image; - } catch (const std::exception &exc) { - cerr << exc.what(); - return image; - } -} - - -extern "C" void -interp_u8( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - uint8_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkUInt8); - im = interp(transform, origin, im, bspline_or_nn); - uint8_t* c = im.GetBufferAsUInt8(); - memcpy(*image, c, width * height); -} - -extern "C" void -interp_i8( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - int8_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkInt8); - im = interp(transform, origin, im, bspline_or_nn); - int8_t* c = im.GetBufferAsInt8(); - memcpy(*image, c, width * height); -} - -extern "C" void -interp_u16( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - uint16_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkUInt16); - im = interp(transform, origin, im, bspline_or_nn); - uint16_t* c = im.GetBufferAsUInt16(); - memcpy(*image, c, width * height * 2); -} - -extern "C" void -interp_i16( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - int16_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkInt16); - im = interp(transform, origin, im, bspline_or_nn); - int16_t* c = im.GetBufferAsInt16(); - memcpy(*image, c, width * height * 2); -} - -extern "C" void -interp_u32( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - uint32_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkUInt32); - im = interp(transform, origin, im, bspline_or_nn); - uint32_t* c = im.GetBufferAsUInt32(); - memcpy(*image, c, width * height * 4); -} - -extern "C" void -interp_i32( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - int32_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkInt32); - im = interp(transform, origin, im, bspline_or_nn); - int32_t* c = im.GetBufferAsInt32(); - memcpy(*image, c, width * height * 4); -} - -extern "C" void -interp_u64( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - uint64_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkUInt64); - im = interp(transform, origin, im, bspline_or_nn); - uint64_t* c = im.GetBufferAsUInt64(); - memcpy(*image, c, width * height * 8); -} - -extern "C" void -interp_i64( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - int64_t** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkInt64); - im = interp(transform, origin, im, bspline_or_nn); - int64_t* c = im.GetBufferAsInt64(); - memcpy(*image, c, width * height * 8); -} - -extern "C" void -interp_f32( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - float** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkFloat32); - im = interp(transform, origin, im, bspline_or_nn); - float* c = im.GetBufferAsFloat(); - memcpy(*image, c, width * height * 4); -} - -extern "C" void -interp_f64( - unsigned int width, - unsigned int height, - double* transform, - double* origin, - double** image, - bool bspline_or_nn -) { - sitk::Image im = make_image(width, height, *image, sitk::PixelIDValueEnum::sitkFloat64); - im = interp(transform, origin, im, bspline_or_nn); - double* c = im.GetBufferAsDouble(); - memcpy(*image, c, width * height * 8); -} - - -void -reg2( - sitk::Image fixed, - sitk::Image moving, - bool t_or_a, - double** transform -) { - try { - string kind = (t_or_a == false) ? "translation" : "affine"; - - sitk::ImageRegistrationMethod R; - R.SetMetricAsMattesMutualInformation(); - const double maxStep = 4.0; - const double minStep = 0.01; - const unsigned int numberOfIterations = 200; - const double relaxationFactor = 0.5; - // R.SetOptimizerAsLBFGSB(maxStep, minStep, numberOfIterations, relaxationFactor); - R.SetOptimizerAsRegularStepGradientDescent(maxStep, minStep, numberOfIterations, relaxationFactor); - // R.SetOptimizerAsLBFGS2(); - vector matrix = {1.0, 0.0, 0.0, 1.0}; - vector translation = {0., 0.}; - vector origin = {399.5, 299.5}; - R.SetInitialTransform(sitk::AffineTransform(matrix, translation, origin)); - R.SetInterpolator(sitk::sitkBSpline); - sitk::Transform outTx = R.Execute(fixed, moving); - vector t = outTx.GetParameters(); - for (int i = 0; i < t.size(); i++) { - cout << t[i] << " "; - (*transform)[i] = t[i]; - } - } catch (const std::exception &exc) { - cerr << exc.what(); - } -} - - -void -reg( - sitk::Image fixed, - sitk::Image moving, - bool t_or_a, - double** transform -) { - try { - string kind = (t_or_a == false) ? "translation" : "affine"; -// std::filesystem::path output_path = std::filesystem::temp_directory_path() / gen_random(12); -// std::filesystem::create_directory(output_path); - std::filesystem::path output_path = std::filesystem::temp_directory_path(); - - sitk::ElastixImageFilter tfilter = sitk::ElastixImageFilter(); - tfilter.LogToConsoleOff(); - tfilter.LogToFileOff(); - tfilter.SetLogToFile(false); - tfilter.SetFixedImage(fixed); - tfilter.SetMovingImage(moving); - tfilter.SetParameterMap(sitk::GetDefaultParameterMap(kind)); - tfilter.SetParameter("WriteResultImage", "false"); - tfilter.SetOutputDirectory(output_path); - tfilter.Execute(); - sitk::ElastixImageFilter::ParameterMapType parameter_map = tfilter.GetTransformParameterMap(0); - for (sitk::ElastixImageFilter::ParameterMapType::iterator parameter = parameter_map.begin(); parameter != parameter_map.end(); ++parameter) { - if (parameter->first == "TransformParameters") { - vector tp = parameter->second; - if (t_or_a == true) { - for (int j = 0; j < tp.size(); j++) { - (*transform)[j] = stod(tp[j]); - } - } else { - (*transform)[0] = 1.0; - (*transform)[1] = 0.0; - (*transform)[2] = 0.0; - (*transform)[3] = 1.0; - for (int j = 0; j < tp.size(); j++) { - (*transform)[j + 4] = stod(tp[j]); - } - } - break; - } - } - } catch (const std::exception &exc) { - cerr << exc.what(); - } -} - - -extern "C" void -register_u8( - unsigned int width, - unsigned int height, - uint8_t** fixed_arr, - uint8_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkUInt8; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_i8( - unsigned int width, - unsigned int height, - int8_t** fixed_arr, - int8_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkInt8; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_u16( - unsigned int width, - unsigned int height, - uint16_t** fixed_arr, - uint16_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkUInt16; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_i16( - unsigned int width, - unsigned int height, - int16_t** fixed_arr, - int16_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkInt16; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_u32( - unsigned int width, - unsigned int height, - uint32_t** fixed_arr, - uint32_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkUInt32; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_i32( - unsigned int width, - unsigned int height, - int32_t** fixed_arr, - int32_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkInt32; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_u64( - unsigned int width, - unsigned int height, - uint64_t** fixed_arr, - uint64_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkUInt64; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_i64( - unsigned int width, - unsigned int height, - int64_t** fixed_arr, - int64_t** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkInt64; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_f32( - unsigned int width, - unsigned int height, - float** fixed_arr, - float** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkFloat32; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} - -extern "C" void -register_f64( - unsigned int width, - unsigned int height, - double** fixed_arr, - double** moving_arr, - bool t_or_a, - double** transform -) { - sitk::PixelIDValueEnum id = sitk::PixelIDValueEnum::sitkFloat64; - sitk::Image fixed = make_image(width, height, *fixed_arr, id); - sitk::Image moving = make_image(width, height, *moving_arr, id); - reg(fixed, moving, t_or_a, transform); -} \ No newline at end of file diff --git a/cxx/ffi_extra.cxx b/cxx/ffi_extra.cxx new file mode 100644 index 0000000..66ff4ab --- /dev/null +++ b/cxx/ffi_extra.cxx @@ -0,0 +1,58 @@ +#include "ffi_extra.h" + +#include +#include +#include +#include +#include + + +std::unique_ptr get_transform_parameter_map(itk::simple::ElastixImageFilter& tfilter, const unsigned int index) { + itk::simple::ElastixImageFilter::ParameterMapType parameter_map = tfilter.GetTransformParameterMap(index); + ParameterMap transform_parameter_map = ParameterMap(parameter_map); + auto ptr = std::make_unique(parameter_map); + return ptr; +} + +std::unique_ptr get_default_parameter_map(const std::string& kind) { + itk::simple::ElastixImageFilter::ParameterMapType parameter_map = itk::simple::GetDefaultParameterMap(kind); + ParameterMap default_parameter_map = ParameterMap(parameter_map); + auto ptr = std::make_unique(default_parameter_map); + return ptr; +} + +void set_parameter_map(itk::simple::ElastixImageFilter& tfilter, const std::unique_ptr& parameter_map) { + tfilter.SetParameterMap(parameter_map->parameters); +}; + +ParameterMap::ParameterMap() = default; +ParameterMap::~ParameterMap() = default; + +ParameterMap::ParameterMap(itk::simple::ElastixImageFilter::ParameterMapType parameter_map) { + this->parameters = std::move(parameter_map); +} + +std::unique_ptr new_parameter_map() { + ParameterMap parameter_map; + auto ptr = std::make_unique(parameter_map); + return ptr; +} + +void ParameterMap::insert(const std::string &key, const std::vector &value) { + this->parameters.emplace(key, value); +} + +std::unique_ptr> ParameterMap::keys() const { + std::vector keys; + for (auto &[key, value] : this->parameters) { + keys.push_back(key); + } + auto ptr = std::make_unique>(keys); + return ptr; +} + +std::unique_ptr> ParameterMap::get(const std::string& key) const { + std::vector value = this->parameters.at(key); + auto ptr = std::make_unique>(value); + return ptr; +} diff --git a/cxx/ffi_extra.h b/cxx/ffi_extra.h new file mode 100644 index 0000000..94c136d --- /dev/null +++ b/cxx/ffi_extra.h @@ -0,0 +1,20 @@ +#pragma once +#include +#include +#include + +class ParameterMap { +public: + itk::simple::ElastixImageFilter::ParameterMapType parameters; + ParameterMap(); + ~ParameterMap(); + explicit ParameterMap(itk::simple::ElastixImageFilter::ParameterMapType parameter_map); + void insert(const std::string &key, const std::vector &value); + [[nodiscard]] std::unique_ptr> get(const std::string& key) const; + [[nodiscard]] std::unique_ptr> keys() const; +}; + +std::unique_ptr new_parameter_map(); +std::unique_ptr get_default_parameter_map(const std::string& kind); +std::unique_ptr get_transform_parameter_map(itk::simple::ElastixImageFilter& tfilter, unsigned int index); +void set_parameter_map(itk::simple::ElastixImageFilter& tfilter, const std::unique_ptr& parameter_map); \ No newline at end of file diff --git a/merged_lib/CMakeLists.txt b/merged_lib/CMakeLists.txt new file mode 100644 index 0000000..422835f --- /dev/null +++ b/merged_lib/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.14.0) +project(merged_lib) + +file(GLOB_RECURSE LIB_SITK ${CMAKE_BINARY_DIR}/../../build/SimpleITK-build/**/*.o) +file(GLOB_RECURSE LIB_ITK ${CMAKE_BINARY_DIR}/../../build/ITK-build/**/*.o) +file(GLOB_RECURSE LIB_ELASTIX ${CMAKE_BINARY_DIR}/../../build/Elastix-build/**/*.o) + +add_library( sitk ${LIB_SITK} ) +add_library( itk ${LIB_ITK} ) +add_library( elastix ${LIB_ELASTIX} ) + +set_target_properties(sitk PROPERTIES LINKER_LANGUAGE CXX) +set_target_properties(itk PROPERTIES LINKER_LANGUAGE CXX) +set_target_properties(elastix PROPERTIES LINKER_LANGUAGE CXX) diff --git a/src/autocxx-ffi-default-gen.rs b/src/autocxx-ffi-default-gen.rs new file mode 100644 index 0000000..123c27d --- /dev/null +++ b/src/autocxx-ffi-default-gen.rs @@ -0,0 +1,7130 @@ +#[allow(unused_imports)] +#[allow(unsafe_op_in_unsafe_fn)] +#[allow(clippy::missing_safety_doc)] +#[allow(non_snake_case)] +#[allow(dead_code)] +#[allow(non_upper_case_globals)] +#[allow(non_camel_case_types)] +#[doc = "Generated using autocxx - do not edit directly"] +#[doc = "@generated"] +mod ffi { + #[doc = r" A trait to be implemented by any type that can be turned"] + #[doc = r" into a C++ string."] + #[doc = r" This trait is generated once per autocxx FFI + mod and each"] + #[doc = r" implementation is incompatible and separate, because each"] + #[doc = r" will + use a function generated independently for each mod"] + #[doc = r" in order to do the actual conversion to a C++ string."] + pub trait ToCppString { + #[doc = r" Convert `self` into a C++ string in a [`cxx::UniquePtr`]."] + fn into_cpp(self) -> cxx::UniquePtr; + } + impl ToCppString for &str { + fn into_cpp(self) -> cxx::UniquePtr { + make_string(self) + } + } + impl ToCppString for String { + fn into_cpp(self) -> cxx::UniquePtr { + make_string(&self) + } + } + impl ToCppString for &String { + fn into_cpp(self) -> cxx::UniquePtr { + make_string(self) + } + } + impl ToCppString for cxx::UniquePtr { + fn into_cpp(self) -> cxx::UniquePtr { + self + } + } + #[doc = "A private + mod containing the bindings generated by `bindgen`. Do not + use the contents directly - the useful parts will be re-exported into the main FFI mod."] + mod bindgen { + #[repr(transparent)] + pub struct __bindgen_marker_Opaque(T); + #[repr(transparent)] + pub struct __bindgen_marker_Reference(T); + #[repr(transparent)] + pub struct __bindgen_marker_RValueReference(T); + #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] + pub mod root { + #[doc = r" If Bindgen could only determine the size and alignment of a"] + #[doc = r" type, it is represented like this."] + #[derive(PartialEq, Copy, Clone, Debug, Hash)] + #[repr(C)] + pub struct __BindgenOpaqueArray(pub [T; N]); + impl Default for __BindgenOpaqueArray { + fn default() -> Self { + Self([::default(); N]) + } + } + #[repr(C)] + pub struct __BindgenUnionField(::std::marker::PhantomData); + impl __BindgenUnionField { + #[inline] + pub const fn new() -> Self { + __BindgenUnionField(::std::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::std::mem::transmute(self) + } + } + impl ::std::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } + } + impl ::std::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + *self + } + } + impl ::std::marker::Copy for __BindgenUnionField {} + impl ::std::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__BindgenUnionField") + } + } + impl ::std::hash::Hash for __BindgenUnionField { + fn hash(&self, _state: &mut H) {} + } + impl ::std::cmp::PartialEq for __BindgenUnionField { + fn eq(&self, _other: &__BindgenUnionField) -> bool { + true + } + } + impl ::std::cmp::Eq for __BindgenUnionField {} + #[allow(unused_imports)] + use self::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + #[doc = "
"] + #[repr(C)] + pub struct Str { + ptr: *mut ::std::os::raw::c_char, + } + #[doc = "
"] + #[repr(C)] + pub struct String { + ptr: *mut ::std::os::raw::c_char, + } + #[doc = "
"] + #[repr(C)] + pub struct Box { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + ptr: *mut T, + } + pub mod std { + #[allow(unused_imports)] + use self::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + #[doc = "
"] + #[repr(C)] + pub struct unique_ptr { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + ptr: *mut T, + } + #[doc = "
"] + #[repr(C)] + pub struct vector { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + ptr: *mut T, + } + #[doc = "
"] + #[repr(C)] + pub struct shared_ptr { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + ptr: *mut T, + } + #[doc = "
"] + #[repr(C)] + pub struct weak_ptr { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, + ptr: *mut T, + } + #[doc = "
"] + #[repr(C)] + pub struct string { + ptr: *mut ::std::os::raw::c_char, + } + #[repr(C)] + pub struct basic_string<_CharT> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>, + _M_dataplus: root::std::basic_string__Alloc_hider, + _M_string_length: root::std::basic_string_size_type, + __bindgen_anon_1: root::std::basic_string__bindgen_ty_2<_CharT>, + } + pub type basic_string__Char_alloc_type = + __bindgen_marker_Opaque>; + pub type basic_string__Alloc_traits = root::__gnu_cxx::__alloc_traits; + pub type basic_string_traits_type<_Traits> = _Traits; + pub type basic_string_value_type = + __bindgen_marker_Opaque>; + pub type basic_string_allocator_type = root::std::basic_string__Char_alloc_type; + pub type basic_string_size_type = + __bindgen_marker_Opaque>; + pub type basic_string_difference_type = + __bindgen_marker_Opaque>; + pub type basic_string_reference = + __bindgen_marker_Opaque>; + pub type basic_string_const_reference = + __bindgen_marker_Opaque>; + pub type basic_string_pointer = + __bindgen_marker_Opaque>; + pub type basic_string_const_pointer = + __bindgen_marker_Opaque>; + pub type basic_string_iterator = + root::__gnu_cxx::__normal_iterator; + pub type basic_string_const_iterator = + root::__gnu_cxx::__normal_iterator; + pub type basic_string_const_reverse_iterator = + root::std::reverse_iterator; + pub type basic_string_reverse_iterator = + root::std::reverse_iterator; + pub type basic_string___const_iterator = root::std::basic_string_const_iterator; + pub type basic_string___sv_type<_CharT> = root::std::basic_string_view<_CharT>; + pub type basic_string__If_sv = root::std::enable_if_t; + #[repr(C)] + pub struct basic_string___sv_wrapper<_CharT> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>, + pub _M_sv: root::std::basic_string___sv_type<_CharT>, + } + #[repr(C)] + pub struct basic_string__Alloc_hider { + pub _M_p: root::std::basic_string_pointer, + } + pub const basic_string__S_local_capacity: root::std::basic_string__bindgen_ty_1 = + basic_string__bindgen_ty_1::_S_local_capacity; + #[repr(i32)] + #[derive(Clone, Hash, PartialEq, Eq)] + pub enum basic_string__bindgen_ty_1 { + _S_local_capacity = 0, + } + #[repr(C)] + pub struct basic_string__bindgen_ty_2<_CharT> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>, + pub _M_local_buf: root::__BindgenUnionField<*mut _CharT>, + pub _M_allocated_capacity: + root::__BindgenUnionField, + pub bindgen_union_field: __bindgen_marker_Opaque, + } + pub type streamoff = ::std::os::raw::c_long; + #[repr(C)] + pub struct fpos<_StateT> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_StateT>>, + _M_off: root::std::streamoff, + _M_state: _StateT, + } + pub type streampos = root::std::fpos; + pub type integral_constant_value_type<_Tp> = _Tp; + pub type integral_constant_type = __bindgen_marker_Opaque; + pub type __bool_constant = __bindgen_marker_Opaque; + pub type true_type = __bindgen_marker_Opaque; + pub type false_type = __bindgen_marker_Opaque; + pub type __enable_if_t = __bindgen_marker_Opaque; + pub type __conditional_type<_Tp> = _Tp; + pub type __conditional_t = __bindgen_marker_Opaque; + #[repr(C)] + pub struct __type_identity { + pub _address: u8, + } + pub type __type_identity_type<_Type> = _Type; + pub mod __detail { + #[allow(unused_imports)] + use self::super::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + } + #[repr(C)] + pub struct __and_ { + pub _address: u8, + } + #[repr(C)] + pub struct is_same { + pub _address: u8, + } + #[repr(C)] + pub struct remove_reference { + pub _address: u8, + } + pub type remove_reference_type<_Tp> = _Tp; + pub type remove_reference_t = root::std::remove_reference; + #[repr(C)] + pub struct make_unsigned { + pub _address: u8, + } + pub type make_unsigned_type = __bindgen_marker_Opaque; + pub type enable_if_t = __bindgen_marker_Opaque; + #[repr(C)] + pub struct __detector { + pub _address: u8, + } + pub type __detector_type<_Default> = _Default; + pub type __detector___is_detected = root::std::false_type; + pub type __detected_or = root::std::__detector; + pub type __detected_or_t = root::std::__detected_or; + #[repr(C)] + pub struct char_traits { + pub _address: u8, + } + #[repr(C)] + pub struct __new_allocator { + pub _address: u8, + } + pub type __new_allocator_value_type<_Tp> = _Tp; + pub type __new_allocator_size_type = usize; + pub type __new_allocator_difference_type = isize; + pub type __new_allocator_pointer<_Tp> = *mut _Tp; + pub type __new_allocator_const_pointer<_Tp> = *const _Tp; + pub type __new_allocator_reference<_Tp> = __bindgen_marker_Reference<*mut _Tp>; + pub type __new_allocator_const_reference<_Tp> = + __bindgen_marker_Reference<*const _Tp>; + #[repr(C)] + pub struct __new_allocator_rebind { + pub _address: u8, + } + pub type __new_allocator_propagate_on_container_move_assignment = + root::std::true_type; + pub type __allocator_base = root::std::__new_allocator; + #[repr(C)] + pub struct allocator { + pub _address: u8, + } + pub type allocator_value_type<_Tp> = _Tp; + pub type allocator_size_type = usize; + pub type allocator_difference_type = isize; + pub type allocator_pointer<_Tp> = *mut _Tp; + pub type allocator_const_pointer<_Tp> = *const _Tp; + pub type allocator_reference<_Tp> = __bindgen_marker_Reference<*mut _Tp>; + pub type allocator_const_reference<_Tp> = __bindgen_marker_Reference<*const _Tp>; + #[repr(C)] + pub struct allocator_rebind { + pub _address: u8, + } + pub type allocator_rebind_other = root::std::allocator; + pub type allocator_propagate_on_container_move_assignment = root::std::true_type; + pub type allocator_is_always_equal = root::std::true_type; + #[repr(C)] + pub struct input_iterator_tag { + pub _address: u8, + } + #[repr(C)] + pub struct forward_iterator_tag { + pub _address: u8, + } + #[repr(C)] + pub struct bidirectional_iterator_tag { + pub _address: u8, + } + #[repr(C)] + pub struct iterator { + pub _address: u8, + } + pub type iterator_iterator_category<_Category> = _Category; + pub type iterator_value_type<_Tp> = _Tp; + pub type iterator_difference_type<_Distance> = _Distance; + pub type iterator_pointer<_Pointer> = _Pointer; + pub type iterator_reference<_Reference> = _Reference; + #[repr(C)] + pub struct __iterator_traits { + pub _address: u8, + } + #[repr(C)] + pub struct iterator_traits { + pub _address: u8, + } + #[repr(C)] + pub struct __undefined { + _unused: [u8; 0], + } + #[repr(C)] + pub struct __get_first_arg { + pub _address: u8, + } + pub type __get_first_arg_type = root::std::__undefined; + #[repr(C)] + pub struct __replace_first_arg { + pub _address: u8, + } + #[repr(C)] + pub struct __ptr_traits_elem { + pub _address: u8, + } + pub type __ptr_traits_elem_t = root::std::__ptr_traits_elem; + pub type __ptr_traits_ptr_to_pointer<_Ptr> = _Ptr; + pub type __ptr_traits_ptr_to_element_type<_Elt> = _Elt; + #[repr(C)] + pub struct __ptr_traits_impl { + pub _address: u8, + } + pub type __ptr_traits_impl___diff_t = + __bindgen_marker_Opaque>; + pub type __ptr_traits_impl___rebind = root::std::__type_identity; + pub type __ptr_traits_impl_pointer<_Ptr> = _Ptr; + pub type __ptr_traits_impl_element_type<_Elt> = _Elt; + pub type __ptr_traits_impl_difference_type = root::std::__detected_or_t; + pub type __ptr_traits_impl_rebind = root::std::__detected_or_t; + #[repr(C)] + pub struct pointer_traits { + pub _address: u8, + } + pub type __ptr_rebind = root::std::pointer_traits; + #[repr(C)] + pub struct reverse_iterator<_Iterator> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>, + current: _Iterator, + } + pub type reverse_iterator___traits_type = root::std::iterator_traits; + pub type reverse_iterator_iterator_type<_Iterator> = _Iterator; + pub type reverse_iterator_pointer = root::std::reverse_iterator___traits_type; + pub type reverse_iterator_difference_type = + root::std::reverse_iterator___traits_type; + pub type reverse_iterator_reference = root::std::reverse_iterator___traits_type; + #[repr(C)] + pub struct unary_function { + pub _address: u8, + } + pub type unary_function_argument_type<_Arg> = _Arg; + pub type unary_function_result_type<_Result> = _Result; + #[repr(C)] + pub struct binary_function { + pub _address: u8, + } + pub type binary_function_first_argument_type<_Arg1> = _Arg1; + pub type binary_function_second_argument_type<_Arg2> = _Arg2; + pub type binary_function_result_type<_Result> = _Result; + #[repr(C)] + pub struct less { + pub _address: u8, + } + #[repr(C)] + pub struct _Select1st { + pub _address: u8, + } + #[repr(C)] + pub struct __pair_base { + pub _address: u8, + } + #[repr(C)] + pub struct pair<_T1, _T2> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_T1>>, + pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<_T2>>, + pub first: _T1, + pub second: _T2, + } + pub type pair_first_type<_T1> = _T1; + pub type pair_second_type<_T2> = _T2; + pub type pair__PCCP = __bindgen_marker_Opaque; + pub type pair__PCCFP = __bindgen_marker_Opaque; + #[repr(C)] + pub struct pair___zero_as_null_pointer_constant { + pub _address: u8, + } + #[repr(C)] + pub struct __allocator_traits_base { + pub _address: u8, + } + #[repr(C)] + pub struct __allocator_traits_base___rebind { + pub _address: u8, + } + pub type __allocator_traits_base___pointer = + __bindgen_marker_Opaque>; + pub type __allocator_traits_base___c_pointer = + __bindgen_marker_Opaque>; + pub type __allocator_traits_base___v_pointer = + __bindgen_marker_Opaque>; + pub type __allocator_traits_base___cv_pointer = + __bindgen_marker_Opaque>; + pub type __allocator_traits_base___pocca = + __bindgen_marker_Opaque>; + pub type __allocator_traits_base___pocma = + __bindgen_marker_Opaque>; + pub type __allocator_traits_base___pocs = + __bindgen_marker_Opaque>; + pub type __allocator_traits_base___equal = root::std::__type_identity; + pub type __allocator_traits_base___allocate_hint_t<_Alloc> = _Alloc; + pub type __allocator_traits_base___construct_t<_Alloc> = _Alloc; + pub type __allocator_traits_base___new_expr_t<_Tp> = _Tp; + pub type __allocator_traits_base___destroy_t<_Alloc> = _Alloc; + pub type __allocator_traits_base___max_size_t<_Alloc> = _Alloc; + pub type __allocator_traits_base___soccc_t<_Alloc> = _Alloc; + pub type __alloc_rebind = root::std::__allocator_traits_base; + #[repr(C)] + pub struct allocator_traits { + pub _address: u8, + } + pub type allocator_traits_allocator_type<_Alloc> = _Alloc; + pub type allocator_traits_value_type = + __bindgen_marker_Opaque>; + pub type allocator_traits_pointer = root::std::__detected_or_t; + #[repr(C)] + pub struct allocator_traits__Ptr { + pub _address: u8, + } + pub type allocator_traits__Ptr_type = + __bindgen_marker_Opaque>; + #[repr(C)] + pub struct allocator_traits__Diff { + pub _address: u8, + } + pub type allocator_traits__Diff_type = root::std::pointer_traits; + #[repr(C)] + pub struct allocator_traits__Size { + pub _address: u8, + } + pub type allocator_traits_const_pointer = + __bindgen_marker_Opaque>; + pub type allocator_traits_void_pointer = root::std::allocator_traits__Ptr; + pub type allocator_traits_const_void_pointer = root::std::allocator_traits__Ptr; + pub type allocator_traits_difference_type = + __bindgen_marker_Opaque>; + pub type allocator_traits_size_type = + __bindgen_marker_Opaque>; + pub type allocator_traits_propagate_on_container_copy_assignment = + root::std::__detected_or_t; + pub type allocator_traits_propagate_on_container_move_assignment = + root::std::__detected_or_t; + pub type allocator_traits_propagate_on_container_swap = root::std::__detected_or_t; + pub type allocator_traits_is_always_equal = root::std::__detected_or_t; + pub type allocator_traits_rebind_alloc = root::std::__alloc_rebind; + pub type allocator_traits_rebind_traits = root::std::allocator_traits; + #[repr(C)] + pub struct basic_string_view<_CharT> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>, + _M_len: usize, + _M_str: *const _CharT, + } + pub type basic_string_view_traits_type<_Traits> = _Traits; + pub type basic_string_view_value_type<_CharT> = _CharT; + pub type basic_string_view_pointer<_CharT> = + *mut root::std::basic_string_view_value_type<_CharT>; + pub type basic_string_view_const_pointer<_CharT> = + *const root::std::basic_string_view_value_type<_CharT>; + pub type basic_string_view_reference<_CharT> = __bindgen_marker_Reference< + *mut root::std::basic_string_view_value_type<_CharT>, + >; + pub type basic_string_view_const_reference<_CharT> = __bindgen_marker_Reference< + *const root::std::basic_string_view_value_type<_CharT>, + >; + pub type basic_string_view_const_iterator<_CharT> = + *const root::std::basic_string_view_value_type<_CharT>; + pub type basic_string_view_iterator<_CharT> = + root::std::basic_string_view_const_iterator<_CharT>; + pub type basic_string_view_const_reverse_iterator<_CharT> = + root::std::reverse_iterator< + root::std::basic_string_view_const_iterator<_CharT>, + >; + pub type basic_string_view_reverse_iterator<_CharT> = + root::std::basic_string_view_const_reverse_iterator<_CharT>; + pub type basic_string_view_size_type = usize; + pub type basic_string_view_difference_type = isize; + #[repr(C)] + pub struct default_delete { + pub _address: u8, + } + #[repr(C)] + pub struct complex<_Tp> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Tp>>, + _M_real: _Tp, + _M_imag: _Tp, + } + pub type complex_value_type<_Tp> = _Tp; + #[repr(C)] + pub struct _Node_handle_common<_NodeAlloc> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_NodeAlloc>>, + _M_ptr: root::std::_Node_handle_common__AllocTraits, + _M_alloc: root::std::_Node_handle_common__Optional_alloc<_NodeAlloc>, + } + pub type _Node_handle_common__AllocTraits = root::std::allocator_traits; + pub type _Node_handle_common_allocator_type = root::std::__alloc_rebind; + #[repr(C)] + #[repr(align(1))] + pub struct _Node_handle_common__Optional_alloc<_NodeAlloc> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_NodeAlloc>>, + pub _M_alloc: root::__BindgenUnionField<_NodeAlloc>, + pub bindgen_union_field: __bindgen_marker_Opaque<[u8; 0usize]>, + } + #[repr(C)] + pub struct _Node_handle<_NodeAlloc> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_NodeAlloc>>, + pub _base: root::std::_Node_handle_common<_NodeAlloc>, + _M_pkey: root::std::_Node_handle___pointer, + _M_pmapped: root::std::_Node_handle___pointer, + } + pub type _Node_handle_key_type<_Key> = _Key; + pub type _Node_handle_mapped_type = + __bindgen_marker_Opaque>; + pub type _Node_handle__AllocTraits = root::std::allocator_traits; + pub type _Node_handle___pointer = root::std::__ptr_rebind; + #[repr(C)] + pub struct _Node_insert_return<_Iterator, _NodeHandle> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>, + pub _phantom_1: + ::std::marker::PhantomData<::std::cell::UnsafeCell<_NodeHandle>>, + pub position: _Iterator, + pub inserted: bool, + pub node: _NodeHandle, + } + #[repr(u32)] + #[derive(Clone, Hash, PartialEq, Eq)] + pub enum _Rb_tree_color { + _S_red = 0, + _S_black = 1, + } + #[repr(C)] + pub struct _Rb_tree_key_compare<_Key_compare> { + pub _phantom_0: + ::std::marker::PhantomData<::std::cell::UnsafeCell<_Key_compare>>, + pub _M_key_compare: _Key_compare, + } + pub mod __rb_tree { + #[allow(unused_imports)] + use self::super::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + #[repr(C)] + pub struct _Node_base { + pub _M_color: root::std::_Rb_tree_color, + pub _M_parent: root::std::__rb_tree::_Node_base__Base_ptr, + pub _M_left: root::std::__rb_tree::_Node_base__Base_ptr, + pub _M_right: root::std::__rb_tree::_Node_base__Base_ptr, + } + pub type _Node_base__Base_ptr = root::std::__ptr_rebind; + #[repr(C)] + pub struct _Header<_NodeBase> { + pub _phantom_0: + ::std::marker::PhantomData<::std::cell::UnsafeCell<_NodeBase>>, + pub _M_header: _NodeBase, + pub _M_node_count: usize, + } + pub type _Header__Base_ptr = + __bindgen_marker_Opaque>; + #[repr(C)] + pub struct _Node { + pub _base: root::std::__rb_tree::_Node_base, + pub _M_u: root::std::__rb_tree::_Node__Uninit_storage, + } + pub type _Node_value_type = root::std::pointer_traits; + pub type _Node__Node_ptr = root::std::__ptr_rebind; + #[repr(C)] + #[repr(align(1))] + pub struct _Node__Uninit_storage { + pub _M_data: + root::__BindgenUnionField, + pub bindgen_union_field: __bindgen_marker_Opaque<[u8; 0usize]>, + } + pub type _Iterator___maybe_const = root::std::__conditional_t; + pub type _Iterator___ptr_traits = root::std::pointer_traits; + pub type _Iterator_value_type = root::std::__rb_tree::_Iterator___ptr_traits; + pub type _Iterator_reference = __bindgen_marker_Reference< + *mut root::std::__rb_tree::_Iterator___maybe_const, + >; + pub type _Iterator_pointer = *mut root::std::__rb_tree::_Iterator___maybe_const; + pub type _Iterator_iterator_category = root::std::bidirectional_iterator_tag; + pub type _Iterator_difference_type = isize; + pub type _Iterator__Node = root::std::__rb_tree::_Node; + pub type _Iterator__Node_base = root::std::__rb_tree::_Node_base; + pub type _Iterator__Base_ptr = root::std::__rb_tree::_Iterator__Node_base; + #[repr(C)] + pub struct _Node_traits { + pub _address: u8, + } + pub type _Node_traits__Node = root::std::__rb_tree::_Node; + pub type _Node_traits__Node_ptr = root::std::__ptr_rebind; + pub type _Node_traits__Node_base = root::std::__rb_tree::_Node_base; + pub type _Node_traits__Base_ptr = root::std::__ptr_rebind; + pub type _Node_traits__Header_t = root::std::__rb_tree::_Header< + root::std::__rb_tree::_Node_traits__Node_base, + >; + pub type _Node_traits__Iterator = __bindgen_marker_Opaque; + pub type _Node_traits__Const_iterator = __bindgen_marker_Opaque; + } + #[repr(C)] + pub struct _Rb_tree { + _M_impl: __bindgen_marker_Opaque, + } + pub type _Rb_tree__Val_alloc_type = + __bindgen_marker_Opaque>; + pub type _Rb_tree__Val_alloc_traits = root::__gnu_cxx::__alloc_traits; + pub type _Rb_tree__ValPtr = + __bindgen_marker_Opaque>; + pub type _Rb_tree__Node_traits = root::std::__rb_tree::_Node_traits; + pub type _Rb_tree__Node_base = + __bindgen_marker_Opaque>; + pub type _Rb_tree__Node = + __bindgen_marker_Opaque>; + pub type _Rb_tree__Node_allocator = + __bindgen_marker_Opaque>; + pub type _Rb_tree__Node_alloc_traits = root::__gnu_cxx::__alloc_traits; + pub type _Rb_tree__Base_ptr = + __bindgen_marker_Opaque>; + pub type _Rb_tree__Node_ptr = + __bindgen_marker_Opaque>; + #[repr(C)] + pub struct _Rb_tree__Reuse_or_alloc_node { + _M_root: root::std::_Rb_tree__Base_ptr, + _M_nodes: root::std::_Rb_tree__Base_ptr, + _M_t: __bindgen_marker_Reference<*mut root::std::_Rb_tree>, + } + #[repr(C)] + pub struct _Rb_tree__Alloc_node { + _M_t: __bindgen_marker_Reference<*mut root::std::_Rb_tree>, + } + pub type _Rb_tree_key_type<_Key> = _Key; + pub type _Rb_tree_value_type<_Val> = _Val; + pub type _Rb_tree_pointer<_Val> = *mut root::std::_Rb_tree_value_type<_Val>; + pub type _Rb_tree_const_pointer<_Val> = *const root::std::_Rb_tree_value_type<_Val>; + pub type _Rb_tree_reference<_Val> = + __bindgen_marker_Reference<*mut root::std::_Rb_tree_value_type<_Val>>; + pub type _Rb_tree_const_reference<_Val> = + __bindgen_marker_Reference<*const root::std::_Rb_tree_value_type<_Val>>; + pub type _Rb_tree_size_type = usize; + pub type _Rb_tree_difference_type = isize; + pub type _Rb_tree_allocator_type<_Alloc> = _Alloc; + pub type _Rb_tree__Header_t = + __bindgen_marker_Opaque>; + pub type _Rb_tree_iterator = + __bindgen_marker_Opaque>; + pub type _Rb_tree_const_iterator = + __bindgen_marker_Opaque>; + pub type _Rb_tree_reverse_iterator = + root::std::reverse_iterator; + pub type _Rb_tree_const_reverse_iterator = + root::std::reverse_iterator; + pub type _Rb_tree_node_type = + root::std::_Node_handle; + // pub type _Rb_tree_insert_return_type = root :: std :: _Node_insert_return < _Iterator , _NodeHandle >; + pub const _Rb_tree___as_lvalue: root::std::_Rb_tree__bindgen_ty_1 = + _Rb_tree__bindgen_ty_1::__as_lvalue; + pub const _Rb_tree___as_rvalue: root::std::_Rb_tree__bindgen_ty_1 = + _Rb_tree__bindgen_ty_1::__as_lvalue; + #[repr(i32)] + #[derive(Clone, Hash, PartialEq, Eq)] + pub enum _Rb_tree__bindgen_ty_1 { + __as_lvalue = 0, + } + pub type _Rb_tree___same_value_type = root::std::is_same; + pub type _Rb_tree__Compatible_tree = root::std::_Rb_tree; + #[repr(C)] + pub struct _Rb_tree__Auto_node { + pub _M_t: __bindgen_marker_Reference<*mut root::std::_Rb_tree>, + pub _M_node: root::std::_Rb_tree__Node_ptr, + } + pub type _Rb_tree__Rb_tree_impl__Base_key_compare<_Key_compare> = + root::std::_Rb_tree_key_compare<_Key_compare>; + #[repr(C)] + pub struct map { + _M_t: root::std::map__Rep_type, + } + pub type map_key_type<_Key> = _Key; + pub type map_mapped_type<_Tp> = _Tp; + pub type map_value_type<_Key, _Tp> = root::std::pair<_Key, _Tp>; + pub type map_key_compare<_Compare> = _Compare; + pub type map_allocator_type<_Alloc> = _Alloc; + #[repr(C)] + pub struct map_value_compare<_Compare> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Compare>>, + comp: _Compare, + } + pub type map__Pair_alloc_type = + __bindgen_marker_Opaque>; + pub type map__Rep_type = root::std::_Rb_tree; + pub type map__Alloc_traits = root::__gnu_cxx::__alloc_traits; + pub type map_pointer = + __bindgen_marker_Opaque>; + pub type map_const_pointer = + __bindgen_marker_Opaque>; + pub type map_reference = + __bindgen_marker_Opaque>; + pub type map_const_reference = + __bindgen_marker_Opaque>; + pub type map_iterator = + __bindgen_marker_Opaque>; + pub type map_const_iterator = + __bindgen_marker_Opaque>; + pub type map_size_type = + __bindgen_marker_Opaque>; + pub type map_difference_type = + __bindgen_marker_Opaque>; + pub type map_reverse_iterator = + __bindgen_marker_Opaque>; + pub type map_const_reverse_iterator = + __bindgen_marker_Opaque>; + pub type map_node_type = + __bindgen_marker_Opaque>; + pub type map_insert_return_type = + __bindgen_marker_Opaque>; + } + pub mod __gnu_cxx { + #[allow(unused_imports)] + use self::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + #[repr(C)] + pub struct _Char_types { + pub _address: u8, + } + pub type _Char_types_int_type = ::std::os::raw::c_ulong; + pub type _Char_types_pos_type = root::std::streampos; + pub type _Char_types_off_type = root::std::streamoff; + pub type _Char_types_state_type = root::__mbstate_t; + #[repr(C)] + pub struct char_traits { + pub _address: u8, + } + pub type char_traits_char_type<_CharT> = _CharT; + pub type char_traits_int_type = root::__gnu_cxx::_Char_types; + pub type char_traits_pos_type = root::__gnu_cxx::_Char_types; + pub type char_traits_off_type = root::__gnu_cxx::_Char_types; + pub type char_traits_state_type = root::__gnu_cxx::_Char_types; + #[repr(C)] + pub struct __normal_iterator<_Iterator> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>, + _M_current: _Iterator, + } + pub type __normal_iterator___traits_type = root::std::iterator_traits; + pub type __normal_iterator___convertible_from = root::std::__enable_if_t; + pub type __normal_iterator_iterator_type<_Iterator> = _Iterator; + pub type __normal_iterator_iterator_category = + root::__gnu_cxx::__normal_iterator___traits_type; + pub type __normal_iterator_value_type = + root::__gnu_cxx::__normal_iterator___traits_type; + pub type __normal_iterator_difference_type = + root::__gnu_cxx::__normal_iterator___traits_type; + pub type __normal_iterator_reference = + root::__gnu_cxx::__normal_iterator___traits_type; + pub type __normal_iterator_pointer = + root::__gnu_cxx::__normal_iterator___traits_type; + #[repr(C)] + pub struct __alloc_traits { + pub _address: u8, + } + pub type __alloc_traits_allocator_type<_Alloc> = _Alloc; + pub type __alloc_traits__Base_type = root::std::allocator_traits; + pub type __alloc_traits_value_type = root::__gnu_cxx::__alloc_traits__Base_type; + pub type __alloc_traits_pointer = root::__gnu_cxx::__alloc_traits__Base_type; + pub type __alloc_traits_const_pointer = root::__gnu_cxx::__alloc_traits__Base_type; + pub type __alloc_traits_size_type = root::__gnu_cxx::__alloc_traits__Base_type; + pub type __alloc_traits_difference_type = + root::__gnu_cxx::__alloc_traits__Base_type; + pub type __alloc_traits_reference = + __bindgen_marker_Reference<*mut root::__gnu_cxx::__alloc_traits_value_type>; + pub type __alloc_traits_const_reference = + __bindgen_marker_Reference<*const root::__gnu_cxx::__alloc_traits_value_type>; + pub type __alloc_traits___is_custom_pointer = root::std::__and_; + #[repr(C)] + pub struct __alloc_traits_rebind { + pub _address: u8, + } + pub type __alloc_traits_rebind_other = root::__gnu_cxx::__alloc_traits__Base_type; + } + #[repr(C)] + pub struct __mbstate_t { + pub __count: ::std::os::raw::c_int, + pub __value: root::__mbstate_t__bindgen_ty_1, + } + #[repr(C)] + pub struct __mbstate_t__bindgen_ty_1 { + pub __wch: root::__BindgenUnionField<::std::os::raw::c_uint>, + pub __wchb: root::__BindgenUnionField<[::std::os::raw::c_char; 4usize]>, + pub bindgen_union_field: __bindgen_marker_Opaque, + } + pub mod itk { + #[allow(unused_imports)] + use self::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + pub mod simple { + #[allow(unused_imports)] + use self::super::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + use crate::ffi::ToCppString; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + impl root::itk::simple::InterpolatorEnum { + pub const sitkBSpline3: root::itk::simple::InterpolatorEnum = + InterpolatorEnum::sitkBSpline; + } + impl root::itk::simple::InterpolatorEnum { + pub const sitkBSplineResamplerOrder3: root::itk::simple::InterpolatorEnum = + InterpolatorEnum::sitkBSplineResampler; + } + #[repr(u32)] + #[derive(Clone, Hash, PartialEq, Eq)] + pub enum InterpolatorEnum { + #[doc = " \\brief Nearest-neighbor interpolation\n \\sa itk::NearestNeighborInterpolateImageFunction"] + sitkNearestNeighbor = 1, + #[doc = " \\brief N-D linear interpolation\n \\sa itk::LinearInterpolateImageFunction"] + sitkLinear = 2, + #[doc = " \\brief B-Spline of order 1 interpolation\n \\sa itk::BSplineInterpolateImageFunction"] + sitkBSpline1 = 21, + #[doc = " \\brief B-Spline of order 2 interpolation\n \\sa itk::BSplineInterpolateImageFunction"] + sitkBSpline2 = 22, + #[doc = " \\brief B-Spline of order 3 interpolation\n \\sa itk::BSplineInterpolateImageFunction"] + sitkBSpline = 23, + #[doc = " \\brief B-Spline of order 4 interpolation\n \\sa itk::BSplineInterpolateImageFunction"] + sitkBSpline4 = 24, + #[doc = " \\brief B-Spline of order 5 interpolation\n \\sa itk::BSplineInterpolateImageFunction"] + sitkBSpline5 = 25, + #[doc = " \\brief Gaussian interpolation\n\n Sigma is set to 0.8 input pixels and alpha is 4.0\n\n \\sa itk::GaussianInterpolateImageFunction"] + sitkGaussian = 4, + #[doc = " \\brief Smoothly interpolate multi-label images\n\n Sigma is set to 1.0 input pixels and alpha is 1.0\n\n \\sa itk:LabelImageGaussianInterpolateImageFunction"] + sitkLabelGaussian = 5, + #[doc = " \\brief Linear interpolation for multi-label images\n\n \\sa itk:LabelImageGenericInterpolateImageFunction\n \\sa itk:LinearInterpolateImageFunction"] + sitkLabelLinear = 26, + #[doc = " \\brief Windowed sinc interpolation\n\n \\f[ w(x) = 0.54 + 0.46 cos(\\frac{\\pi x}{m} ) \\f]\n\n \\sa itk::WindowedSincInterpolateImageFunction\n \\sa itk::Function::HammingWindowFunction"] + sitkHammingWindowedSinc = 6, + #[doc = " \\brief Windowed sinc interpolation\n\n \\f[ w(x) = cos(\\frac{\\pi x}{2 m} ) \\f]\n\n \\sa itk::WindowedSincInterpolateImageFunction\n \\sa itk::Function::CosineWindowFunction"] + sitkCosineWindowedSinc = 7, + #[doc = " \\brief Windowed sinc interpolation\n\n \\f[ w(x) = 1 - ( \\frac{x^2}{m^2} ) \\f]\n\n \\sa itk::WindowedSincInterpolateImageFunction\n \\sa itk::Function::WelchWindowFunction"] + sitkWelchWindowedSinc = 8, + #[doc = " \\brief Windowed sinc interpolation\n\n \\f[ w(x) = \\textrm{sinc} ( \\frac{x}{m} ) \\f]\n\n \\sa itk::WindowedSincInterpolateImageFunction\n \\sa itk::Function::LanczosWindowFunction"] + sitkLanczosWindowedSinc = 9, + #[doc = " \\brief Windowed sinc interpolation\n\n \\f[ w(x) = 0.42 + 0.5 cos(\\frac{\\pi x}{m}) + 0.08 cos(\\frac{2 \\pi x}{m}) \\f]\n\n \\sa itk::WindowedSincInterpolateImageFunction\n \\sa itk::Function::BlackmanWindowFunction"] + sitkBlackmanWindowedSinc = 10, + #[doc = " \\brief Interpolator for a BSpline coefficient image\n\n This interpolator should be used with the resampling the image\n intensities of a BSpline coefficient image. The order specifies\n the order of the coefficient image, and defaults to 3.\n\n \\sa BSplineTransformation\n \\sa itk::BSplineResampleImageFunction"] + sitkBSplineResampler = 11, + #[doc = " \\brief Interpolator for a BSpline coefficient image, order 1."] + sitkBSplineResamplerOrder1 = 12, + #[doc = " \\brief Interpolator for a BSpline coefficient image, order 2."] + sitkBSplineResamplerOrder2 = 13, + #[doc = " \\brief Interpolator for a BSpline coefficient image, order 4."] + sitkBSplineResamplerOrder4 = 14, + #[doc = " \\brief Interpolator for a BSpline coefficient image, order 5."] + sitkBSplineResamplerOrder5 = 15, + } + pub type PixelIDValueType = ::std::os::raw::c_int; + #[repr(i32)] + #[doc = " \\brief Enumerated values of pixelIDs\n\n Each PixelID's value corresponds to the index of the PixelID type,\n in the type list \"InstantiatedPixelIDTypeList\". It is possible that\n different configurations for SimpleITK could result in different\n values for pixelID. So these enumerated values should be used.\n\n Additionally, not all PixelID an instantiated in for the tool\n kit. If a PixelID is not instantiated then it's value is\n -1. Therefore it is likely that multiple elements in the\n enumeration will have a zero value. Therefore the first preferred\n method is to + use \"if\" statements, with the first branch checking\n for the Unknown value.\n\n If a switch case statement is needed the ConditionalValue\n meta-programming object can be used as follows:\n \\code\n switch( pixelIDValue )\n {\n case sitk::sitkUnknown:\n // handle exceptional case\n break\n case sitk::ConditionalValue< sitk::sitkUInt8 != sitk::sitkUnknown, sitk::sitkUInt8, -2 >::Value:\n ...\n break;\n case sitk::ConditionalValue< sitk::sitkInt8 != sitk::sitkUnknown, sitk::sitkInt8, -3 >::Value:\n ...\n break;\n case sitk::ConditionalValue< sitk::N != sitk::sitkUnknown, sitk::N, -N >::Value:\n ...\n break;\n default:\n // handle another exceptional case\n }\n \\endcode"] + #[derive(Clone, Hash, PartialEq, Eq)] + pub enum PixelIDValueEnum { + sitkUnknown = -1, + #[doc = "< Unsigned 8 bit integer"] + sitkUInt8 = 1, + #[doc = "< Signed 8 bit integer"] + sitkInt8 = 0, + #[doc = "< Unsigned 16 bit integer"] + sitkUInt16 = 3, + #[doc = "< Signed 16 bit integer"] + sitkInt16 = 2, + #[doc = "< Unsigned 32 bit integer"] + sitkUInt32 = 5, + #[doc = "< Signed 32 bit integer"] + sitkInt32 = 4, + #[doc = "< Unsigned 64 bit integer"] + sitkUInt64 = 7, + #[doc = "< Signed 64 bit integer"] + sitkInt64 = 6, + #[doc = "< 32 bit float"] + sitkFloat32 = 8, + #[doc = "< 64 bit float"] + sitkFloat64 = 9, + sitkComplexFloat32 = 10, + sitkComplexFloat64 = 11, + #[doc = "< Multi-component of unsigned 8 bit integer"] + sitkVectorUInt8 = 13, + #[doc = "< Multi-component of signed 8 bit integer"] + sitkVectorInt8 = 12, + sitkVectorUInt16 = 15, + #[doc = "< Multi-component of signed 16 bit integer"] + sitkVectorInt16 = 14, + sitkVectorUInt32 = 17, + #[doc = "< Multi-component of signed 32 bit integer"] + sitkVectorInt32 = 16, + sitkVectorUInt64 = 19, + #[doc = "< Multi-component of signed 64 bit integer"] + sitkVectorInt64 = 18, + #[doc = "< Multi-component of 32 bit float"] + sitkVectorFloat32 = 20, + #[doc = "< Multi-component of 64 bit float"] + sitkVectorFloat64 = 21, + #[doc = "< RLE label of unsigned 8 bit integers"] + sitkLabelUInt8 = 22, + #[doc = "< RLE label of unsigned 16 bit integers"] + sitkLabelUInt16 = 23, + #[doc = "< RLE label of unsigned 32 bit integers"] + sitkLabelUInt32 = 24, + #[doc = "< RLE label of unsigned 64 bit integers"] + sitkLabelUInt64 = 25, + } + #[repr(C)] + pub struct PimpleImageBase { + _unused: [u8; 0], + } + #[repr(C)] + pub struct Image__bindgen_vtable(::std::os::raw::c_void); + #[doc = " \\class Image\n \\brief The Image class for SimpleITK\n\n This Image class can represent 2D, 3D, and 4D images. The pixel\n types may be a scalar, a multi-component vector or a\n run-length-encoded (RLE) \"label\". The dimension, pixel type and\n size is specified at construction.\n\n A fundamental concept of ITK images is that they occupy physical\n space where the image is defined by an origin, spacing, and\n direction cosine matrix. The attributes are taken into\n consideration when doing most operations on an image. A meta-data\n dictionary is also associated with the image, which may contain\n additional fields from reading but these attributes are not\n propagated by image filters.\n\n The SimpleITK Image provides a single facade interface to several\n ITK image types. Internally, the SimpleITK Image maintains a\n pointer to the ITK image class, and performs reference counting\n and lazy copying. This means that deep copying of an image\n including it's buffer is delayed until the image is\n modified. This removes the need to + use pointers to SimpleITK\n Image class, as copying and returning by value do not\n unnecessarily duplicate the data.\n\n \\sa itk::Image itk::VectorImage itk::LabelMap itk::ImageBase"] + #[repr(C)] + pub struct Image { + pub vtable_: *const Image__bindgen_vtable, + m_PimpleImage: root::std::unique_ptr, + } + pub const Image_DefaultImageCoordinateTolerance: f64 = 0.000001; + pub const Image_DefaultImageDirectionTolerance: f64 = 0.000001; + unsafe extern "C" { + #[doc = " \\brief Advanced method not commonly needed\n\n This method is designed to support implementations \"in-place\" object behavior for methods which operate on\n r-value references. The returned image is a new image which has a low level pointer to this object's image\n buffer, without the SimpleITK or ITK reference counting. This is implemented by setting the new ITK Image's\n buffer to the same as this objects without ownership.\n\n \\warning This method bypasses the SimpleITK reference counting, and the reference needs to be manually maintained\n in the scope. The resulting object is designed only to be a temporary.\n\n In the following example this method is used instead of an `std::move` call when the filter's first argument\n takes an r-value reference. The `img` object will container the results of the filter execution, and the `img`\n image buffer will be preserved in case of exceptions, and the meta-data will remain in the img object.\n \\code\n filter.Execute( img.ProxyForInPlaceOperation() );\n \\endcode\n\n The meta-data dictionary is not copied to the returned proxy image."] + #[link_name = "\u{1}_ZN3itk6simple5Image24ProxyForInPlaceOperationEv"] + pub fn Image_ProxyForInPlaceOperation_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> root::itk::simple::Image; + } + unsafe extern "C" { + #[doc = " Get access to internal ITK data object.\n\n The return value should immediately be assigned to as\n itk::SmartPointer.\n\n In many cases the value may need to be dynamically casted to\n the actual image type. The GetPixelIDValue() method should\n return an PixelID which identifies the image type which the\n DataObject points to.\n\n If this object has been moved, then nullptr is returned.\n\n @{"] + #[link_name = "\u{1}_ZN3itk6simple5Image10GetITKBaseEv"] + pub fn Image_GetITKBase_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut root::itk::DataObject; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image10GetITKBaseEv"] + pub fn Image_GetITKBase_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const root::itk::DataObject; + } + unsafe extern "C" { + #[doc = " Get the pixel type\n\n The pixel type is set at construction type and can not be\n manually changed, unless by assignment. The value may be -1 or\n \"Unknown\"."] + #[link_name = "\u{1}_ZNK3itk6simple5Image10GetPixelIDEv"] + pub fn Image_GetPixelID_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::itk::simple::PixelIDValueEnum; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetPixelIDValueEv"] + pub fn Image_GetPixelIDValue_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::itk::simple::PixelIDValueType; + } + unsafe extern "C" { + #[doc = " Return the pixel type as a human readable string value."] + #[link_name = "\u{1}_ZNK3itk6simple5Image22GetPixelIDTypeAsStringB5cxx11Ev"] + pub fn Image_GetPixelIDTypeAsString_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " Get the number of physical dimensions.\n\n Only the spatial dimensions are considered here. These are the\n dimensions the origin, spacing and direction cosine matrix are\n applicable to. This does not include the pixels' vector index\n as a dimension."] + #[link_name = "\u{1}_ZNK3itk6simple5Image12GetDimensionEv"] + pub fn Image_GetDimension_bindgen_original( + this: *const root::itk::simple::Image, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Get the number of components for each pixel\n\n For images with scalar or complex pixel types this method\n returns one. For images with a vector pixel type the method\n returns the number of vector components per pixel."] + #[link_name = "\u{1}_ZNK3itk6simple5Image29GetNumberOfComponentsPerPixelEv"] + pub fn Image_GetNumberOfComponentsPerPixel_bindgen_original( + this: *const root::itk::simple::Image, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Get the number of pixels in the image\n\n To calculate the total number of values stored continuously for\n the image's buffer, the NumberOfPixels should be multiplied by\n NumberOfComponentsPerPixel in order to account for multiple\n component images.\n"] + #[link_name = "\u{1}_ZNK3itk6simple5Image17GetNumberOfPixelsEv"] + pub fn Image_GetNumberOfPixels_bindgen_original( + this: *const root::itk::simple::Image, + ) -> u64; + } + unsafe extern "C" { + #[doc = " \\brief Get the number of bytes per component of a pixel.\n\n Returns the `sizeof` the pixel component type."] + #[link_name = "\u{1}_ZNK3itk6simple5Image23GetSizeOfPixelComponentEv"] + pub fn Image_GetSizeOfPixelComponent_bindgen_original( + this: *const root::itk::simple::Image, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " Get/Set the Origin in physical space\n @{"] + #[link_name = "\u{1}_ZNK3itk6simple5Image9GetOriginEv"] + pub fn Image_GetOrigin_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image9SetOriginERKSt6vectorIdSaIdEE"] + pub fn Image_SetOrigin_bindgen_original( + this: *mut root::itk::simple::Image, + origin: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[doc = " Get/Set the Spacing of the Image as an std::vector .\n\n The spacing describes the physical size of each pixel. The\n length of the vector is equal to the dimension of the Image.\n @{"] + #[link_name = "\u{1}_ZNK3itk6simple5Image10GetSpacingEv"] + pub fn Image_GetSpacing_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image10SetSpacingERKSt6vectorIdSaIdEE"] + pub fn Image_SetSpacing_bindgen_original( + this: *mut root::itk::simple::Image, + spacing: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Set/Get the Direction\n\n Internally, the Direction is represented by a matrix 2x2 for a\n 2D and 3x3 for a 3D image. The matrix is passed as a 1D\n array in row-major form.\n @{"] + #[link_name = "\u{1}_ZNK3itk6simple5Image12GetDirectionEv"] + pub fn Image_GetDirection_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image12SetDirectionERKSt6vectorIdSaIdEE"] + pub fn Image_SetDirection_bindgen_original( + this: *mut root::itk::simple::Image, + direction: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[doc = " Transform index to physical point"] + #[link_name = "\u{1}_ZNK3itk6simple5Image29TransformIndexToPhysicalPointERKSt6vectorIlSaIlEE"] + pub fn Image_TransformIndexToPhysicalPoint_bindgen_original( + this: *const root::itk::simple::Image, + index: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Transform physical point to index"] + #[link_name = "\u{1}_ZNK3itk6simple5Image29TransformPhysicalPointToIndexERKSt6vectorIdSaIdEE"] + pub fn Image_TransformPhysicalPointToIndex_bindgen_original( + this: *const root::itk::simple::Image, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Transform physical point to continuous index"] + #[link_name = "\u{1}_ZNK3itk6simple5Image39TransformPhysicalPointToContinuousIndexERKSt6vectorIdSaIdEE"] + pub fn Image_TransformPhysicalPointToContinuousIndex_bindgen_original( + this: *const root::itk::simple::Image, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Transform continuous index to physical point"] + #[link_name = "\u{1}_ZNK3itk6simple5Image39TransformContinuousIndexToPhysicalPointERKSt6vectorIdSaIdEE"] + pub fn Image_TransformContinuousIndexToPhysicalPoint_bindgen_original( + this: *const root::itk::simple::Image, + index: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " \\brief Interpolate pixel value at a continuous index.\n\n This method is not supported for Label pixel types.\n\n The valid range of continuous index is [-0.5, size-0.5] for each dimension. An exception is thrown if index is out\n of bounds.\n\n @param index The continuous index must be at least the length of the image dimension.\n @param interp The interpolation type to use, only sitkNearest and sitkLinear are supported for Vector and Complex\n pixel types.\n\n @return All supported pixel types are returned as an array, where complex numbers are returned with the real\n followed by the complex component."] + #[link_name = "\u{1}_ZNK3itk6simple5Image25EvaluateAtContinuousIndexERKSt6vectorIdSaIdEENS0_16InterpolatorEnumE"] + pub fn Image_EvaluateAtContinuousIndex_bindgen_original( + this: *const root::itk::simple::Image, + index: __bindgen_marker_Reference<*const root::std::vector>, + interp: root::itk::simple::InterpolatorEnum, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Interpolate pixel value at a physical point.\n\n This method is not supported for Label pixel types.\n\n An exception is thrown if the point is out of the defined region for the image.\n\n @param point The physical point at which the interpolation is computed.\n @param interp The interpolation type to use, only sitkNearest and sitkLinear are supported for Vector and Complex\n pixel types.\n\n @return All supported pixel types are returned as an array, where complex numbers are returned with the real\n followed by the complex component."] + #[link_name = "\u{1}_ZNK3itk6simple5Image23EvaluateAtPhysicalPointERKSt6vectorIdSaIdEENS0_16InterpolatorEnumE"] + pub fn Image_EvaluateAtPhysicalPoint_bindgen_original( + this: *const root::itk::simple::Image, + point: __bindgen_marker_Reference<*const root::std::vector>, + interp: root::itk::simple::InterpolatorEnum, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Checks whether the images' pixels at the same index occupy the same physical space.\n\n Compares the origin, spacing, and direction for equality within provided tolerances.\n There is no check for matching regions in between the images.\n\n If The dimensions of the images do not match, false is returned."] + #[link_name = "\u{1}_ZNK3itk6simple5Image24IsCongruentImageGeometryERKS1_dd"] + pub fn Image_IsCongruentImageGeometry_bindgen_original( + this: *const root::itk::simple::Image, + otherImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + coordinateTolerance: f64, + directionTolerance: f64, + ) -> bool; + } + unsafe extern "C" { + #[doc = " Check whether the images have the same grid in physical space.\n\n Compares largest possible regions for equality, and the origin, spacing,\n and direction cosines for equality within provided tolerances.\n\n If the dimensions of the images do not match, false is returned."] + #[link_name = "\u{1}_ZNK3itk6simple5Image21IsSameImageGeometryAsERKS1_dd"] + pub fn Image_IsSameImageGeometryAs_bindgen_original( + this: *const root::itk::simple::Image, + otherImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + arg1: f64, + arg2: f64, + ) -> bool; + } + unsafe extern "C" { + #[doc = " Get the number of pixels the Image is in each dimension as a\n std::vector. The size of the vector is equal to the number of dimensions\n for the image."] + #[link_name = "\u{1}_ZNK3itk6simple5Image7GetSizeEv"] + pub fn Image_GetSize_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::std::vector<::std::os::raw::c_uint>; + } + unsafe extern "C" { + #[doc = " Get the number of pixels the Image is in the first dimension"] + #[link_name = "\u{1}_ZNK3itk6simple5Image8GetWidthEv"] + pub fn Image_GetWidth_bindgen_original( + this: *const root::itk::simple::Image, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " Get the number of pixels the Image is in the second dimension"] + #[link_name = "\u{1}_ZNK3itk6simple5Image9GetHeightEv"] + pub fn Image_GetHeight_bindgen_original( + this: *const root::itk::simple::Image, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " Get the number of pixels the Image is in the third dimension\n or 0 if the Image is only 2D"] + #[link_name = "\u{1}_ZNK3itk6simple5Image8GetDepthEv"] + pub fn Image_GetDepth_bindgen_original( + this: *const root::itk::simple::Image, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Copy common meta-data from an image to this one.\n\n Copies the Origin, Spacing, and Direction from the source image\n to this image. The meta-data dictionary is \\b not copied.\n\n It is required for the source Image's dimension and size to\n match, this image's attributes, otherwise an exception will be\n generated.\n"] + #[link_name = "\u{1}_ZN3itk6simple5Image15CopyInformationERKS1_"] + pub fn Image_CopyInformation_bindgen_original( + this: *mut root::itk::simple::Image, + srcImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief get a vector of keys in from the meta-data dictionary\n\n Returns a vector of keys to the key/value entries in the\n image's meta-data dictionary. Iterate through with these keys\n to get the values."] + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetMetaDataKeysB5cxx11Ev"] + pub fn Image_GetMetaDataKeys_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " \\brief Query the meta-data dictionary for the existence of a key."] + #[link_name = "\u{1}_ZNK3itk6simple5Image14HasMetaDataKeyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn Image_HasMetaDataKey_bindgen_original( + this: *const root::itk::simple::Image, + key: __bindgen_marker_Reference<*const root::std::string>, + ) -> bool; + } + unsafe extern "C" { + #[doc = " \\brief Get the value of a meta-data dictionary entry as a string.\n\n If the key is not in the dictionary then an exception is\n thrown.\n\n string types in the dictionary are returned as their native\n strings. Other types are printed to string before returning."] + #[link_name = "\u{1}_ZNK3itk6simple5Image11GetMetaDataERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn Image_GetMetaData_bindgen_original( + this: *const root::itk::simple::Image, + key: __bindgen_marker_Reference<*const root::std::string>, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Set an entry in the meta-data dictionary.\n\n Replaces or creates an entry in the image's meta-data dictionary."] + #[link_name = "\u{1}_ZN3itk6simple5Image11SetMetaDataERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_"] + pub fn Image_SetMetaData_bindgen_original( + this: *mut root::itk::simple::Image, + key: __bindgen_marker_Reference<*const root::std::string>, + value: __bindgen_marker_Reference<*const root::std::string>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Remove an entry from the meta-data dictionary.\n\n Returns true, when the value exists in the dictionary and is\n removed, false otherwise."] + #[link_name = "\u{1}_ZN3itk6simple5Image13EraseMetaDataERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn Image_EraseMetaData_bindgen_original( + this: *mut root::itk::simple::Image, + key: __bindgen_marker_Reference<*const root::std::string>, + ) -> bool; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image8ToStringB5cxx11Ev"] + pub fn Image_ToString_bindgen_original( + this: *const root::itk::simple::Image, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Convert the first dimension to the components for image with vector pixel type.\n\n This method will convert a scalar image to a vector image with\n the number of components equal to the size of the first\n dimension. If the image is already a vector image then the\n image is returned.\n\n The components of the direction cosine matrix for the first dimension must be the identity matrix, or else an\n exception is thrown.\n\n An exception is thrown if the image is 2D or if the pixel type is a label or complex pixel type.\n\n \\param inPlace If true then the image is made unique and converted in place updating this image,\n otherwise a copy of the image is made and returned.\n\n \\sa ToScalarImage"] + #[link_name = "\u{1}_ZN3itk6simple5Image13ToVectorImageEb"] + pub fn Image_ToVectorImage_bindgen_original( + this: *mut root::itk::simple::Image, + inPlace: bool, + ) -> root::itk::simple::Image; + } + unsafe extern "C" { + #[doc = " \\brief Convert a image of vector pixel type to a scalar image with N+1 dimensions.\n\n This method will convert a vector image to a scalar image with\n the size of the first dimension equal to the number of\n components. If the image is already a scalar image then the\n image is returned.\n\n For the additional dimension the origin is set to zero, the spacing to one, and the new components of the\n direction cosine to the identity matrix.\n\n An exception is thrown if the image is has SITK_MAX_DIMENSION dimensions or if the pixel type is a label or\n complex pixel type.\n\n \\param inPlace If true then the image is made unique and converted in place updating this image,\n otherwise a copy of the image is made and returned.\n\n \\sa ToVectorImage"] + #[link_name = "\u{1}_ZN3itk6simple5Image13ToScalarImageEb"] + pub fn Image_ToScalarImage_bindgen_original( + this: *mut root::itk::simple::Image, + inPlace: bool, + ) -> root::itk::simple::Image; + } + unsafe extern "C" { + #[doc = " \\brief Get the value of a pixel\n\n Returns the value of a pixel for the given index. The index\n follows standard SimpleITK conventions for it's length. The\n correct method must be called for the underlying Image type,\n otherwise an exception will be thrown.\n\n \\param idx the zero based index into the image. It's length\n must be at least the value of GetDimension(), additional\n elements will be ignored. Boundary checking is performed on\n idx, if it is out of bounds an exception will be thrown.\n\n \\sa Image::GetPixelIDValue\n @{"] + #[link_name = "\u{1}_ZNK3itk6simple5Image14GetPixelAsInt8ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsInt8_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i8; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetPixelAsUInt8ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsUInt8_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u8; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetPixelAsInt16ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsInt16_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i16; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetPixelAsUInt16ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsUInt16_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u16; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetPixelAsInt32ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsInt32_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetPixelAsUInt32ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsUInt32_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetPixelAsInt64ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsInt64_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetPixelAsUInt64ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsUInt64_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetPixelAsFloatERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsFloat_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> f32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetPixelAsDoubleERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsDouble_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> f64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image20GetPixelAsVectorInt8ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorInt8_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image21GetPixelAsVectorUInt8ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorUInt8_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image21GetPixelAsVectorInt16ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorInt16_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image22GetPixelAsVectorUInt16ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorUInt16_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image21GetPixelAsVectorInt32ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorInt32_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image22GetPixelAsVectorUInt32ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorUInt32_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image21GetPixelAsVectorInt64ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorInt64_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image22GetPixelAsVectorUInt64ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorUInt64_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image23GetPixelAsVectorFloat32ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorFloat32_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image23GetPixelAsVectorFloat64ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsVectorFloat64_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image24GetPixelAsComplexFloat32ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsComplexFloat32_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::complex; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image24GetPixelAsComplexFloat64ERKSt6vectorIjSaIjEE"] + pub fn Image_GetPixelAsComplexFloat64_bindgen_original( + this: *const root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::complex; + } + unsafe extern "C" { + #[doc = " \\brief Set the value of a pixel\n\n Set the value of a pixel at the provided index. The index\n follows standard SimpleITK conventions for it's length. The\n correct method must be called which should match the underlying\n image type, otherwise an exception will be thrown.\n\n \\param idx the zero based index into the image. It's length\n must be at least the value of GetDimension(), additional\n elements will be ignored. Boundary checking is performed on\n idx, if it is out of bounds an exception will be thrown.\n \\param v value to set the pixel to\n\n \\sa Image::GetPixelIDValue\n @{"] + #[link_name = "\u{1}_ZN3itk6simple5Image14SetPixelAsInt8ERKSt6vectorIjSaIjEEa"] + pub fn Image_SetPixelAsInt8_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i8, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image15SetPixelAsUInt8ERKSt6vectorIjSaIjEEh"] + pub fn Image_SetPixelAsUInt8_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u8, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image15SetPixelAsInt16ERKSt6vectorIjSaIjEEs"] + pub fn Image_SetPixelAsInt16_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i16, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16SetPixelAsUInt16ERKSt6vectorIjSaIjEEt"] + pub fn Image_SetPixelAsUInt16_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u16, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image15SetPixelAsInt32ERKSt6vectorIjSaIjEEi"] + pub fn Image_SetPixelAsInt32_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i32, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16SetPixelAsUInt32ERKSt6vectorIjSaIjEEj"] + pub fn Image_SetPixelAsUInt32_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u32, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image15SetPixelAsInt64ERKSt6vectorIjSaIjEEl"] + pub fn Image_SetPixelAsInt64_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i64, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16SetPixelAsUInt64ERKSt6vectorIjSaIjEEm"] + pub fn Image_SetPixelAsUInt64_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u64, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image15SetPixelAsFloatERKSt6vectorIjSaIjEEf"] + pub fn Image_SetPixelAsFloat_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: f32, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16SetPixelAsDoubleERKSt6vectorIjSaIjEEd"] + pub fn Image_SetPixelAsDouble_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: f64, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image20SetPixelAsVectorInt8ERKSt6vectorIjSaIjEERKS2_IaSaIaEE"] + pub fn Image_SetPixelAsVectorInt8_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image21SetPixelAsVectorUInt8ERKSt6vectorIjSaIjEERKS2_IhSaIhEE"] + pub fn Image_SetPixelAsVectorUInt8_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image21SetPixelAsVectorInt16ERKSt6vectorIjSaIjEERKS2_IsSaIsEE"] + pub fn Image_SetPixelAsVectorInt16_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image22SetPixelAsVectorUInt16ERKSt6vectorIjSaIjEERKS2_ItSaItEE"] + pub fn Image_SetPixelAsVectorUInt16_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image21SetPixelAsVectorInt32ERKSt6vectorIjSaIjEERKS2_IiSaIiEE"] + pub fn Image_SetPixelAsVectorInt32_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image22SetPixelAsVectorUInt32ERKSt6vectorIjSaIjEES6_"] + pub fn Image_SetPixelAsVectorUInt32_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image21SetPixelAsVectorInt64ERKSt6vectorIjSaIjEERKS2_IlSaIlEE"] + pub fn Image_SetPixelAsVectorInt64_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image22SetPixelAsVectorUInt64ERKSt6vectorIjSaIjEERKS2_ImSaImEE"] + pub fn Image_SetPixelAsVectorUInt64_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image23SetPixelAsVectorFloat32ERKSt6vectorIjSaIjEERKS2_IfSaIfEE"] + pub fn Image_SetPixelAsVectorFloat32_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image23SetPixelAsVectorFloat64ERKSt6vectorIjSaIjEERKS2_IdSaIdEE"] + pub fn Image_SetPixelAsVectorFloat64_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image24SetPixelAsComplexFloat32ERKSt6vectorIjSaIjEESt7complexIfE"] + pub fn Image_SetPixelAsComplexFloat32_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: root::std::complex, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image24SetPixelAsComplexFloat64ERKSt6vectorIjSaIjEESt7complexIdE"] + pub fn Image_SetPixelAsComplexFloat64_bindgen_original( + this: *mut root::itk::simple::Image, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: root::std::complex, + ); + } + unsafe extern "C" { + #[doc = " \\brief Get a pointer to the image buffer\n \\warning this is dangerous\n\n The size of the buffer is the number of components*Xsize*Ysize\n and then Zsize of a 3D image. The buffer should be accessed as\n a 1-D array. For example a 3D image buffer should be accessed:\n \\code\n uint8_t *buffer = img->GetBufferAsUInt8();\n buffer[c + numComponents*(x+xSize*(y+ySize*z))]\n \\endcode\n\n The pointer to the buffer is not referenced\n counted. Additionally, while this image is made unique before\n returning the pointer, additional copying and usage may\n introduce unexpected aliasing of the image's buffer.\n\n Vector and Complex pixel types are both accessed via the\n appropriate component type method.\n\n The correct method for the current pixel type of the image must\n be called or else an exception will be generated. For vector\n pixel types the type of the component of the vector must be called.\n\n \\sa Image::GetPixelIDValue\n @{"] + #[link_name = "\u{1}_ZN3itk6simple5Image15GetBufferAsInt8Ev"] + pub fn Image_GetBufferAsInt8_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut i8; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16GetBufferAsUInt8Ev"] + pub fn Image_GetBufferAsUInt8_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut u8; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16GetBufferAsInt16Ev"] + pub fn Image_GetBufferAsInt16_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut i16; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image17GetBufferAsUInt16Ev"] + pub fn Image_GetBufferAsUInt16_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut u16; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16GetBufferAsInt32Ev"] + pub fn Image_GetBufferAsInt32_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut i32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image17GetBufferAsUInt32Ev"] + pub fn Image_GetBufferAsUInt32_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut u32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16GetBufferAsInt64Ev"] + pub fn Image_GetBufferAsInt64_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut i64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image17GetBufferAsUInt64Ev"] + pub fn Image_GetBufferAsUInt64_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut u64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image16GetBufferAsFloatEv"] + pub fn Image_GetBufferAsFloat_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut f32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image17GetBufferAsDoubleEv"] + pub fn Image_GetBufferAsDouble_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut f64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5Image15GetBufferAsVoidEv"] + pub fn Image_GetBufferAsVoid_bindgen_original( + this: *mut root::itk::simple::Image, + ) -> *mut ::std::os::raw::c_void; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetBufferAsInt8Ev"] + pub fn Image_GetBufferAsInt8_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const i8; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetBufferAsUInt8Ev"] + pub fn Image_GetBufferAsUInt8_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const u8; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetBufferAsInt16Ev"] + pub fn Image_GetBufferAsInt16_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const i16; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image17GetBufferAsUInt16Ev"] + pub fn Image_GetBufferAsUInt16_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const u16; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetBufferAsInt32Ev"] + pub fn Image_GetBufferAsInt32_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const i32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image17GetBufferAsUInt32Ev"] + pub fn Image_GetBufferAsUInt32_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const u32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetBufferAsInt64Ev"] + pub fn Image_GetBufferAsInt64_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const i64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image17GetBufferAsUInt64Ev"] + pub fn Image_GetBufferAsUInt64_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const u64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image16GetBufferAsFloatEv"] + pub fn Image_GetBufferAsFloat_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const f32; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image17GetBufferAsDoubleEv"] + pub fn Image_GetBufferAsDouble_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const f64; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple5Image15GetBufferAsVoidEv"] + pub fn Image_GetBufferAsVoid_bindgen_original1( + this: *const root::itk::simple::Image, + ) -> *const ::std::os::raw::c_void; + } + unsafe extern "C" { + #[doc = " \\brief Performs actually coping if needed to make object unique.\n\n The Image class by default performs lazy coping and\n assignment. This method make sure that coping actually happens\n to the itk::Image pointed to is only pointed to by this object."] + #[link_name = "\u{1}_ZN3itk6simple5Image10MakeUniqueEv"] + pub fn Image_MakeUnique_bindgen_original( + this: *mut root::itk::simple::Image, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns true if no other SimpleITK Image object\n refers to the same internal data structure."] + #[link_name = "\u{1}_ZNK3itk6simple5Image8IsUniqueEv"] + pub fn Image_IsUnique_bindgen_original( + this: *const root::itk::simple::Image, + ) -> bool; + } + unsafe extern "C" { + #[doc = " \\brief Methods called by the constructor to allocate and initialize\n an image.\n\n This method internally utilizes the member function factory to\n dispatch to methods instantiated on the image of the pixel ID"] + #[link_name = "\u{1}_ZN3itk6simple5Image8AllocateERKSt6vectorIjSaIjEENS0_16PixelIDValueEnumEj"] + pub fn Image_Allocate_bindgen_original( + this: *mut root::itk::simple::Image, + size: __bindgen_marker_Reference< + *const root::std::vector<::std::os::raw::c_uint>, + >, + valueEnum: root::itk::simple::PixelIDValueEnum, + numberOfComponents: ::std::os::raw::c_uint, + ); + } + unsafe extern "C" { + #[doc = " Method called by certain constructors to convert ITK images\n into SimpleITK ones.\n\n This is the single method which needs to be explicitly\n instantiated to separate the internal ITK and Pimple image from\n the external SimpleITK interface. Template parameters have been\n chosen carefully to flexibly enable this."] + #[link_name = "\u{1}_ZN3itk6simple5Image22InternalInitializationEijPNS_10DataObjectE"] + pub fn Image_InternalInitialization_bindgen_original( + this: *mut root::itk::simple::Image, + type_: root::itk::simple::PixelIDValueType, + dimension: ::std::os::raw::c_uint, + image: *mut root::itk::DataObject, + ); + } + unsafe extern "C" { + #[doc = " \\brief Default constructor, creates an image of size 0"] + #[link_name = "\u{1}_ZN3itk6simple5ImageC1Ev"] + pub fn Image_Image_bindgen_original(this: *mut root::itk::simple::Image); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5ImageC1ERKS1_"] + pub fn Image_Image_bindgen_original1( + this: *mut root::itk::simple::Image, + img: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Move constructor and assignment.\n\n @param img After the operation img is valid only for\n destructing and assignment; all other operations have undefined\n behavior."] + #[link_name = "\u{1}_ZN3itk6simple5ImageC1EOS1_"] + pub fn Image_Image_bindgen_original2( + this: *mut root::itk::simple::Image, + img: __bindgen_marker_RValueReference<*mut root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Constructors for 2D, 3D an optionally 4D images where\n pixel type and number of components can be specified.\n\n If the pixel type is a scalar or a label pixel type, then the\n number of components must be specified as 0 or 1.\n\n If the pixel type is a vector pixel type, then the number of\n components defaults to the image dimension, unless the\n numberOfComponents is explicitly specified.\n\n Unlike the standard convention for Dimensional Vectors the size\n parameter must be the exact dimension requesting. That is, it must be of\n length 2 of a 2D image, 3 for a 3D image and 4 for a 4D image.\n @{"] + #[link_name = "\u{1}_ZN3itk6simple5ImageC1EjjNS0_16PixelIDValueEnumE"] + pub fn Image_Image_bindgen_original3( + this: *mut root::itk::simple::Image, + width: ::std::os::raw::c_uint, + height: ::std::os::raw::c_uint, + valueEnum: root::itk::simple::PixelIDValueEnum, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5ImageC1EjjjNS0_16PixelIDValueEnumE"] + pub fn Image_Image_bindgen_original4( + this: *mut root::itk::simple::Image, + width: ::std::os::raw::c_uint, + height: ::std::os::raw::c_uint, + depth: ::std::os::raw::c_uint, + valueEnum: root::itk::simple::PixelIDValueEnum, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5ImageC1ERKSt6vectorIjSaIjEENS0_16PixelIDValueEnumEj"] + pub fn Image_Image_bindgen_original5( + this: *mut root::itk::simple::Image, + size: __bindgen_marker_Reference< + *const root::std::vector<::std::os::raw::c_uint>, + >, + valueEnum: root::itk::simple::PixelIDValueEnum, + numberOfComponents: ::std::os::raw::c_uint, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5ImageC1ESt10unique_ptrINS0_15PimpleImageBaseESt14default_deleteIS3_EE"] + pub fn Image_Image_bindgen_original6( + this: *mut root::itk::simple::Image, + pimpleImage: root::std::unique_ptr, + ); + } + impl Image { + #[inline] + pub unsafe fn ProxyForInPlaceOperation_bindgen_original_bindgen_original( + &mut self, + ) -> root::itk::simple::Image { + Image_ProxyForInPlaceOperation_bindgen_original(self) + } + #[inline] + pub unsafe fn GetITKBase_bindgen_original_bindgen_original( + &mut self, + ) -> *mut root::itk::DataObject { + Image_GetITKBase_bindgen_original(self) + } + #[inline] + pub unsafe fn GetITKBase_bindgen_original_bindgen_original1( + &self, + ) -> *const root::itk::DataObject { + Image_GetITKBase_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetPixelID_bindgen_original_bindgen_original( + &self, + ) -> root::itk::simple::PixelIDValueEnum { + Image_GetPixelID_bindgen_original(self) + } + #[inline] + pub unsafe fn GetPixelIDValue_bindgen_original_bindgen_original( + &self, + ) -> root::itk::simple::PixelIDValueType { + Image_GetPixelIDValue_bindgen_original(self) + } + #[inline] + pub unsafe fn GetPixelIDTypeAsString_bindgen_original_bindgen_original( + &self, + ) -> root::std::string { + Image_GetPixelIDTypeAsString_bindgen_original(self) + } + #[inline] + pub unsafe fn GetDimension_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Image_GetDimension_bindgen_original(self) + } + #[inline] + pub unsafe fn GetNumberOfComponentsPerPixel_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Image_GetNumberOfComponentsPerPixel_bindgen_original(self) + } + #[inline] + pub unsafe fn GetNumberOfPixels_bindgen_original_bindgen_original( + &self, + ) -> u64 { + Image_GetNumberOfPixels_bindgen_original(self) + } + #[inline] + pub unsafe fn GetSizeOfPixelComponent_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Image_GetSizeOfPixelComponent_bindgen_original(self) + } + #[inline] + pub unsafe fn GetOrigin_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + Image_GetOrigin_bindgen_original(self) + } + #[inline] + pub unsafe fn SetOrigin_bindgen_original_bindgen_original( + &mut self, + origin: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetOrigin_bindgen_original(self, origin) + } + #[inline] + pub unsafe fn GetSpacing_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + Image_GetSpacing_bindgen_original(self) + } + #[inline] + pub unsafe fn SetSpacing_bindgen_original_bindgen_original( + &mut self, + spacing: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetSpacing_bindgen_original(self, spacing) + } + #[inline] + pub unsafe fn GetDirection_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + Image_GetDirection_bindgen_original(self) + } + #[inline] + pub unsafe fn SetDirection_bindgen_original_bindgen_original( + &mut self, + direction: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetDirection_bindgen_original(self, direction) + } + #[inline] + pub unsafe fn TransformIndexToPhysicalPoint_bindgen_original_bindgen_original( + &self, + index: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_TransformIndexToPhysicalPoint_bindgen_original(self, index) + } + #[inline] + pub unsafe fn TransformPhysicalPointToIndex_bindgen_original_bindgen_original( + &self, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_TransformPhysicalPointToIndex_bindgen_original(self, point) + } + #[inline] + pub unsafe fn TransformPhysicalPointToContinuousIndex_bindgen_original_bindgen_original( + &self, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_TransformPhysicalPointToContinuousIndex_bindgen_original( + self, point, + ) + } + #[inline] + pub unsafe fn TransformContinuousIndexToPhysicalPoint_bindgen_original_bindgen_original( + &self, + index: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_TransformContinuousIndexToPhysicalPoint_bindgen_original( + self, index, + ) + } + #[inline] + pub unsafe fn EvaluateAtContinuousIndex_bindgen_original_bindgen_original( + &self, + index: __bindgen_marker_Reference<*const root::std::vector>, + interp: root::itk::simple::InterpolatorEnum, + ) -> root::std::vector { + Image_EvaluateAtContinuousIndex_bindgen_original(self, index, interp) + } + #[inline] + pub unsafe fn EvaluateAtPhysicalPoint_bindgen_original_bindgen_original( + &self, + point: __bindgen_marker_Reference<*const root::std::vector>, + interp: root::itk::simple::InterpolatorEnum, + ) -> root::std::vector { + Image_EvaluateAtPhysicalPoint_bindgen_original(self, point, interp) + } + #[inline] + pub unsafe fn IsCongruentImageGeometry_bindgen_original_bindgen_original( + &self, + otherImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + coordinateTolerance: f64, + directionTolerance: f64, + ) -> bool { + Image_IsCongruentImageGeometry_bindgen_original( + self, + otherImage, + coordinateTolerance, + directionTolerance, + ) + } + #[inline] + pub unsafe fn IsSameImageGeometryAs_bindgen_original_bindgen_original( + &self, + otherImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + arg1: f64, + arg2: f64, + ) -> bool { + Image_IsSameImageGeometryAs_bindgen_original( + self, otherImage, arg1, arg2, + ) + } + #[inline] + pub unsafe fn GetSize_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector<::std::os::raw::c_uint> { + Image_GetSize_bindgen_original(self) + } + #[inline] + pub unsafe fn GetWidth_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Image_GetWidth_bindgen_original(self) + } + #[inline] + pub unsafe fn GetHeight_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Image_GetHeight_bindgen_original(self) + } + #[inline] + pub unsafe fn GetDepth_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Image_GetDepth_bindgen_original(self) + } + #[inline] + pub unsafe fn CopyInformation_bindgen_original_bindgen_original( + &mut self, + srcImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) { + Image_CopyInformation_bindgen_original(self, srcImage) + } + #[inline] + pub unsafe fn GetMetaDataKeys_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + Image_GetMetaDataKeys_bindgen_original(self) + } + #[inline] + pub unsafe fn HasMetaDataKey_bindgen_original_bindgen_original( + &self, + key: __bindgen_marker_Reference<*const root::std::string>, + ) -> bool { + Image_HasMetaDataKey_bindgen_original(self, key) + } + #[inline] + pub unsafe fn GetMetaData_bindgen_original_bindgen_original( + &self, + key: __bindgen_marker_Reference<*const root::std::string>, + ) -> root::std::string { + Image_GetMetaData_bindgen_original(self, key) + } + #[inline] + pub unsafe fn SetMetaData_bindgen_original_bindgen_original( + &mut self, + key: __bindgen_marker_Reference<*const root::std::string>, + value: __bindgen_marker_Reference<*const root::std::string>, + ) { + Image_SetMetaData_bindgen_original(self, key, value) + } + #[inline] + pub unsafe fn EraseMetaData_bindgen_original_bindgen_original( + &mut self, + key: __bindgen_marker_Reference<*const root::std::string>, + ) -> bool { + Image_EraseMetaData_bindgen_original(self, key) + } + #[inline] + pub unsafe fn ToString_bindgen_original_bindgen_original( + &self, + ) -> root::std::string { + Image_ToString_bindgen_original(self) + } + #[inline] + pub unsafe fn ToVectorImage_bindgen_original_bindgen_original( + &mut self, + inPlace: bool, + ) -> root::itk::simple::Image { + Image_ToVectorImage_bindgen_original(self, inPlace) + } + #[inline] + pub unsafe fn ToScalarImage_bindgen_original_bindgen_original( + &mut self, + inPlace: bool, + ) -> root::itk::simple::Image { + Image_ToScalarImage_bindgen_original(self, inPlace) + } + #[inline] + pub unsafe fn GetPixelAsInt8_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i8 { + Image_GetPixelAsInt8_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsUInt8_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u8 { + Image_GetPixelAsUInt8_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsInt16_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i16 { + Image_GetPixelAsInt16_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsUInt16_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u16 { + Image_GetPixelAsUInt16_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsInt32_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i32 { + Image_GetPixelAsInt32_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsUInt32_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u32 { + Image_GetPixelAsUInt32_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsInt64_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> i64 { + Image_GetPixelAsInt64_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsUInt64_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> u64 { + Image_GetPixelAsUInt64_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsFloat_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> f32 { + Image_GetPixelAsFloat_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsDouble_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> f64 { + Image_GetPixelAsDouble_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorInt8_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorInt8_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorUInt8_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorUInt8_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorInt16_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorInt16_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorUInt16_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorUInt16_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorInt32_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorInt32_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorUInt32_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorUInt32_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorInt64_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorInt64_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorUInt64_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorUInt64_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorFloat32_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorFloat32_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsVectorFloat64_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Image_GetPixelAsVectorFloat64_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsComplexFloat32_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::complex { + Image_GetPixelAsComplexFloat32_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn GetPixelAsComplexFloat64_bindgen_original_bindgen_original( + &self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::complex { + Image_GetPixelAsComplexFloat64_bindgen_original(self, idx) + } + #[inline] + pub unsafe fn SetPixelAsInt8_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i8, + ) { + Image_SetPixelAsInt8_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsUInt8_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u8, + ) { + Image_SetPixelAsUInt8_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsInt16_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i16, + ) { + Image_SetPixelAsInt16_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsUInt16_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u16, + ) { + Image_SetPixelAsUInt16_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsInt32_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i32, + ) { + Image_SetPixelAsInt32_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsUInt32_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u32, + ) { + Image_SetPixelAsUInt32_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsInt64_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: i64, + ) { + Image_SetPixelAsInt64_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsUInt64_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: u64, + ) { + Image_SetPixelAsUInt64_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsFloat_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: f32, + ) { + Image_SetPixelAsFloat_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsDouble_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: f64, + ) { + Image_SetPixelAsDouble_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorInt8_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorInt8_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorUInt8_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorUInt8_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorInt16_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorInt16_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorUInt16_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorUInt16_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorInt32_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorInt32_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorUInt32_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorUInt32_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorInt64_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorInt64_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorUInt64_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorUInt64_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorFloat32_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorFloat32_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsVectorFloat64_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Image_SetPixelAsVectorFloat64_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsComplexFloat32_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: root::std::complex, + ) { + Image_SetPixelAsComplexFloat32_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn SetPixelAsComplexFloat64_bindgen_original_bindgen_original( + &mut self, + idx: __bindgen_marker_Reference<*const root::std::vector>, + v: root::std::complex, + ) { + Image_SetPixelAsComplexFloat64_bindgen_original(self, idx, v) + } + #[inline] + pub unsafe fn GetBufferAsInt8_bindgen_original_bindgen_original( + &mut self, + ) -> *mut i8 { + Image_GetBufferAsInt8_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt8_bindgen_original_bindgen_original( + &mut self, + ) -> *mut u8 { + Image_GetBufferAsUInt8_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsInt16_bindgen_original_bindgen_original( + &mut self, + ) -> *mut i16 { + Image_GetBufferAsInt16_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt16_bindgen_original_bindgen_original( + &mut self, + ) -> *mut u16 { + Image_GetBufferAsUInt16_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsInt32_bindgen_original_bindgen_original( + &mut self, + ) -> *mut i32 { + Image_GetBufferAsInt32_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt32_bindgen_original_bindgen_original( + &mut self, + ) -> *mut u32 { + Image_GetBufferAsUInt32_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsInt64_bindgen_original_bindgen_original( + &mut self, + ) -> *mut i64 { + Image_GetBufferAsInt64_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt64_bindgen_original_bindgen_original( + &mut self, + ) -> *mut u64 { + Image_GetBufferAsUInt64_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsFloat_bindgen_original_bindgen_original( + &mut self, + ) -> *mut f32 { + Image_GetBufferAsFloat_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsDouble_bindgen_original_bindgen_original( + &mut self, + ) -> *mut f64 { + Image_GetBufferAsDouble_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsVoid_bindgen_original_bindgen_original( + &mut self, + ) -> *mut ::std::os::raw::c_void { + Image_GetBufferAsVoid_bindgen_original(self) + } + #[inline] + pub unsafe fn GetBufferAsInt8_bindgen_original_bindgen_original1( + &self, + ) -> *const i8 { + Image_GetBufferAsInt8_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt8_bindgen_original_bindgen_original1( + &self, + ) -> *const u8 { + Image_GetBufferAsUInt8_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsInt16_bindgen_original_bindgen_original1( + &self, + ) -> *const i16 { + Image_GetBufferAsInt16_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt16_bindgen_original_bindgen_original1( + &self, + ) -> *const u16 { + Image_GetBufferAsUInt16_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsInt32_bindgen_original_bindgen_original1( + &self, + ) -> *const i32 { + Image_GetBufferAsInt32_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt32_bindgen_original_bindgen_original1( + &self, + ) -> *const u32 { + Image_GetBufferAsUInt32_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsInt64_bindgen_original_bindgen_original1( + &self, + ) -> *const i64 { + Image_GetBufferAsInt64_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsUInt64_bindgen_original_bindgen_original1( + &self, + ) -> *const u64 { + Image_GetBufferAsUInt64_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsFloat_bindgen_original_bindgen_original1( + &self, + ) -> *const f32 { + Image_GetBufferAsFloat_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsDouble_bindgen_original_bindgen_original1( + &self, + ) -> *const f64 { + Image_GetBufferAsDouble_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetBufferAsVoid_bindgen_original_bindgen_original1( + &self, + ) -> *const ::std::os::raw::c_void { + Image_GetBufferAsVoid_bindgen_original1(self) + } + #[inline] + pub unsafe fn MakeUnique_bindgen_original_bindgen_original(&mut self) { + Image_MakeUnique_bindgen_original(self) + } + #[inline] + pub unsafe fn IsUnique_bindgen_original_bindgen_original(&self) -> bool { + Image_IsUnique_bindgen_original(self) + } + #[inline] + pub unsafe fn Allocate_bindgen_original_bindgen_original( + &mut self, + size: __bindgen_marker_Reference< + *const root::std::vector<::std::os::raw::c_uint>, + >, + valueEnum: root::itk::simple::PixelIDValueEnum, + numberOfComponents: ::std::os::raw::c_uint, + ) { + Image_Allocate_bindgen_original( + self, + size, + valueEnum, + numberOfComponents, + ) + } + #[inline] + pub unsafe fn InternalInitialization_bindgen_original_bindgen_original( + &mut self, + type_: root::itk::simple::PixelIDValueType, + dimension: ::std::os::raw::c_uint, + image: *mut root::itk::DataObject, + ) { + Image_InternalInitialization_bindgen_original( + self, type_, dimension, image, + ) + } + #[inline] + pub unsafe fn new_bindgen_original() -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Image_Image_bindgen_original(__bindgen_tmp.as_mut_ptr()); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original1( + img: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Image_Image_bindgen_original1(__bindgen_tmp.as_mut_ptr(), img); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original2( + img: __bindgen_marker_RValueReference<*mut root::itk::simple::Image>, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Image_Image_bindgen_original2(__bindgen_tmp.as_mut_ptr(), img); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original3( + width: ::std::os::raw::c_uint, + height: ::std::os::raw::c_uint, + valueEnum: root::itk::simple::PixelIDValueEnum, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Image_Image_bindgen_original3( + __bindgen_tmp.as_mut_ptr(), + width, + height, + valueEnum, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original4( + width: ::std::os::raw::c_uint, + height: ::std::os::raw::c_uint, + depth: ::std::os::raw::c_uint, + valueEnum: root::itk::simple::PixelIDValueEnum, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Image_Image_bindgen_original4( + __bindgen_tmp.as_mut_ptr(), + width, + height, + depth, + valueEnum, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original5( + size: __bindgen_marker_Reference< + *const root::std::vector<::std::os::raw::c_uint>, + >, + valueEnum: root::itk::simple::PixelIDValueEnum, + numberOfComponents: ::std::os::raw::c_uint, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Image_Image_bindgen_original5( + __bindgen_tmp.as_mut_ptr(), + size, + valueEnum, + numberOfComponents, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original6( + pimpleImage: root::std::unique_ptr, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Image_Image_bindgen_original6(__bindgen_tmp.as_mut_ptr(), pimpleImage); + __bindgen_tmp.assume_init() + } + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple5ImageD1Ev"] + pub fn Image_Image_destructor_bindgen_original( + this: *mut root::itk::simple::Image, + ); + } + #[repr(C)] + pub struct PimpleTransformBase { + _unused: [u8; 0], + } + #[repr(i32)] + #[derive(Clone, Hash, PartialEq, Eq)] + pub enum TransformEnum { + sitkUnknownTransform = -1, + sitkIdentity = 0, + sitkTranslation = 1, + sitkScale = 2, + sitkScaleLogarithmic = 3, + sitkEuler = 4, + sitkSimilarity = 5, + sitkQuaternionRigid = 6, + sitkVersor = 7, + sitkVersorRigid = 8, + sitkScaleSkewVersor = 9, + sitkComposeScaleSkewVersor = 10, + sitkScaleVersor = 11, + sitkAffine = 12, + sitkComposite = 13, + sitkDisplacementField = 14, + sitkBSplineTransform = 15, + } + #[repr(C)] + pub struct Transform__bindgen_vtable(::std::os::raw::c_void); + #[doc = " \\class Transform\n \\brief A simplified wrapper around a variety of ITK transforms.\n\n The interface to ITK transform objects to be used with the\n ImageRegistrationMethod, ResampleImageFilter and other SimpleITK\n process objects. The transforms are designed to have a serialized\n array of parameters to facilitate optimization for registration.\n\n Provides a base class interface to any type of ITK\n transform. Objects of this type may have their interface converted\n to a derived interface while keeping the same reference to the ITK\n object.\n\n Additionally, this class provides a basic interface to a composite\n transforms.\n\n \\sa itk::CompositeTransform"] + #[repr(C)] + pub struct Transform { + pub vtable_: *const Transform__bindgen_vtable, + m_PimpleTransform: + root::std::unique_ptr, + } + #[repr(C)] + pub struct Transform_TransformTryCastVisitor { + pub transform: *mut root::itk::TransformBase, + pub that: *mut root::itk::simple::Transform, + } + #[repr(C)] + pub struct Transform_DisplacementInitializationMemberFunctionAddressor { + pub _address: u8, + } + pub type Transform_DisplacementInitializationMemberFunctionAddressor_ObjectType = + root::detail::FunctionTraits; + unsafe extern "C" { + #[doc = " Get access to internal ITK data object.\n\n The return value should immediately be assigned to as\n itk::SmartPointer.\n\n In many cases the value may need to be dynamically cast to\n the actual transform type.\n\n @{"] + #[link_name = "\u{1}_ZN3itk6simple9Transform10GetITKBaseEv"] + pub fn Transform_GetITKBase_bindgen_original( + this: *mut root::itk::simple::Transform, + ) -> *mut root::itk::TransformBase; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple9Transform10GetITKBaseEv"] + pub fn Transform_GetITKBase_bindgen_original1( + this: *const root::itk::simple::Transform, + ) -> *const root::itk::TransformBase; + } + unsafe extern "C" { + #[doc = " Return the dimension of the Transform ( 2D or 3D )"] + #[link_name = "\u{1}_ZNK3itk6simple9Transform12GetDimensionEv"] + pub fn Transform_GetDimension_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " Set/Get Transform Parameter\n @{"] + #[link_name = "\u{1}_ZN3itk6simple9Transform13SetParametersERKSt6vectorIdSaIdEE"] + pub fn Transform_SetParameters_bindgen_original( + this: *mut root::itk::simple::Transform, + parameters: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple9Transform13GetParametersEv"] + pub fn Transform_GetParameters_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Return the number of optimizable parameters"] + #[link_name = "\u{1}_ZNK3itk6simple9Transform21GetNumberOfParametersEv"] + pub fn Transform_GetNumberOfParameters_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " Set/Get Fixed Transform Parameter\n @{"] + #[link_name = "\u{1}_ZN3itk6simple9Transform18SetFixedParametersERKSt6vectorIdSaIdEE"] + pub fn Transform_SetFixedParameters_bindgen_original( + this: *mut root::itk::simple::Transform, + parameters: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple9Transform18GetFixedParametersEv"] + pub fn Transform_GetFixedParameters_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Get the number of fixed parameters"] + #[link_name = "\u{1}_ZNK3itk6simple9Transform26GetNumberOfFixedParametersEv"] + pub fn Transform_GetNumberOfFixedParameters_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " Apply transform to a point.\n\n The dimension of the point must match the transform."] + #[link_name = "\u{1}_ZNK3itk6simple9Transform14TransformPointERKSt6vectorIdSaIdEE"] + pub fn Transform_TransformPoint_bindgen_original( + this: *const root::itk::simple::Transform, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " Apply transform to a vector at a point.\n\n The ITK concept of a vector is a direction at a specific point,\n for example the difference between two points is a vector.\n\n For linear transforms the point does not matter, in general\n the vector is transformed by the Jacobian with respect to point\n position.\n\n The dimension of the vector and point must match the transform."] + #[link_name = "\u{1}_ZNK3itk6simple9Transform15TransformVectorERKSt6vectorIdSaIdEES6_"] + pub fn Transform_TransformVector_bindgen_original( + this: *const root::itk::simple::Transform, + vector: __bindgen_marker_Reference<*const root::std::vector>, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple9Transform14WriteTransformERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn Transform_WriteTransform_bindgen_original( + this: *const root::itk::simple::Transform, + filename: __bindgen_marker_Reference<*const root::std::string>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Return a new inverse transform of the same type as this.\n\n Creates a new transform object and tries to set the value to the\n inverse. As not all transform types have inverse and some\n transforms are not invertible, an exception will be throw is\n there is no inverse."] + #[link_name = "\u{1}_ZNK3itk6simple9Transform10GetInverseEv"] + pub fn Transform_GetInverse_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> root::itk::simple::Transform; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple9Transform8ToStringB5cxx11Ev"] + pub fn Transform_ToString_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Performs actually coping if needed to make object unique.\n\n The Transform class by default performs lazy coping and\n assignment. This method make sure that coping actually happens\n to the itk::Transform pointed to is only pointed to by this\n object."] + #[link_name = "\u{1}_ZN3itk6simple9Transform10MakeUniqueEv"] + pub fn Transform_MakeUnique_bindgen_original( + this: *mut root::itk::simple::Transform, + ); + } + unsafe extern "C" { + #[doc = " \\brief Get the TransformEnum of the underlying Transform.\n\n A SimpleITK Transform object can internally hold any ITK transform. This\n method returns the TransformEnum representing the internal ITK\n transform. This value may be used to identify which SimpleITK\n class the transform can be converted to."] + #[link_name = "\u{1}_ZNK3itk6simple9Transform16GetTransformEnumEv"] + pub fn Transform_GetTransformEnum_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> root::itk::simple::TransformEnum; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple9Transform22InternalInitializationEPNS_21TransformBaseTemplateIdEE"] + pub fn Transform_InternalInitialization_bindgen_original( + this: *mut root::itk::simple::Transform, + base: *mut root::itk::TransformBase, + ); + } + unsafe extern "C" { + #[doc = " \\brief By default a 3-d identity transform is constructed"] + #[link_name = "\u{1}_ZN3itk6simple9TransformC1Ev"] + pub fn Transform_Transform_bindgen_original( + this: *mut root::itk::simple::Transform, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple9TransformC1EPNS_21TransformBaseTemplateIdEE"] + pub fn Transform_Transform_bindgen_original1( + this: *mut root::itk::simple::Transform, + transform: *mut root::itk::TransformBase, + ); + } + unsafe extern "C" { + #[doc = " \\brief Construct a specific transformation\n\n \\deprecated This constructor will be removed in future releases."] + #[link_name = "\u{1}_ZN3itk6simple9TransformC1EjNS0_13TransformEnumE"] + pub fn Transform_Transform_bindgen_original2( + this: *mut root::itk::simple::Transform, + dimensions: ::std::os::raw::c_uint, + type_: root::itk::simple::TransformEnum, + ); + } + unsafe extern "C" { + #[doc = " \\brief Use an image to construct a transform.\n\n The input displacement image is transferred to the constructed\n transform object. The input image is modified to be a default\n constructed Image object.\n\n Only the sitkDisplacementField transformation type can currently\n be constructed this way. Image must be of sitkVectorFloat64 pixel\n type with the number of components equal to the image dimension.\n\n \\deprecated This constructor will be removed in future releases."] + #[link_name = "\u{1}_ZN3itk6simple9TransformC1ERNS0_5ImageENS0_13TransformEnumE"] + pub fn Transform_Transform_bindgen_original3( + this: *mut root::itk::simple::Transform, + displacement: __bindgen_marker_Reference<*mut root::itk::simple::Image>, + type_: root::itk::simple::TransformEnum, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple9TransformC1ERKS1_"] + pub fn Transform_Transform_bindgen_original4( + this: *mut root::itk::simple::Transform, + arg1: __bindgen_marker_Reference<*const root::itk::simple::Transform>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple9TransformC1EPNS0_19PimpleTransformBaseE"] + pub fn Transform_Transform_bindgen_original5( + this: *mut root::itk::simple::Transform, + pimpleTransform: *mut root::itk::simple::PimpleTransformBase, + ); + } + impl Transform { + #[inline] + pub unsafe fn GetITKBase_bindgen_original_bindgen_original( + &mut self, + ) -> *mut root::itk::TransformBase { + Transform_GetITKBase_bindgen_original(self) + } + #[inline] + pub unsafe fn GetITKBase_bindgen_original_bindgen_original1( + &self, + ) -> *const root::itk::TransformBase { + Transform_GetITKBase_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetDimension_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Transform_GetDimension_bindgen_original(self) + } + #[inline] + pub unsafe fn SetParameters_bindgen_original_bindgen_original( + &mut self, + parameters: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Transform_SetParameters_bindgen_original(self, parameters) + } + #[inline] + pub unsafe fn GetParameters_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + Transform_GetParameters_bindgen_original(self) + } + #[inline] + pub unsafe fn GetNumberOfParameters_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Transform_GetNumberOfParameters_bindgen_original(self) + } + #[inline] + pub unsafe fn SetFixedParameters_bindgen_original_bindgen_original( + &mut self, + parameters: __bindgen_marker_Reference<*const root::std::vector>, + ) { + Transform_SetFixedParameters_bindgen_original(self, parameters) + } + #[inline] + pub unsafe fn GetFixedParameters_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + Transform_GetFixedParameters_bindgen_original(self) + } + #[inline] + pub unsafe fn GetNumberOfFixedParameters_bindgen_original_bindgen_original( + &self, + ) -> ::std::os::raw::c_uint { + Transform_GetNumberOfFixedParameters_bindgen_original(self) + } + #[inline] + pub unsafe fn TransformPoint_bindgen_original_bindgen_original( + &self, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Transform_TransformPoint_bindgen_original(self, point) + } + #[inline] + pub unsafe fn TransformVector_bindgen_original_bindgen_original( + &self, + vector: __bindgen_marker_Reference<*const root::std::vector>, + point: __bindgen_marker_Reference<*const root::std::vector>, + ) -> root::std::vector { + Transform_TransformVector_bindgen_original(self, vector, point) + } + #[inline] + pub unsafe fn WriteTransform_bindgen_original_bindgen_original( + &self, + filename: __bindgen_marker_Reference<*const root::std::string>, + ) { + Transform_WriteTransform_bindgen_original(self, filename) + } + #[inline] + pub unsafe fn GetInverse_bindgen_original_bindgen_original( + &self, + ) -> root::itk::simple::Transform { + Transform_GetInverse_bindgen_original(self) + } + #[inline] + pub unsafe fn ToString_bindgen_original_bindgen_original( + &self, + ) -> root::std::string { + Transform_ToString_bindgen_original(self) + } + #[inline] + pub unsafe fn MakeUnique_bindgen_original_bindgen_original(&mut self) { + Transform_MakeUnique_bindgen_original(self) + } + #[inline] + pub unsafe fn GetTransformEnum_bindgen_original_bindgen_original( + &self, + ) -> root::itk::simple::TransformEnum { + Transform_GetTransformEnum_bindgen_original(self) + } + #[inline] + pub unsafe fn InternalInitialization_bindgen_original_bindgen_original( + &mut self, + base: *mut root::itk::TransformBase, + ) { + Transform_InternalInitialization_bindgen_original(self, base) + } + #[inline] + pub unsafe fn new_bindgen_original() -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Transform_Transform_bindgen_original(__bindgen_tmp.as_mut_ptr()); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original1( + transform: *mut root::itk::TransformBase, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Transform_Transform_bindgen_original1( + __bindgen_tmp.as_mut_ptr(), + transform, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original2( + dimensions: ::std::os::raw::c_uint, + type_: root::itk::simple::TransformEnum, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Transform_Transform_bindgen_original2( + __bindgen_tmp.as_mut_ptr(), + dimensions, + type_, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original3( + displacement: __bindgen_marker_Reference<*mut root::itk::simple::Image>, + type_: root::itk::simple::TransformEnum, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Transform_Transform_bindgen_original3( + __bindgen_tmp.as_mut_ptr(), + displacement, + type_, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original4( + arg1: __bindgen_marker_Reference<*const root::itk::simple::Transform>, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Transform_Transform_bindgen_original4(__bindgen_tmp.as_mut_ptr(), arg1); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original5( + pimpleTransform: *mut root::itk::simple::PimpleTransformBase, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Transform_Transform_bindgen_original5( + __bindgen_tmp.as_mut_ptr(), + pimpleTransform, + ); + __bindgen_tmp.assume_init() + } + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple9TransformD1Ev"] + pub fn Transform_Transform_destructor_bindgen_original( + this: *mut root::itk::simple::Transform, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple9Transform8IsLinearEv"] + pub fn Transform_IsLinear_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> bool; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple9Transform11SetIdentityEv"] + pub fn Transform_SetIdentity_bindgen_original( + this: *mut root::itk::simple::Transform, + ); + } + unsafe extern "C" { + #[doc = " \\brief Try to change the current transform to it's inverse.\n\n If the transform has an inverse, i.e. non-singular linear\n transforms, then a new ITK transform is created of the same type\n and this object is set to it.\n\n However not all transform have a direct inverse, if the inverse\n does not exist or fails false will be returned and this transform\n will not be modified."] + #[link_name = "\u{1}_ZN3itk6simple9Transform10SetInverseEv"] + pub fn Transform_SetInverse_bindgen_original( + this: *mut root::itk::simple::Transform, + ) -> bool; + } + unsafe extern "C" { + #[doc = " return user readable name for the SimpleITK transform"] + #[link_name = "\u{1}_ZNK3itk6simple9Transform7GetNameB5cxx11Ev"] + pub fn Transform_GetName_bindgen_original( + this: *const root::itk::simple::Transform, + ) -> root::std::string; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple9Transform18SetPimpleTransformEOSt10unique_ptrINS0_19PimpleTransformBaseESt14default_deleteIS3_EE"] + pub fn Transform_SetPimpleTransform_bindgen_original( + this: *mut root::itk::simple::Transform, + pimpleTransform: __bindgen_marker_RValueReference< + *mut root::std::unique_ptr, + >, + ); + } + unsafe extern "C" { + #[doc = " \\brief itk::simple::ResampleImageFilter Procedural Interface\n\n These functions call the execute method of ResampleImageFilter\n in order to support a procedural API.\n\n The difference between the three functions is in the way the output\n image's domain parameters are specified (origin, spacing,\n direction). The first function uses the parameters from the input image,\n the second uses the parameters of a reference image, and the third uses\n explicitly specified parameters.\n\n \\sa itk::simple::ResampleImageFilter for the object oriented interface\n @{"] + #[link_name = "\u{1}_ZN3itk6simple8ResampleERKNS0_5ImageENS0_9TransformENS0_16InterpolatorEnumEdNS0_16PixelIDValueEnumEb"] + pub fn Resample_bindgen_original( + image1: __bindgen_marker_Reference<*const root::itk::simple::Image>, + transform: root::itk::simple::Transform, + interpolator: root::itk::simple::InterpolatorEnum, + defaultPixelValue: f64, + outputPixelType: root::itk::simple::PixelIDValueEnum, + useNearestNeighborExtrapolator: bool, + ) -> root::itk::simple::Image; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple8ResampleERKNS0_5ImageES3_NS0_9TransformENS0_16InterpolatorEnumEdNS0_16PixelIDValueEnumEb"] + pub fn Resample_bindgen_original1( + image1: __bindgen_marker_Reference<*const root::itk::simple::Image>, + referenceImage: __bindgen_marker_Reference< + *const root::itk::simple::Image, + >, + transform: root::itk::simple::Transform, + interpolator: root::itk::simple::InterpolatorEnum, + defaultPixelValue: f64, + outputPixelType: root::itk::simple::PixelIDValueEnum, + useNearestNeighborExtrapolator: bool, + ) -> root::itk::simple::Image; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple8ResampleERKNS0_5ImageERKSt6vectorIjSaIjEENS0_9TransformENS0_16InterpolatorEnumERKS4_IdSaIdEESE_SE_dNS0_16PixelIDValueEnumEb"] + pub fn Resample_bindgen_original2( + image1: __bindgen_marker_Reference<*const root::itk::simple::Image>, + size: __bindgen_marker_Reference<*const root::std::vector>, + transform: root::itk::simple::Transform, + interpolator: root::itk::simple::InterpolatorEnum, + outputOrigin: __bindgen_marker_Reference<*const root::std::vector>, + outputSpacing: __bindgen_marker_Reference< + *const root::std::vector, + >, + outputDirection: __bindgen_marker_Reference< + *const root::std::vector, + >, + defaultPixelValue: f64, + outputPixelType: root::itk::simple::PixelIDValueEnum, + useNearestNeighborExtrapolator: bool, + ) -> root::itk::simple::Image; + } + #[doc = " \\class AffineTransform\n \\brief An affine transformation about a fixed center with\n translation for a 2D or 3D coordinate.\n\n \\sa itk::AffineTransform"] + #[repr(C)] + pub struct AffineTransform { + pub _base: root::itk::simple::Transform, + m_pfSetCenter: + __bindgen_marker_Opaque>, + m_pfGetCenter: + __bindgen_marker_Opaque>, + m_pfSetMatrix: + __bindgen_marker_Opaque>, + m_pfGetMatrix: + __bindgen_marker_Opaque>, + m_pfSetTranslation: + __bindgen_marker_Opaque>, + m_pfGetTranslation: + __bindgen_marker_Opaque>, + m_pfScale1: + __bindgen_marker_Opaque>, + m_pfScale2: + __bindgen_marker_Opaque>, + m_pfShear: __bindgen_marker_Opaque>, + m_pfTranslate: + __bindgen_marker_Opaque>, + m_pfRotate: + __bindgen_marker_Opaque>, + } + #[doc = " \\class Transform\n \\brief A simplified wrapper around a variety of ITK transforms.\n\n The interface to ITK transform objects to be used with the\n ImageRegistrationMethod, ResampleImageFilter and other SimpleITK\n process objects. The transforms are designed to have a serialized\n array of parameters to facilitate optimization for registration.\n\n Provides a base class interface to any type of ITK\n transform. Objects of this type may have their interface converted\n to a derived interface while keeping the same reference to the ITK\n object.\n\n Additionally, this class provides a basic interface to a composite\n transforms.\n\n \\sa itk::CompositeTransform"] + pub type AffineTransform_Superclass = root::itk::simple::Transform; + #[repr(C)] + pub struct AffineTransform_MyVisitor { + pub transform: *mut root::itk::TransformBase, + pub that: *mut root::itk::simple::AffineTransform, + } + unsafe extern "C" { + #[doc = " parameters"] + #[link_name = "\u{1}_ZNK3itk6simple15AffineTransform14GetTranslationEv"] + pub fn AffineTransform_GetTranslation_bindgen_original( + this: *const root::itk::simple::AffineTransform, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform14SetTranslationERKSt6vectorIdSaIdEE"] + pub fn AffineTransform_SetTranslation_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + translation: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform9SetMatrixERKSt6vectorIdSaIdEE"] + pub fn AffineTransform_SetMatrix_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + matrix: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple15AffineTransform9GetMatrixEv"] + pub fn AffineTransform_GetMatrix_bindgen_original( + this: *const root::itk::simple::AffineTransform, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " fixed parameter"] + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform9SetCenterERKSt6vectorIdSaIdEE"] + pub fn AffineTransform_SetCenter_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + params: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple15AffineTransform9GetCenterEv"] + pub fn AffineTransform_GetCenter_bindgen_original( + this: *const root::itk::simple::AffineTransform, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " additional methods"] + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform5ScaleERKSt6vectorIdSaIdEEb"] + pub fn AffineTransform_Scale_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + factor: __bindgen_marker_Reference<*const root::std::vector>, + pre: bool, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform5ScaleEdb"] + pub fn AffineTransform_Scale_bindgen_original1( + this: *mut root::itk::simple::AffineTransform, + factor: f64, + pre: bool, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform5ShearEiidb"] + pub fn AffineTransform_Shear_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + axis1: ::std::os::raw::c_int, + axis2: ::std::os::raw::c_int, + coef: f64, + pre: bool, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform9TranslateERKSt6vectorIdSaIdEEb"] + pub fn AffineTransform_Translate_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + offset: __bindgen_marker_Reference<*const root::std::vector>, + pre: bool, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform6RotateEiidb"] + pub fn AffineTransform_Rotate_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + axis1: ::std::os::raw::c_int, + axis2: ::std::os::raw::c_int, + angle: f64, + pre: bool, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform22InternalInitializationEPNS_21TransformBaseTemplateIdEE"] + pub fn AffineTransform_InternalInitialization_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + transform: *mut root::itk::TransformBase, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransformC1Ej"] + pub fn AffineTransform_AffineTransform_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + dimensions: ::std::os::raw::c_uint, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransformC1ERKS1_"] + pub fn AffineTransform_AffineTransform_bindgen_original1( + this: *mut root::itk::simple::AffineTransform, + arg1: __bindgen_marker_Reference< + *const root::itk::simple::AffineTransform, + >, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransformC1ERKNS0_9TransformE"] + pub fn AffineTransform_AffineTransform_bindgen_original2( + this: *mut root::itk::simple::AffineTransform, + arg1: __bindgen_marker_Reference<*const root::itk::simple::Transform>, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransformC1ERKSt6vectorIdSaIdEES6_S6_"] + pub fn AffineTransform_AffineTransform_bindgen_original3( + this: *mut root::itk::simple::AffineTransform, + matrix: __bindgen_marker_Reference<*const root::std::vector>, + translation: __bindgen_marker_Reference<*const root::std::vector>, + fixedCenter: __bindgen_marker_Reference<*const root::std::vector>, + ); + } + impl AffineTransform { + #[inline] + pub unsafe fn GetTranslation_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + AffineTransform_GetTranslation_bindgen_original(self) + } + #[inline] + pub unsafe fn SetTranslation_bindgen_original_bindgen_original( + &mut self, + translation: __bindgen_marker_Reference<*const root::std::vector>, + ) { + AffineTransform_SetTranslation_bindgen_original(self, translation) + } + #[inline] + pub unsafe fn SetMatrix_bindgen_original_bindgen_original( + &mut self, + matrix: __bindgen_marker_Reference<*const root::std::vector>, + ) { + AffineTransform_SetMatrix_bindgen_original(self, matrix) + } + #[inline] + pub unsafe fn GetMatrix_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + AffineTransform_GetMatrix_bindgen_original(self) + } + #[inline] + pub unsafe fn SetCenter_bindgen_original_bindgen_original( + &mut self, + params: __bindgen_marker_Reference<*const root::std::vector>, + ) { + AffineTransform_SetCenter_bindgen_original(self, params) + } + #[inline] + pub unsafe fn GetCenter_bindgen_original_bindgen_original( + &self, + ) -> root::std::vector { + AffineTransform_GetCenter_bindgen_original(self) + } + #[inline] + pub unsafe fn Scale_bindgen_original_bindgen_original( + &mut self, + factor: __bindgen_marker_Reference<*const root::std::vector>, + pre: bool, + ) { + AffineTransform_Scale_bindgen_original(self, factor, pre) + } + #[inline] + pub unsafe fn Scale_bindgen_original_bindgen_original1( + &mut self, + factor: f64, + pre: bool, + ) { + AffineTransform_Scale_bindgen_original1(self, factor, pre) + } + #[inline] + pub unsafe fn Shear_bindgen_original_bindgen_original( + &mut self, + axis1: ::std::os::raw::c_int, + axis2: ::std::os::raw::c_int, + coef: f64, + pre: bool, + ) { + AffineTransform_Shear_bindgen_original(self, axis1, axis2, coef, pre) + } + #[inline] + pub unsafe fn Translate_bindgen_original_bindgen_original( + &mut self, + offset: __bindgen_marker_Reference<*const root::std::vector>, + pre: bool, + ) { + AffineTransform_Translate_bindgen_original(self, offset, pre) + } + #[inline] + pub unsafe fn Rotate_bindgen_original_bindgen_original( + &mut self, + axis1: ::std::os::raw::c_int, + axis2: ::std::os::raw::c_int, + angle: f64, + pre: bool, + ) { + AffineTransform_Rotate_bindgen_original(self, axis1, axis2, angle, pre) + } + #[inline] + pub unsafe fn InternalInitialization_bindgen_original_bindgen_original( + &mut self, + transform: *mut root::itk::TransformBase, + ) { + AffineTransform_InternalInitialization_bindgen_original(self, transform) + } + #[inline] + pub unsafe fn new_bindgen_original( + dimensions: ::std::os::raw::c_uint, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + AffineTransform_AffineTransform_bindgen_original( + __bindgen_tmp.as_mut_ptr(), + dimensions, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original1( + arg1: __bindgen_marker_Reference< + *const root::itk::simple::AffineTransform, + >, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + AffineTransform_AffineTransform_bindgen_original1( + __bindgen_tmp.as_mut_ptr(), + arg1, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original2( + arg1: __bindgen_marker_Reference<*const root::itk::simple::Transform>, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + AffineTransform_AffineTransform_bindgen_original2( + __bindgen_tmp.as_mut_ptr(), + arg1, + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn new_bindgen_original3( + matrix: __bindgen_marker_Reference<*const root::std::vector>, + translation: __bindgen_marker_Reference<*const root::std::vector>, + fixedCenter: __bindgen_marker_Reference<*const root::std::vector>, + ) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + AffineTransform_AffineTransform_bindgen_original3( + __bindgen_tmp.as_mut_ptr(), + matrix, + translation, + fixedCenter, + ); + __bindgen_tmp.assume_init() + } + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransformD1Ev"] + pub fn AffineTransform_AffineTransform_destructor_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + ); + } + unsafe extern "C" { + #[doc = " Name of this class"] + #[link_name = "\u{1}_ZNK3itk6simple15AffineTransform7GetNameB5cxx11Ev"] + pub fn AffineTransform_GetName_bindgen_original( + this: *const root::itk::simple::AffineTransform, + ) -> root::std::string; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple15AffineTransform18SetPimpleTransformEOSt10unique_ptrINS0_19PimpleTransformBaseESt14default_deleteIS3_EE"] + pub fn AffineTransform_SetPimpleTransform_bindgen_original( + this: *mut root::itk::simple::AffineTransform, + pimpleTransform: __bindgen_marker_RValueReference< + *mut root::std::unique_ptr, + >, + ); + } + #[doc = " \\class ElastixImageFilter\n \\brief The class that wraps the elastix registration library."] + #[repr(C)] + #[repr(align(8))] + pub struct ElastixImageFilter { + pub _bindgen_opaque_blob: __bindgen_marker_Opaque, + } + pub type ElastixImageFilter_VectorOfImage = + root::std::vector; + pub type ElastixImageFilter_ParameterKeyType = root::std::string; + pub type ElastixImageFilter_ParameterValueType = root::std::string; + pub type ElastixImageFilter_ParameterValueVectorType = + root::std::vector; + pub type ElastixImageFilter_ParameterValueVectorIterator = + root::__gnu_cxx::__normal_iterator; + pub type ElastixImageFilter_ParameterMapType = root::std::map; + pub type ElastixImageFilter_ParameterMapVectorType = + root::std::vector; + pub type ElastixImageFilter_ParameterMapIterator = __bindgen_marker_Opaque; + pub type ElastixImageFilter_ParameterMapConstIterator = + __bindgen_marker_Opaque; + #[repr(C)] + pub struct ElastixImageFilter_ElastixImageFilterImpl { + _unused: [u8; 0], + } + unsafe extern "C" { + #[link_name = "\u{1}_ZNK3itk6simple18ElastixImageFilter7GetNameB5cxx11Ev"] + pub fn ElastixImageFilter_GetName_bindgen_original( + this: *const root::itk::simple::ElastixImageFilter, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Sets a fixed image. Stores the image into the container of fixed images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13SetFixedImageERKNS0_5ImageE"] + pub fn ElastixImageFilter_SetFixedImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + fixedImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets multiple fixed images. Stores the images into the container of fixed images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13SetFixedImageERKSt6vectorINS0_5ImageESaIS3_EE"] + pub fn ElastixImageFilter_SetFixedImage_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + fixedImages: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds an image to the end of the container of fixed images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13AddFixedImageERKNS0_5ImageE"] + pub fn ElastixImageFilter_AddFixedImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + fixedImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the fixed image at the specified (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13GetFixedImageEm"] + pub fn ElastixImageFilter_GetFixedImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image>; + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the container of fixed images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13GetFixedImageEv"] + pub fn ElastixImageFilter_GetFixedImage_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + >; + } + unsafe extern "C" { + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of fixed images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter16RemoveFixedImageEm"] + pub fn ElastixImageFilter_RemoveFixedImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ); + } + unsafe extern "C" { + #[doc = " \\brief Removes all fixed images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter16RemoveFixedImageEv"] + pub fn ElastixImageFilter_RemoveFixedImage_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the number of fixed images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter22GetNumberOfFixedImagesEv"] + pub fn ElastixImageFilter_GetNumberOfFixedImages_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Sets a moving image. Stores the image into the container of moving images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14SetMovingImageERKNS0_5ImageE"] + pub fn ElastixImageFilter_SetMovingImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + movingImages: __bindgen_marker_Reference< + *const root::itk::simple::Image, + >, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets multiple moving images. Stores the images into the container of moving images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14SetMovingImageERKSt6vectorINS0_5ImageESaIS3_EE"] + pub fn ElastixImageFilter_SetMovingImage_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + movingImage: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds an image to the end of the container of moving images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14AddMovingImageERKNS0_5ImageE"] + pub fn ElastixImageFilter_AddMovingImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + movingImage: __bindgen_marker_Reference< + *const root::itk::simple::Image, + >, + ); + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the moving image at the specified (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14GetMovingImageEm"] + pub fn ElastixImageFilter_GetMovingImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image>; + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the moving image at the specified (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14GetMovingImageEv"] + pub fn ElastixImageFilter_GetMovingImage_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + >; + } + unsafe extern "C" { + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of moving images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter17RemoveMovingImageEm"] + pub fn ElastixImageFilter_RemoveMovingImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ); + } + unsafe extern "C" { + #[doc = " \\brief Removes all moving images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter17RemoveMovingImageEv"] + pub fn ElastixImageFilter_RemoveMovingImage_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the number of moving images."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter23GetNumberOfMovingImagesEv"] + pub fn ElastixImageFilter_GetNumberOfMovingImages_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Sets a fixed mask. Stores the image into the container of fixed masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12SetFixedMaskERKNS0_5ImageE"] + pub fn ElastixImageFilter_SetFixedMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + fixedMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets multiple fixed masks. Stores the images into the container of fixed masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12SetFixedMaskERKSt6vectorINS0_5ImageESaIS3_EE"] + pub fn ElastixImageFilter_SetFixedMask_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + fixedMasks: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds an image to the end of the container of fixed masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12AddFixedMaskERKNS0_5ImageE"] + pub fn ElastixImageFilter_AddFixedMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + fixedMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the fixed mask at the specified (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12GetFixedMaskEm"] + pub fn ElastixImageFilter_GetFixedMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image>; + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the container of fixed masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12GetFixedMaskEv"] + pub fn ElastixImageFilter_GetFixedMask_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + >; + } + unsafe extern "C" { + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of fixed masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15RemoveFixedMaskEm"] + pub fn ElastixImageFilter_RemoveFixedMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ); + } + unsafe extern "C" { + #[doc = " \\brief Removes all fixed masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15RemoveFixedMaskEv"] + pub fn ElastixImageFilter_RemoveFixedMask_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the number of fixed masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter21GetNumberOfFixedMasksEv"] + pub fn ElastixImageFilter_GetNumberOfFixedMasks_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Sets a moving mask. Stores the image into the container of moving masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13SetMovingMaskERKNS0_5ImageE"] + pub fn ElastixImageFilter_SetMovingMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + movingMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets multiple moving masks. Stores the images into the container of moving masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13SetMovingMaskERKSt6vectorINS0_5ImageESaIS3_EE"] + pub fn ElastixImageFilter_SetMovingMask_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + movingMasks: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds an image to the end of the container of moving masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13AddMovingMaskERKNS0_5ImageE"] + pub fn ElastixImageFilter_AddMovingMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + movingMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ); + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the moving mask at the specified (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13GetMovingMaskEm"] + pub fn ElastixImageFilter_GetMovingMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image>; + } + unsafe extern "C" { + #[doc = " \\brief Retrieves a reference to the container of moving masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter13GetMovingMaskEv"] + pub fn ElastixImageFilter_GetMovingMask_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + >; + } + unsafe extern "C" { + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of moving masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter16RemoveMovingMaskEm"] + pub fn ElastixImageFilter_RemoveMovingMask_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_ulong, + ); + } + unsafe extern "C" { + #[doc = " \\brief Removes all moving masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter16RemoveMovingMaskEv"] + pub fn ElastixImageFilter_RemoveMovingMask_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the number of moving masks."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter22GetNumberOfMovingMasksEv"] + pub fn ElastixImageFilter_GetNumberOfMovingMasks_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Specifies a set of points from the fixed image by a point set file, \\p fixedPointSetFileName."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter24SetFixedPointSetFileNameENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_SetFixedPointSetFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + fixedPointSetFileName: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the name of the current point set file of points from the fixed image."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter24GetFixedPointSetFileNameB5cxx11Ev"] + pub fn ElastixImageFilter_GetFixedPointSetFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Clears the current point set file name of points from the fixed image."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter27RemoveFixedPointSetFileNameEv"] + pub fn ElastixImageFilter_RemoveFixedPointSetFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Specifies a set of points from the moving image by a point set file, \\p movingPointSetFileName."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter25SetMovingPointSetFileNameENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_SetMovingPointSetFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + movingPointSetFileName: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the name of the current point set file of points from the moving image."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter25GetMovingPointSetFileNameB5cxx11Ev"] + pub fn ElastixImageFilter_GetMovingPointSetFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Clears the current point set file name of points from the moving image."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter28RemoveMovingPointSetFileNameEv"] + pub fn ElastixImageFilter_RemoveMovingPointSetFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets the output directory."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter18SetOutputDirectoryENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_SetOutputDirectory_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + outputDirectory: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the current output directory."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter18GetOutputDirectoryB5cxx11Ev"] + pub fn ElastixImageFilter_GetOutputDirectory_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Clears the name of the current output directory. (Does not remove the actual directory.)"] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter21RemoveOutputDirectoryEv"] + pub fn ElastixImageFilter_RemoveOutputDirectory_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets the name of the current log file."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14SetLogFileNameENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_SetLogFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + logFileName: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the name of the current log file."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14GetLogFileNameB5cxx11Ev"] + pub fn ElastixImageFilter_GetLogFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Clears the name of the current log file."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter17RemoveLogFileNameEv"] + pub fn ElastixImageFilter_RemoveLogFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Switches logging to file on (`true`) or off (`false`), as specified by its function argument."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12SetLogToFileEb"] + pub fn ElastixImageFilter_SetLogToFile_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + logToFile: bool, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns whether logging to file is switched on."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12GetLogToFileEv"] + pub fn ElastixImageFilter_GetLogToFile_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> bool; + } + unsafe extern "C" { + #[doc = " \\brief Switches logging to file on"] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter11LogToFileOnEv"] + pub fn ElastixImageFilter_LogToFileOn_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Switches logging to file off."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12LogToFileOffEv"] + pub fn ElastixImageFilter_LogToFileOff_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Switches logging to console on (`true`) or off (`false`), as specified by its function argument."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15SetLogToConsoleEb"] + pub fn ElastixImageFilter_SetLogToConsole_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + arg1: bool, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns whether logging to console is switched on."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15GetLogToConsoleEv"] + pub fn ElastixImageFilter_GetLogToConsole_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> bool; + } + unsafe extern "C" { + #[doc = " \\brief Switches logging to console on"] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14LogToConsoleOnEv"] + pub fn ElastixImageFilter_LogToConsoleOn_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Switches logging to console off"] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15LogToConsoleOffEv"] + pub fn ElastixImageFilter_LogToConsoleOff_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets the maximum number of threads to the specified number \\p n.\n \\note As a side effect, it may modify the *global* maximum number of threads, as it internally calls ITK's\n `MultiThreaderBase.SetGlobalMaximumNumberOfThreads`."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter18SetNumberOfThreadsEi"] + pub fn ElastixImageFilter_SetNumberOfThreads_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + n: ::std::os::raw::c_int, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the current maximum number of threads."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter18GetNumberOfThreadsEv"] + pub fn ElastixImageFilter_GetNumberOfThreads_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> ::std::os::raw::c_int; + } + unsafe extern "C" { + #[doc = " \\brief Specifies the parameter map by a \\p transformName (\"translation\", \"rigid\" , \"affine\", \"nonrigid\", or\n \"bspline\"), and optionally \\p numberOfResolutions and \\p finalGridSpacingInPhysicalUnits."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15SetParameterMapENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjd"] + pub fn ElastixImageFilter_SetParameterMap_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + transformName: root::std::string, + numberOfResolutions: ::std::os::raw::c_uint, + finalGridSpacingInPhysicalUnits: f64, + ); + } + unsafe extern "C" { + #[doc = " \\brief Specifies multiple parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15SetParameterMapESt6vectorISt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_IS9_SaIS9_EESt4lessIS9_ESaISt4pairIKS9_SB_EEESaISI_EE"] + pub fn ElastixImageFilter_SetParameterMap_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + parameterMapVector: root::std::vector, + ); + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter16SetParameterMapsESt6vectorISt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_IS9_SaIS9_EESt4lessIS9_ESaISt4pairIKS9_SB_EEESaISI_EE"] + pub fn ElastixImageFilter_SetParameterMaps_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + parameterMapVector: root::std::vector, + ); + } + unsafe extern "C" { + #[doc = " \\brief Specifies a single parameter map."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15SetParameterMapESt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS8_SaIS8_EESt4lessIS8_ESaISt4pairIKS8_SB_EEE"] + pub fn ElastixImageFilter_SetParameterMap_bindgen_original2( + this: *mut root::itk::simple::ElastixImageFilter, + parameterMap: root::std::map, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds a parameter map to the container of parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15AddParameterMapESt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS8_SaIS8_EESt4lessIS8_ESaISt4pairIKS8_SB_EEE"] + pub fn ElastixImageFilter_AddParameterMap_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + parameterMap: root::std::map, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns a copy of the parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15GetParameterMapB5cxx11Ev"] + pub fn ElastixImageFilter_GetParameterMap_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::vector; + } + unsafe extern "C" { + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter16GetParameterMapsB5cxx11Ev"] + pub fn ElastixImageFilter_GetParameterMaps_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " \\brief Returns the default parameter map for the specified function arguments (\\p transformName may be\n \"translation\", \"rigid\" , \"affine\", \"nonrigid\", or \"bspline\")."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter22GetDefaultParameterMapENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjd"] + pub fn ElastixImageFilter_GetDefaultParameterMap_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + transformName: root::std::string, + numberOfResolutions: ::std::os::raw::c_uint, + finalGridSpacingInPhysicalUnits: f64, + ) -> root::std::map; + } + unsafe extern "C" { + #[doc = " \\brief Returns the number of parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter24GetNumberOfParameterMapsEv"] + pub fn ElastixImageFilter_GetNumberOfParameterMaps_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> ::std::os::raw::c_uint; + } + unsafe extern "C" { + #[doc = " \\brief Sets the value of the parameter specified by \\p key, in all parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12SetParameterENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_"] + pub fn ElastixImageFilter_SetParameter_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + key: root::std::string, + value: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets the values of the parameter specified by \\p key, in all parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12SetParameterENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS7_SaIS7_EE"] + pub fn ElastixImageFilter_SetParameter_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + key: root::std::string, + value: root::std::vector, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets the value of the parameter specified by \\p key, in the parameter map at the specified (zero-based) \\p\n index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12SetParameterEjNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_"] + pub fn ElastixImageFilter_SetParameter_bindgen_original2( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Sets the values of the parameter specified by \\p key, in the parameter map at the specified (zero-based) \\p\n index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12SetParameterEjNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS7_SaIS7_EE"] + pub fn ElastixImageFilter_SetParameter_bindgen_original3( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::vector, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified value to all parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12AddParameterENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_"] + pub fn ElastixImageFilter_AddParameter_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + key: root::std::string, + value: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified value to the parameter map at the specified\n (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12AddParameterEjNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_"] + pub fn ElastixImageFilter_AddParameter_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified values to all parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12AddParameterENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS7_SaIS7_EE"] + pub fn ElastixImageFilter_AddParameter_bindgen_original2( + this: *mut root::itk::simple::ElastixImageFilter, + key: root::std::string, + value: root::std::vector, + ); + } + unsafe extern "C" { + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified values to the parameter map at the specified\n (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12AddParameterEjNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS7_SaIS7_EE"] + pub fn ElastixImageFilter_AddParameter_bindgen_original3( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::vector, + ); + } + unsafe extern "C" { + #[doc = " \\brief Retrieves the values of the parameter specified by \\p key, when there is only one parameter map."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12GetParameterENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_GetParameter_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + key: root::std::string, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " \\brief Retrieves the values of the parameter specified by \\p key, from the parameter map at the specified\n (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter12GetParameterEjNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_GetParameter_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_uint, + key: root::std::string, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " \\brief Removes the parameter specified by \\p key from all parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15RemoveParameterENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_RemoveParameter_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + key: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Removes the parameter specified by \\p key from the parameter map at the specified (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter15RemoveParameterEjNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_RemoveParameter_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_uint, + key: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Specifies the initial transformation by the specified transform parameter file name."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter36SetInitialTransformParameterFileNameENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_SetInitialTransformParameterFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + initialTransformParmaterFileName: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Returns the initial transform parameter file name."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter36GetInitialTransformParameterFileNameB5cxx11Ev"] + pub fn ElastixImageFilter_GetInitialTransformParameterFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::string; + } + unsafe extern "C" { + #[doc = " \\brief Clears the initial transform parameter file name."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter39RemoveInitialTransformParameterFileNameEv"] + pub fn ElastixImageFilter_RemoveInitialTransformParameterFileName_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Reads the parameter file specified by \\p filename, and returns its content as a parameter map."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter17ReadParameterFileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"] + pub fn ElastixImageFilter_ReadParameterFile_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + filename: root::std::string, + ) -> root::std::map; + } + unsafe extern "C" { + #[doc = " \\brief Writes a parameter map to the file, specified by \\p filename."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter18WriteParameterFileESt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS8_SaIS8_EESt4lessIS8_ESaISt4pairIKS8_SB_EEES8_"] + pub fn ElastixImageFilter_WriteParameterFile_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + parameterMap: root::std::map, + filename: root::std::string, + ); + } + unsafe extern "C" { + #[doc = " \\brief Executes the registration, and returns the result image.\n \\note Before executing, the number of moving images must equal the number of fixed images,\n the number of fixed masks must be either zero, or one, or equal to the number of fixed images,\n and the number of moving masks must be either zero, or one, or equal to the number of moving images"] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter7ExecuteEv"] + pub fn ElastixImageFilter_Execute_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::itk::simple::Image; + } + unsafe extern "C" { + #[doc = " \\brief Returns all transform parameter maps."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter24GetTransformParameterMapB5cxx11Ev"] + pub fn ElastixImageFilter_GetTransformParameterMap_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::std::vector; + } + unsafe extern "C" { + #[doc = " \\brief Returns the transform parameter map at the specified (zero-based) \\p index."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter24GetTransformParameterMapB5cxx11Ej"] + pub fn ElastixImageFilter_GetTransformParameterMap_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + index: ::std::os::raw::c_uint, + ) -> root::std::map; + } + unsafe extern "C" { + #[doc = " \\brief Returns the result image."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter14GetResultImageEv"] + pub fn ElastixImageFilter_GetResultImage_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ) -> root::itk::simple::Image; + } + unsafe extern "C" { + #[doc = " \\brief Prints all parameter maps to standard output."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter17PrintParameterMapEv"] + pub fn ElastixImageFilter_PrintParameterMap_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Prints the specified parameter map to standard output."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter17PrintParameterMapESt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS8_SaIS8_EESt4lessIS8_ESaISt4pairIKS8_SB_EEE"] + pub fn ElastixImageFilter_PrintParameterMap_bindgen_original1( + this: *mut root::itk::simple::ElastixImageFilter, + parameterMapVector : root :: itk :: simple :: ElastixImageFilter_ParameterMapType, + ); + } + unsafe extern "C" { + #[doc = " \\brief Prints the specified parameter maps to standard output."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilter17PrintParameterMapESt6vectorISt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_IS9_SaIS9_EESt4lessIS9_ESaISt4pairIKS9_SB_EEESaISI_EE"] + pub fn ElastixImageFilter_PrintParameterMap_bindgen_original2( + this: *mut root::itk::simple::ElastixImageFilter, + parameterMapVector : root :: itk :: simple :: ElastixImageFilter_ParameterMapVectorType, + ); + } + unsafe extern "C" { + #[doc = " \\brief Default-constructor."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilterC1Ev"] + pub fn ElastixImageFilter_ElastixImageFilter_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + unsafe extern "C" { + #[doc = " \\brief Destructor."] + #[link_name = "\u{1}_ZN3itk6simple18ElastixImageFilterD1Ev"] + pub fn ElastixImageFilter_ElastixImageFilter_destructor_bindgen_original( + this: *mut root::itk::simple::ElastixImageFilter, + ); + } + impl ElastixImageFilter { + #[inline] + pub unsafe fn GetName_bindgen_original_bindgen_original( + &self, + ) -> root::std::string { + ElastixImageFilter_GetName_bindgen_original(self) + } + #[inline] + pub unsafe fn SetFixedImage_bindgen_original_bindgen_original( + &mut self, + fixedImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) { + ElastixImageFilter_SetFixedImage_bindgen_original(self, fixedImage) + } + #[inline] + pub unsafe fn SetFixedImage_bindgen_original_bindgen_original1( + &mut self, + fixedImages: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ) { + ElastixImageFilter_SetFixedImage_bindgen_original1(self, fixedImages) + } + #[inline] + pub unsafe fn AddFixedImage_bindgen_original_bindgen_original( + &mut self, + fixedImage: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) { + ElastixImageFilter_AddFixedImage_bindgen_original(self, fixedImage) + } + #[inline] + pub unsafe fn GetFixedImage_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image> + { + ElastixImageFilter_GetFixedImage_bindgen_original(self, index) + } + #[inline] + pub unsafe fn GetFixedImage_bindgen_original_bindgen_original1( + &mut self, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + > { + ElastixImageFilter_GetFixedImage_bindgen_original1(self) + } + #[inline] + pub unsafe fn RemoveFixedImage_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) { + ElastixImageFilter_RemoveFixedImage_bindgen_original(self, index) + } + #[inline] + pub unsafe fn RemoveFixedImage_bindgen_original_bindgen_original1( + &mut self, + ) { + ElastixImageFilter_RemoveFixedImage_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetNumberOfFixedImages_bindgen_original_bindgen_original( + &mut self, + ) -> ::std::os::raw::c_uint { + ElastixImageFilter_GetNumberOfFixedImages_bindgen_original(self) + } + #[inline] + pub unsafe fn SetMovingImage_bindgen_original_bindgen_original( + &mut self, + movingImages: __bindgen_marker_Reference< + *const root::itk::simple::Image, + >, + ) { + ElastixImageFilter_SetMovingImage_bindgen_original(self, movingImages) + } + #[inline] + pub unsafe fn SetMovingImage_bindgen_original_bindgen_original1( + &mut self, + movingImage: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ) { + ElastixImageFilter_SetMovingImage_bindgen_original1(self, movingImage) + } + #[inline] + pub unsafe fn AddMovingImage_bindgen_original_bindgen_original( + &mut self, + movingImage: __bindgen_marker_Reference< + *const root::itk::simple::Image, + >, + ) { + ElastixImageFilter_AddMovingImage_bindgen_original(self, movingImage) + } + #[inline] + pub unsafe fn GetMovingImage_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image> + { + ElastixImageFilter_GetMovingImage_bindgen_original(self, index) + } + #[inline] + pub unsafe fn GetMovingImage_bindgen_original_bindgen_original1( + &mut self, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + > { + ElastixImageFilter_GetMovingImage_bindgen_original1(self) + } + #[inline] + pub unsafe fn RemoveMovingImage_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) { + ElastixImageFilter_RemoveMovingImage_bindgen_original(self, index) + } + #[inline] + pub unsafe fn RemoveMovingImage_bindgen_original_bindgen_original1( + &mut self, + ) { + ElastixImageFilter_RemoveMovingImage_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetNumberOfMovingImages_bindgen_original_bindgen_original( + &mut self, + ) -> ::std::os::raw::c_uint { + ElastixImageFilter_GetNumberOfMovingImages_bindgen_original(self) + } + #[inline] + pub unsafe fn SetFixedMask_bindgen_original_bindgen_original( + &mut self, + fixedMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) { + ElastixImageFilter_SetFixedMask_bindgen_original(self, fixedMask) + } + #[inline] + pub unsafe fn SetFixedMask_bindgen_original_bindgen_original1( + &mut self, + fixedMasks: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ) { + ElastixImageFilter_SetFixedMask_bindgen_original1(self, fixedMasks) + } + #[inline] + pub unsafe fn AddFixedMask_bindgen_original_bindgen_original( + &mut self, + fixedMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) { + ElastixImageFilter_AddFixedMask_bindgen_original(self, fixedMask) + } + #[inline] + pub unsafe fn GetFixedMask_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image> + { + ElastixImageFilter_GetFixedMask_bindgen_original(self, index) + } + #[inline] + pub unsafe fn GetFixedMask_bindgen_original_bindgen_original1( + &mut self, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + > { + ElastixImageFilter_GetFixedMask_bindgen_original1(self) + } + #[inline] + pub unsafe fn RemoveFixedMask_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) { + ElastixImageFilter_RemoveFixedMask_bindgen_original(self, index) + } + #[inline] + pub unsafe fn RemoveFixedMask_bindgen_original_bindgen_original1( + &mut self, + ) { + ElastixImageFilter_RemoveFixedMask_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetNumberOfFixedMasks_bindgen_original_bindgen_original( + &mut self, + ) -> ::std::os::raw::c_uint { + ElastixImageFilter_GetNumberOfFixedMasks_bindgen_original(self) + } + #[inline] + pub unsafe fn SetMovingMask_bindgen_original_bindgen_original( + &mut self, + movingMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) { + ElastixImageFilter_SetMovingMask_bindgen_original(self, movingMask) + } + #[inline] + pub unsafe fn SetMovingMask_bindgen_original_bindgen_original1( + &mut self, + movingMasks: __bindgen_marker_Reference< + *const root::itk::simple::ElastixImageFilter_VectorOfImage, + >, + ) { + ElastixImageFilter_SetMovingMask_bindgen_original1(self, movingMasks) + } + #[inline] + pub unsafe fn AddMovingMask_bindgen_original_bindgen_original( + &mut self, + movingMask: __bindgen_marker_Reference<*const root::itk::simple::Image>, + ) { + ElastixImageFilter_AddMovingMask_bindgen_original(self, movingMask) + } + #[inline] + pub unsafe fn GetMovingMask_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) -> __bindgen_marker_Reference<*mut root::itk::simple::Image> + { + ElastixImageFilter_GetMovingMask_bindgen_original(self, index) + } + #[inline] + pub unsafe fn GetMovingMask_bindgen_original_bindgen_original1( + &mut self, + ) -> __bindgen_marker_Reference< + *mut root::itk::simple::ElastixImageFilter_VectorOfImage, + > { + ElastixImageFilter_GetMovingMask_bindgen_original1(self) + } + #[inline] + pub unsafe fn RemoveMovingMask_bindgen_original_bindgen_original( + &mut self, + index: ::std::os::raw::c_ulong, + ) { + ElastixImageFilter_RemoveMovingMask_bindgen_original(self, index) + } + #[inline] + pub unsafe fn RemoveMovingMask_bindgen_original_bindgen_original1( + &mut self, + ) { + ElastixImageFilter_RemoveMovingMask_bindgen_original1(self) + } + #[inline] + pub unsafe fn GetNumberOfMovingMasks_bindgen_original_bindgen_original( + &mut self, + ) -> ::std::os::raw::c_uint { + ElastixImageFilter_GetNumberOfMovingMasks_bindgen_original(self) + } + #[inline] + pub unsafe fn SetFixedPointSetFileName_bindgen_original_bindgen_original( + &mut self, + fixedPointSetFileName: root::std::string, + ) { + ElastixImageFilter_SetFixedPointSetFileName_bindgen_original( + self, + fixedPointSetFileName, + ) + } + #[inline] + pub unsafe fn GetFixedPointSetFileName_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::string { + ElastixImageFilter_GetFixedPointSetFileName_bindgen_original(self) + } + #[inline] + pub unsafe fn RemoveFixedPointSetFileName_bindgen_original_bindgen_original( + &mut self, + ) { + ElastixImageFilter_RemoveFixedPointSetFileName_bindgen_original(self) + } + #[inline] + pub unsafe fn SetMovingPointSetFileName_bindgen_original_bindgen_original( + &mut self, + movingPointSetFileName: root::std::string, + ) { + ElastixImageFilter_SetMovingPointSetFileName_bindgen_original( + self, + movingPointSetFileName, + ) + } + #[inline] + pub unsafe fn GetMovingPointSetFileName_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::string { + ElastixImageFilter_GetMovingPointSetFileName_bindgen_original(self) + } + #[inline] + pub unsafe fn RemoveMovingPointSetFileName_bindgen_original_bindgen_original( + &mut self, + ) { + ElastixImageFilter_RemoveMovingPointSetFileName_bindgen_original(self) + } + #[inline] + pub unsafe fn SetOutputDirectory_bindgen_original_bindgen_original( + &mut self, + outputDirectory: root::std::string, + ) { + ElastixImageFilter_SetOutputDirectory_bindgen_original( + self, + outputDirectory, + ) + } + #[inline] + pub unsafe fn GetOutputDirectory_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::string { + ElastixImageFilter_GetOutputDirectory_bindgen_original(self) + } + #[inline] + pub unsafe fn RemoveOutputDirectory_bindgen_original_bindgen_original( + &mut self, + ) { + ElastixImageFilter_RemoveOutputDirectory_bindgen_original(self) + } + #[inline] + pub unsafe fn SetLogFileName_bindgen_original_bindgen_original( + &mut self, + logFileName: root::std::string, + ) { + ElastixImageFilter_SetLogFileName_bindgen_original(self, logFileName) + } + #[inline] + pub unsafe fn GetLogFileName_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::string { + ElastixImageFilter_GetLogFileName_bindgen_original(self) + } + #[inline] + pub unsafe fn RemoveLogFileName_bindgen_original_bindgen_original( + &mut self, + ) { + ElastixImageFilter_RemoveLogFileName_bindgen_original(self) + } + #[inline] + pub unsafe fn SetLogToFile_bindgen_original_bindgen_original( + &mut self, + logToFile: bool, + ) { + ElastixImageFilter_SetLogToFile_bindgen_original(self, logToFile) + } + #[inline] + pub unsafe fn GetLogToFile_bindgen_original_bindgen_original( + &mut self, + ) -> bool { + ElastixImageFilter_GetLogToFile_bindgen_original(self) + } + #[inline] + pub unsafe fn LogToFileOn_bindgen_original_bindgen_original(&mut self) { + ElastixImageFilter_LogToFileOn_bindgen_original(self) + } + #[inline] + pub unsafe fn LogToFileOff_bindgen_original_bindgen_original(&mut self) { + ElastixImageFilter_LogToFileOff_bindgen_original(self) + } + #[inline] + pub unsafe fn SetLogToConsole_bindgen_original_bindgen_original( + &mut self, + arg1: bool, + ) { + ElastixImageFilter_SetLogToConsole_bindgen_original(self, arg1) + } + #[inline] + pub unsafe fn GetLogToConsole_bindgen_original_bindgen_original( + &mut self, + ) -> bool { + ElastixImageFilter_GetLogToConsole_bindgen_original(self) + } + #[inline] + pub unsafe fn LogToConsoleOn_bindgen_original_bindgen_original(&mut self) { + ElastixImageFilter_LogToConsoleOn_bindgen_original(self) + } + #[inline] + pub unsafe fn LogToConsoleOff_bindgen_original_bindgen_original(&mut self) { + ElastixImageFilter_LogToConsoleOff_bindgen_original(self) + } + #[inline] + pub unsafe fn SetNumberOfThreads_bindgen_original_bindgen_original( + &mut self, + n: ::std::os::raw::c_int, + ) { + ElastixImageFilter_SetNumberOfThreads_bindgen_original(self, n) + } + #[inline] + pub unsafe fn GetNumberOfThreads_bindgen_original_bindgen_original( + &mut self, + ) -> ::std::os::raw::c_int { + ElastixImageFilter_GetNumberOfThreads_bindgen_original(self) + } + #[inline] + pub unsafe fn SetParameterMap_bindgen_original_bindgen_original( + &mut self, + transformName: root::std::string, + numberOfResolutions: ::std::os::raw::c_uint, + finalGridSpacingInPhysicalUnits: f64, + ) { + ElastixImageFilter_SetParameterMap_bindgen_original( + self, + transformName, + numberOfResolutions, + finalGridSpacingInPhysicalUnits, + ) + } + #[inline] + pub unsafe fn SetParameterMap_bindgen_original_bindgen_original1( + &mut self, + parameterMapVector: root::std::vector, + ) { + ElastixImageFilter_SetParameterMap_bindgen_original1( + self, + parameterMapVector, + ) + } + #[inline] + pub unsafe fn SetParameterMaps_bindgen_original_bindgen_original( + &mut self, + parameterMapVector: root::std::vector, + ) { + ElastixImageFilter_SetParameterMaps_bindgen_original( + self, + parameterMapVector, + ) + } + #[inline] + pub unsafe fn SetParameterMap_bindgen_original_bindgen_original2( + &mut self, + parameterMap: root::std::map, + ) { + ElastixImageFilter_SetParameterMap_bindgen_original2(self, parameterMap) + } + #[inline] + pub unsafe fn AddParameterMap_bindgen_original_bindgen_original( + &mut self, + parameterMap: root::std::map, + ) { + ElastixImageFilter_AddParameterMap_bindgen_original(self, parameterMap) + } + #[inline] + pub unsafe fn GetParameterMap_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::vector { + ElastixImageFilter_GetParameterMap_bindgen_original(self) + } + #[inline] + pub unsafe fn GetParameterMaps_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::vector { + ElastixImageFilter_GetParameterMaps_bindgen_original(self) + } + #[inline] + pub unsafe fn GetDefaultParameterMap_bindgen_original_bindgen_original( + &mut self, + transformName: root::std::string, + numberOfResolutions: ::std::os::raw::c_uint, + finalGridSpacingInPhysicalUnits: f64, + ) -> root::std::map { + ElastixImageFilter_GetDefaultParameterMap_bindgen_original( + self, + transformName, + numberOfResolutions, + finalGridSpacingInPhysicalUnits, + ) + } + #[inline] + pub unsafe fn GetNumberOfParameterMaps_bindgen_original_bindgen_original( + &mut self, + ) -> ::std::os::raw::c_uint { + ElastixImageFilter_GetNumberOfParameterMaps_bindgen_original(self) + } + #[inline] + pub unsafe fn SetParameter_bindgen_original_bindgen_original( + &mut self, + key: root::std::string, + value: root::std::string, + ) { + ElastixImageFilter_SetParameter_bindgen_original(self, key, value) + } + #[inline] + pub unsafe fn SetParameter_bindgen_original_bindgen_original1( + &mut self, + key: root::std::string, + value: root::std::vector, + ) { + ElastixImageFilter_SetParameter_bindgen_original1(self, key, value) + } + #[inline] + pub unsafe fn SetParameter_bindgen_original_bindgen_original2( + &mut self, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::string, + ) { + ElastixImageFilter_SetParameter_bindgen_original2( + self, index, key, value, + ) + } + #[inline] + pub unsafe fn SetParameter_bindgen_original_bindgen_original3( + &mut self, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::vector, + ) { + ElastixImageFilter_SetParameter_bindgen_original3( + self, index, key, value, + ) + } + #[inline] + pub unsafe fn AddParameter_bindgen_original_bindgen_original( + &mut self, + key: root::std::string, + value: root::std::string, + ) { + ElastixImageFilter_AddParameter_bindgen_original(self, key, value) + } + #[inline] + pub unsafe fn AddParameter_bindgen_original_bindgen_original1( + &mut self, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::string, + ) { + ElastixImageFilter_AddParameter_bindgen_original1( + self, index, key, value, + ) + } + #[inline] + pub unsafe fn AddParameter_bindgen_original_bindgen_original2( + &mut self, + key: root::std::string, + value: root::std::vector, + ) { + ElastixImageFilter_AddParameter_bindgen_original2(self, key, value) + } + #[inline] + pub unsafe fn AddParameter_bindgen_original_bindgen_original3( + &mut self, + index: ::std::os::raw::c_uint, + key: root::std::string, + value: root::std::vector, + ) { + ElastixImageFilter_AddParameter_bindgen_original3( + self, index, key, value, + ) + } + #[inline] + pub unsafe fn GetParameter_bindgen_original_bindgen_original( + &mut self, + key: root::std::string, + ) -> root::std::vector { + ElastixImageFilter_GetParameter_bindgen_original(self, key) + } + #[inline] + pub unsafe fn GetParameter_bindgen_original_bindgen_original1( + &mut self, + index: ::std::os::raw::c_uint, + key: root::std::string, + ) -> root::std::vector { + ElastixImageFilter_GetParameter_bindgen_original1(self, index, key) + } + #[inline] + pub unsafe fn RemoveParameter_bindgen_original_bindgen_original( + &mut self, + key: root::std::string, + ) { + ElastixImageFilter_RemoveParameter_bindgen_original(self, key) + } + #[inline] + pub unsafe fn RemoveParameter_bindgen_original_bindgen_original1( + &mut self, + index: ::std::os::raw::c_uint, + key: root::std::string, + ) { + ElastixImageFilter_RemoveParameter_bindgen_original1(self, index, key) + } + #[inline] + pub unsafe fn SetInitialTransformParameterFileName_bindgen_original_bindgen_original( + &mut self, + initialTransformParmaterFileName: root::std::string, + ) { + ElastixImageFilter_SetInitialTransformParameterFileName_bindgen_original( + self, + initialTransformParmaterFileName, + ) + } + #[inline] + pub unsafe fn GetInitialTransformParameterFileName_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::string { + ElastixImageFilter_GetInitialTransformParameterFileName_bindgen_original( + self, + ) + } + #[inline] + pub unsafe fn RemoveInitialTransformParameterFileName_bindgen_original_bindgen_original( + &mut self, + ) { + ElastixImageFilter_RemoveInitialTransformParameterFileName_bindgen_original (self) + } + #[inline] + pub unsafe fn ReadParameterFile_bindgen_original_bindgen_original( + &mut self, + filename: root::std::string, + ) -> root::std::map { + ElastixImageFilter_ReadParameterFile_bindgen_original(self, filename) + } + #[inline] + pub unsafe fn WriteParameterFile_bindgen_original_bindgen_original( + &mut self, + parameterMap: root::std::map, + filename: root::std::string, + ) { + ElastixImageFilter_WriteParameterFile_bindgen_original( + self, + parameterMap, + filename, + ) + } + #[inline] + pub unsafe fn Execute_bindgen_original_bindgen_original( + &mut self, + ) -> root::itk::simple::Image { + ElastixImageFilter_Execute_bindgen_original(self) + } + #[inline] + pub unsafe fn GetTransformParameterMap_bindgen_original_bindgen_original( + &mut self, + ) -> root::std::vector { + ElastixImageFilter_GetTransformParameterMap_bindgen_original(self) + } + #[inline] + pub unsafe fn GetTransformParameterMap_bindgen_original_bindgen_original1( + &mut self, + index: ::std::os::raw::c_uint, + ) -> root::std::map { + ElastixImageFilter_GetTransformParameterMap_bindgen_original1( + self, index, + ) + } + #[inline] + pub unsafe fn GetResultImage_bindgen_original_bindgen_original( + &mut self, + ) -> root::itk::simple::Image { + ElastixImageFilter_GetResultImage_bindgen_original(self) + } + #[inline] + pub unsafe fn PrintParameterMap_bindgen_original_bindgen_original( + &mut self, + ) { + ElastixImageFilter_PrintParameterMap_bindgen_original(self) + } + #[inline] + pub unsafe fn PrintParameterMap_bindgen_original_bindgen_original1( + &mut self, + parameterMapVector : root :: itk :: simple :: ElastixImageFilter_ParameterMapType, + ) { + ElastixImageFilter_PrintParameterMap_bindgen_original1( + self, + parameterMapVector, + ) + } + #[inline] + pub unsafe fn PrintParameterMap_bindgen_original_bindgen_original2( + &mut self, + parameterMapVector : root :: itk :: simple :: ElastixImageFilter_ParameterMapVectorType, + ) { + ElastixImageFilter_PrintParameterMap_bindgen_original2( + self, + parameterMapVector, + ) + } + #[inline] + pub unsafe fn new_bindgen_original() -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + ElastixImageFilter_ElastixImageFilter_bindgen_original( + __bindgen_tmp.as_mut_ptr(), + ); + __bindgen_tmp.assume_init() + } + #[inline] + pub unsafe fn destruct_bindgen_original(&mut self) { + ElastixImageFilter_ElastixImageFilter_destructor_bindgen_original(self) + } + } + } + #[repr(C)] + pub struct DataObject { + _unused: [u8; 0], + } + #[repr(C)] + pub struct TransformBaseTemplate { + pub _address: u8, + } + pub type TransformBase = root::itk::TransformBaseTemplate; + } + pub mod __pstl { + #[allow(unused_imports)] + use self::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + pub mod execution { + #[allow(unused_imports)] + use self::super::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + } + } + pub mod detail { + #[allow(unused_imports)] + use self::super::super::root; + #[allow(unused_imports)] + use super::{ + __bindgen_marker_Opaque, __bindgen_marker_RValueReference, + __bindgen_marker_Reference, + }; + #[allow(unused_imports)] + use autocxx::c_char16_t as bindgen_cchar16_t; + #[repr(C)] + pub struct FunctionTraits { + pub _address: u8, + } + } + #[repr(C)] + pub struct _bindgen_ty_16 { + pub _address: u8, + } + // pub type pointer = root :: pointer; + // pub type pointer = root :: pointer; + // pub type pointer = root :: pointer; + pub type pointer = + *mut __bindgen_marker_Opaque>; + } + } + #[doc = r" A private + mod containing the bindings generated by [`cxx`]. Do not + use the contents directly - the useful parts will be re-exported into the main FFI mod."] + #[cxx::bridge] + mod cxxbridge { + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl CxxVector {} + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl CxxVector {} + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl CxxVector {} + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl UniquePtr {} + impl SharedPtr {} + impl WeakPtr {} + impl CxxVector {} + unsafe extern "C++" { + #[doc = r" Make a C++ [`cxx::UniquePtr`] to a [`cxx::CxxString`]"] + #[doc = r" from a Rust `&str`."] + fn autocxx_make_string_0x663a7a2eb658d678(str_: &str) -> UniquePtr; + #[namespace = "itk::simple"] + #[cxx_name = "InterpolatorEnum"] + type InterpolatorEnum = super::itk::simple::InterpolatorEnum; + pub unsafe fn Image_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678() -> *mut Image; + pub unsafe fn Image_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678(arg0: *mut Image); + #[namespace = "itk::simple"] + #[cxx_name = "Image"] + #[doc = " \\class Image\n \\brief The Image class for SimpleITK\n\n This Image class can represent 2D, 3D, and 4D images. The pixel\n types may be a scalar, a multi-component vector or a\n run-length-encoded (RLE) \"label\". The dimension, pixel type and\n size is specified at construction.\n\n A fundamental concept of ITK images is that they occupy physical\n space where the image is defined by an origin, spacing, and\n direction cosine matrix. The attributes are taken into\n consideration when doing most operations on an image. A meta-data\n dictionary is also associated with the image, which may contain\n additional fields from reading but these attributes are not\n propagated by image filters.\n\n The SimpleITK Image provides a single facade interface to several\n ITK image types. Internally, the SimpleITK Image maintains a\n pointer to the ITK image class, and performs reference counting\n and lazy copying. This means that deep copying of an image\n including it's buffer is delayed until the image is\n modified. This removes the need to + use pointers to SimpleITK\n Image class, as copying and returning by value do not\n unnecessarily duplicate the data.\n\n \\sa itk::Image itk::VectorImage itk::LabelMap itk::ImageBase"] + type Image = super::itk::simple::Image; + pub unsafe fn Transform_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678( + ) -> *mut Transform; + pub unsafe fn Transform_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678( + arg0: *mut Transform, + ); + #[namespace = "itk::simple"] + #[cxx_name = "Transform"] + #[doc = " \\class Transform\n \\brief A simplified wrapper around a variety of ITK transforms.\n\n The interface to ITK transform objects to be used with the\n ImageRegistrationMethod, ResampleImageFilter and other SimpleITK\n process objects. The transforms are designed to have a serialized\n array of parameters to facilitate optimization for registration.\n\n Provides a base class interface to any type of ITK\n transform. Objects of this type may have their interface converted\n to a derived interface while keeping the same reference to the ITK\n object.\n\n Additionally, this class provides a basic interface to a composite\n transforms.\n\n \\sa itk::CompositeTransform"] + type Transform = super::itk::simple::Transform; + pub fn cast_AffineTransform_to_Transform_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &AffineTransform, + ) -> &Transform; + pub unsafe fn AffineTransform_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678( + ) -> *mut AffineTransform; + pub unsafe fn AffineTransform_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678( + arg0: *mut AffineTransform, + ); + #[namespace = "itk::simple"] + #[cxx_name = "AffineTransform"] + #[doc = " \\class AffineTransform\n \\brief An affine transformation about a fixed center with\n translation for a 2D or 3D coordinate.\n\n \\sa itk::AffineTransform"] + type AffineTransform = super::itk::simple::AffineTransform; + pub unsafe fn ElastixImageFilter_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678( + ) -> *mut ElastixImageFilter; + pub unsafe fn ElastixImageFilter_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678( + arg0: *mut ElastixImageFilter, + ); + #[namespace = "itk::simple"] + #[cxx_name = "ElastixImageFilter"] + #[doc = " \\class ElastixImageFilter\n \\brief The class that wraps the elastix registration library."] + type ElastixImageFilter = super::itk::simple::ElastixImageFilter; + #[doc = " \\brief Advanced method not commonly needed\n\n This method is designed to support implementations \"in-place\" object behavior for methods which operate on\n r-value references. The returned image is a new image which has a low level pointer to this object's image\n buffer, without the SimpleITK or ITK reference counting. This is implemented by setting the new ITK Image's\n buffer to the same as this objects without ownership.\n\n \\warning This method bypasses the SimpleITK reference counting, and the reference needs to be manually maintained\n in the scope. The resulting object is designed only to be a temporary.\n\n In the following example this method is used instead of an `std::move` call when the filter's first argument\n takes an r-value reference. The `img` object will container the results of the filter execution, and the `img`\n image buffer will be preserved in case of exceptions, and the meta-data will remain in the img object.\n \\code\n filter.Execute( img.ProxyForInPlaceOperation() );\n \\endcode\n\n The meta-data dictionary is not copied to the returned proxy image."] + pub unsafe fn ProxyForInPlaceOperation_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Image>, + placement_return_type: *mut Image, + ); + #[namespace = "itk::simple"] + #[doc = " Get access to internal ITK data object.\n\n The return value should immediately be assigned to as\n itk::SmartPointer.\n\n In many cases the value may need to be dynamically casted to\n the actual image type. The GetPixelIDValue() method should\n return an PixelID which identifies the image type which the\n DataObject points to.\n\n If this object has been moved, then nullptr is returned.\n\n @{"] + pub fn GetITKBase(self: Pin<&mut Image>) -> *mut DataObject; + #[namespace = "itk::simple"] + #[cxx_name = "GetITKBase"] + pub fn GetITKBase1(self: &Image) -> *const DataObject; + #[namespace = "itk::simple"] + #[doc = " Get the pixel type\n\n The pixel type is set at construction type and can not be\n manually changed, unless by assignment. The value may be -1 or\n \"Unknown\"."] + pub fn GetPixelID(self: &Image) -> PixelIDValueEnum; + #[namespace = "itk::simple"] + pub fn GetPixelIDValue(self: &Image) -> c_int; + #[doc = " Return the pixel type as a human readable string value."] + pub fn GetPixelIDTypeAsString_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " Get the number of physical dimensions.\n\n Only the spatial dimensions are considered here. These are the\n dimensions the origin, spacing and direction cosine matrix are\n applicable to. This does not include the pixels' vector index\n as a dimension."] + pub fn GetDimension(self: &Image) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " \\brief Get the number of components for each pixel\n\n For images with scalar or complex pixel types this method\n returns one. For images with a vector pixel type the method\n returns the number of vector components per pixel."] + pub fn GetNumberOfComponentsPerPixel(self: &Image) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " \\brief Get the number of pixels in the image\n\n To calculate the total number of values stored continuously for\n the image's buffer, the NumberOfPixels should be multiplied by\n NumberOfComponentsPerPixel in order to account for multiple\n component images.\n"] + pub fn GetNumberOfPixels(self: &Image) -> u64; + #[namespace = "itk::simple"] + #[doc = " \\brief Get the number of bytes per component of a pixel.\n\n Returns the `sizeof` the pixel component type."] + pub fn GetSizeOfPixelComponent(self: &Image) -> c_uint; + #[doc = " Get/Set the Origin in physical space\n @{"] + pub fn GetOrigin_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + pub fn SetOrigin(self: Pin<&mut Image>, origin: &CxxVector); + #[doc = " Get/Set the Spacing of the Image as an std::vector .\n\n The spacing describes the physical size of each pixel. The\n length of the vector is equal to the dimension of the Image.\n @{"] + pub fn GetSpacing_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + pub fn SetSpacing(self: Pin<&mut Image>, spacing: &CxxVector); + #[doc = " \\brief Set/Get the Direction\n\n Internally, the Direction is represented by a matrix 2x2 for a\n 2D and 3x3 for a 3D image. The matrix is passed as a 1D\n array in row-major form.\n @{"] + pub fn GetDirection_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + pub fn SetDirection(self: Pin<&mut Image>, direction: &CxxVector); + #[doc = " Transform index to physical point"] + pub fn TransformIndexToPhysicalPoint_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + index: &CxxVector, + ) -> UniquePtr>; + #[doc = " Transform physical point to index"] + pub fn TransformPhysicalPointToIndex_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + point: &CxxVector, + ) -> UniquePtr>; + #[doc = " Transform physical point to continuous index"] + pub fn TransformPhysicalPointToContinuousIndex_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + point: &CxxVector, + ) -> UniquePtr>; + #[doc = " Transform continuous index to physical point"] + pub fn TransformContinuousIndexToPhysicalPoint_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + index: &CxxVector, + ) -> UniquePtr>; + #[doc = " \\brief Interpolate pixel value at a continuous index.\n\n This method is not supported for Label pixel types.\n\n The valid range of continuous index is [-0.5, size-0.5] for each dimension. An exception is thrown if index is out\n of bounds.\n\n @param index The continuous index must be at least the length of the image dimension.\n @param interp The interpolation type to use, only sitkNearest and sitkLinear are supported for Vector and Complex\n pixel types.\n\n @return All supported pixel types are returned as an array, where complex numbers are returned with the real\n followed by the complex component."] + pub fn EvaluateAtContinuousIndex_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + index: &CxxVector, + interp: InterpolatorEnum, + ) -> UniquePtr>; + #[doc = " Interpolate pixel value at a physical point.\n\n This method is not supported for Label pixel types.\n\n An exception is thrown if the point is out of the defined region for the image.\n\n @param point The physical point at which the interpolation is computed.\n @param interp The interpolation type to use, only sitkNearest and sitkLinear are supported for Vector and Complex\n pixel types.\n\n @return All supported pixel types are returned as an array, where complex numbers are returned with the real\n followed by the complex component."] + pub fn EvaluateAtPhysicalPoint_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + point: &CxxVector, + interp: InterpolatorEnum, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + #[doc = " Checks whether the images' pixels at the same index occupy the same physical space.\n\n Compares the origin, spacing, and direction for equality within provided tolerances.\n There is no check for matching regions in between the images.\n\n If The dimensions of the images do not match, false is returned."] + pub fn IsCongruentImageGeometry( + self: &Image, + otherImage: &Image, + coordinateTolerance: f64, + directionTolerance: f64, + ) -> bool; + #[namespace = "itk::simple"] + #[doc = " Check whether the images have the same grid in physical space.\n\n Compares largest possible regions for equality, and the origin, spacing,\n and direction cosines for equality within provided tolerances.\n\n If the dimensions of the images do not match, false is returned."] + pub fn IsSameImageGeometryAs( + self: &Image, + otherImage: &Image, + arg1: f64, + arg2: f64, + ) -> bool; + #[namespace = "itk::simple"] + #[doc = " Get the number of pixels the Image is in the first dimension"] + pub fn GetWidth(self: &Image) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " Get the number of pixels the Image is in the second dimension"] + pub fn GetHeight(self: &Image) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " Get the number of pixels the Image is in the third dimension\n or 0 if the Image is only 2D"] + pub fn GetDepth(self: &Image) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " \\brief Copy common meta-data from an image to this one.\n\n Copies the Origin, Spacing, and Direction from the source image\n to this image. The meta-data dictionary is \\b not copied.\n\n It is required for the source Image's dimension and size to\n match, this image's attributes, otherwise an exception will be\n generated.\n"] + pub fn CopyInformation(self: Pin<&mut Image>, srcImage: &Image); + #[doc = " \\brief get a vector of keys in from the meta-data dictionary\n\n Returns a vector of keys to the key/value entries in the\n image's meta-data dictionary. Iterate through with these keys\n to get the values."] + pub fn GetMetaDataKeys_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + #[doc = " \\brief Query the meta-data dictionary for the existence of a key."] + pub fn HasMetaDataKey(self: &Image, key: &CxxString) -> bool; + #[doc = " \\brief Get the value of a meta-data dictionary entry as a string.\n\n If the key is not in the dictionary then an exception is\n thrown.\n\n string types in the dictionary are returned as their native\n strings. Other types are printed to string before returning."] + pub fn GetMetaData_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + key: &CxxString, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Set an entry in the meta-data dictionary.\n\n Replaces or creates an entry in the image's meta-data dictionary."] + pub fn SetMetaData(self: Pin<&mut Image>, key: &CxxString, value: &CxxString); + #[namespace = "itk::simple"] + #[doc = " \\brief Remove an entry from the meta-data dictionary.\n\n Returns true, when the value exists in the dictionary and is\n removed, false otherwise."] + pub fn EraseMetaData(self: Pin<&mut Image>, key: &CxxString) -> bool; + pub fn ToString_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + ) -> UniquePtr; + #[doc = " \\brief Convert the first dimension to the components for image with vector pixel type.\n\n This method will convert a scalar image to a vector image with\n the number of components equal to the size of the first\n dimension. If the image is already a vector image then the\n image is returned.\n\n The components of the direction cosine matrix for the first dimension must be the identity matrix, or else an\n exception is thrown.\n\n An exception is thrown if the image is 2D or if the pixel type is a label or complex pixel type.\n\n \\param inPlace If true then the image is made unique and converted in place updating this image,\n otherwise a copy of the image is made and returned.\n\n \\sa ToScalarImage"] + pub unsafe fn ToVectorImage_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Image>, + inPlace: bool, + placement_return_type: *mut Image, + ); + #[doc = " \\brief Convert a image of vector pixel type to a scalar image with N+1 dimensions.\n\n This method will convert a vector image to a scalar image with\n the size of the first dimension equal to the number of\n components. If the image is already a scalar image then the\n image is returned.\n\n For the additional dimension the origin is set to zero, the spacing to one, and the new components of the\n direction cosine to the identity matrix.\n\n An exception is thrown if the image is has SITK_MAX_DIMENSION dimensions or if the pixel type is a label or\n complex pixel type.\n\n \\param inPlace If true then the image is made unique and converted in place updating this image,\n otherwise a copy of the image is made and returned.\n\n \\sa ToVectorImage"] + pub unsafe fn ToScalarImage_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Image>, + inPlace: bool, + placement_return_type: *mut Image, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Get the value of a pixel\n\n Returns the value of a pixel for the given index. The index\n follows standard SimpleITK conventions for it's length. The\n correct method must be called for the underlying Image type,\n otherwise an exception will be thrown.\n\n \\param idx the zero based index into the image. It's length\n must be at least the value of GetDimension(), additional\n elements will be ignored. Boundary checking is performed on\n idx, if it is out of bounds an exception will be thrown.\n\n \\sa Image::GetPixelIDValue\n @{"] + pub fn GetPixelAsInt8(self: &Image, idx: &CxxVector) -> i8; + #[namespace = "itk::simple"] + pub fn GetPixelAsUInt8(self: &Image, idx: &CxxVector) -> u8; + #[namespace = "itk::simple"] + pub fn GetPixelAsInt16(self: &Image, idx: &CxxVector) -> i16; + #[namespace = "itk::simple"] + pub fn GetPixelAsUInt16(self: &Image, idx: &CxxVector) -> u16; + #[namespace = "itk::simple"] + pub fn GetPixelAsInt32(self: &Image, idx: &CxxVector) -> i32; + #[namespace = "itk::simple"] + pub fn GetPixelAsUInt32(self: &Image, idx: &CxxVector) -> u32; + #[namespace = "itk::simple"] + pub fn GetPixelAsInt64(self: &Image, idx: &CxxVector) -> i64; + #[namespace = "itk::simple"] + pub fn GetPixelAsUInt64(self: &Image, idx: &CxxVector) -> u64; + #[namespace = "itk::simple"] + pub fn GetPixelAsFloat(self: &Image, idx: &CxxVector) -> f32; + #[namespace = "itk::simple"] + pub fn GetPixelAsDouble(self: &Image, idx: &CxxVector) -> f64; + pub fn GetPixelAsVectorInt8_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorUInt8_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorInt16_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorUInt16_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorInt32_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorUInt32_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorInt64_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorUInt64_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorFloat32_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsVectorFloat64_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr>; + pub fn GetPixelAsComplexFloat32_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr; + pub fn GetPixelAsComplexFloat64_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Image, + idx: &CxxVector, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Set the value of a pixel\n\n Set the value of a pixel at the provided index. The index\n follows standard SimpleITK conventions for it's length. The\n correct method must be called which should match the underlying\n image type, otherwise an exception will be thrown.\n\n \\param idx the zero based index into the image. It's length\n must be at least the value of GetDimension(), additional\n elements will be ignored. Boundary checking is performed on\n idx, if it is out of bounds an exception will be thrown.\n \\param v value to set the pixel to\n\n \\sa Image::GetPixelIDValue\n @{"] + pub fn SetPixelAsInt8(self: Pin<&mut Image>, idx: &CxxVector, v: i8); + #[namespace = "itk::simple"] + pub fn SetPixelAsUInt8(self: Pin<&mut Image>, idx: &CxxVector, v: u8); + #[namespace = "itk::simple"] + pub fn SetPixelAsInt16(self: Pin<&mut Image>, idx: &CxxVector, v: i16); + #[namespace = "itk::simple"] + pub fn SetPixelAsUInt16(self: Pin<&mut Image>, idx: &CxxVector, v: u16); + #[namespace = "itk::simple"] + pub fn SetPixelAsInt32(self: Pin<&mut Image>, idx: &CxxVector, v: i32); + #[namespace = "itk::simple"] + pub fn SetPixelAsUInt32(self: Pin<&mut Image>, idx: &CxxVector, v: u32); + #[namespace = "itk::simple"] + pub fn SetPixelAsInt64(self: Pin<&mut Image>, idx: &CxxVector, v: i64); + #[namespace = "itk::simple"] + pub fn SetPixelAsUInt64(self: Pin<&mut Image>, idx: &CxxVector, v: u64); + #[namespace = "itk::simple"] + pub fn SetPixelAsFloat(self: Pin<&mut Image>, idx: &CxxVector, v: f32); + #[namespace = "itk::simple"] + pub fn SetPixelAsDouble(self: Pin<&mut Image>, idx: &CxxVector, v: f64); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorInt8( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorUInt8( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorInt16( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorUInt16( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorInt32( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorUInt32( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorInt64( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorUInt64( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorFloat32( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + #[namespace = "itk::simple"] + pub fn SetPixelAsVectorFloat64( + self: Pin<&mut Image>, + idx: &CxxVector, + v: &CxxVector, + ); + pub unsafe fn SetPixelAsComplexFloat32_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Image>, + idx: &CxxVector, + v: *mut std_complex_float_AutocxxConcrete, + ); + pub unsafe fn SetPixelAsComplexFloat64_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Image>, + idx: &CxxVector, + v: *mut std_complex_double_AutocxxConcrete, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Get a pointer to the image buffer\n \\warning this is dangerous\n\n The size of the buffer is the number of components*Xsize*Ysize\n and then Zsize of a 3D image. The buffer should be accessed as\n a 1-D array. For example a 3D image buffer should be accessed:\n \\code\n uint8_t *buffer = img->GetBufferAsUInt8();\n buffer[c + numComponents*(x+xSize*(y+ySize*z))]\n \\endcode\n\n The pointer to the buffer is not referenced\n counted. Additionally, while this image is made unique before\n returning the pointer, additional copying and usage may\n introduce unexpected aliasing of the image's buffer.\n\n Vector and Complex pixel types are both accessed via the\n appropriate component type method.\n\n The correct method for the current pixel type of the image must\n be called or else an exception will be generated. For vector\n pixel types the type of the component of the vector must be called.\n\n \\sa Image::GetPixelIDValue\n @{"] + pub fn GetBufferAsInt8(self: Pin<&mut Image>) -> *mut i8; + #[namespace = "itk::simple"] + pub fn GetBufferAsUInt8(self: Pin<&mut Image>) -> *mut u8; + #[namespace = "itk::simple"] + pub fn GetBufferAsInt16(self: Pin<&mut Image>) -> *mut i16; + #[namespace = "itk::simple"] + pub fn GetBufferAsUInt16(self: Pin<&mut Image>) -> *mut u16; + #[namespace = "itk::simple"] + pub fn GetBufferAsInt32(self: Pin<&mut Image>) -> *mut i32; + #[namespace = "itk::simple"] + pub fn GetBufferAsUInt32(self: Pin<&mut Image>) -> *mut u32; + #[namespace = "itk::simple"] + pub fn GetBufferAsInt64(self: Pin<&mut Image>) -> *mut i64; + #[namespace = "itk::simple"] + pub fn GetBufferAsUInt64(self: Pin<&mut Image>) -> *mut u64; + #[namespace = "itk::simple"] + pub fn GetBufferAsFloat(self: Pin<&mut Image>) -> *mut f32; + #[namespace = "itk::simple"] + pub fn GetBufferAsDouble(self: Pin<&mut Image>) -> *mut f64; + #[namespace = "itk::simple"] + pub fn GetBufferAsVoid(self: Pin<&mut Image>) -> *mut c_void; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsInt8"] + pub fn GetBufferAsInt81(self: &Image) -> *const i8; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsUInt8"] + pub fn GetBufferAsUInt81(self: &Image) -> *const u8; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsInt16"] + pub fn GetBufferAsInt161(self: &Image) -> *const i16; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsUInt16"] + pub fn GetBufferAsUInt161(self: &Image) -> *const u16; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsInt32"] + pub fn GetBufferAsInt321(self: &Image) -> *const i32; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsUInt32"] + pub fn GetBufferAsUInt321(self: &Image) -> *const u32; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsInt64"] + pub fn GetBufferAsInt641(self: &Image) -> *const i64; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsUInt64"] + pub fn GetBufferAsUInt641(self: &Image) -> *const u64; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsFloat"] + pub fn GetBufferAsFloat1(self: &Image) -> *const f32; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsDouble"] + pub fn GetBufferAsDouble1(self: &Image) -> *const f64; + #[namespace = "itk::simple"] + #[cxx_name = "GetBufferAsVoid"] + pub fn GetBufferAsVoid1(self: &Image) -> *const c_void; + #[namespace = "itk::simple"] + #[doc = " \\brief Performs actually coping if needed to make object unique.\n\n The Image class by default performs lazy coping and\n assignment. This method make sure that coping actually happens\n to the itk::Image pointed to is only pointed to by this object."] + pub fn MakeUnique(self: Pin<&mut Image>); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns true if no other SimpleITK Image object\n refers to the same internal data structure."] + pub fn IsUnique(self: &Image) -> bool; + #[doc = " \\brief Default constructor, creates an image of size 0"] + pub unsafe fn new_autocxx_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Image, + ); + pub unsafe fn new1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Image, + img: &Image, + ); + #[doc = " \\brief Move constructor and assignment.\n\n @param img After the operation img is valid only for\n destructing and assignment; all other operations have undefined\n behavior."] + pub unsafe fn new2_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Image, + img: *mut Image, + ); + #[doc = " \\brief Constructors for 2D, 3D an optionally 4D images where\n pixel type and number of components can be specified.\n\n If the pixel type is a scalar or a label pixel type, then the\n number of components must be specified as 0 or 1.\n\n If the pixel type is a vector pixel type, then the number of\n components defaults to the image dimension, unless the\n numberOfComponents is explicitly specified.\n\n Unlike the standard convention for Dimensional Vectors the size\n parameter must be the exact dimension requesting. That is, it must be of\n length 2 of a 2D image, 3 for a 3D image and 4 for a 4D image.\n @{"] + pub unsafe fn new3_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Image, + width: c_uint, + height: c_uint, + valueEnum: PixelIDValueEnum, + ); + pub unsafe fn new4_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Image, + width: c_uint, + height: c_uint, + depth: c_uint, + valueEnum: PixelIDValueEnum, + ); + pub unsafe fn Image_destructor_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Image, + ); + #[doc = " Get access to internal ITK data object.\n\n The return value should immediately be assigned to as\n itk::SmartPointer.\n\n In many cases the value may need to be dynamically cast to\n the actual transform type.\n\n @{"] + pub fn itk_simple_Transform_GetITKBase_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Transform>, + ) -> *mut TransformBase; + pub fn itk_simple_Transform_GetITKBase1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + ) -> *const TransformBase; + #[doc = " Return the dimension of the Transform ( 2D or 3D )"] + pub fn itk_simple_Transform_GetDimension_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + ) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " Set/Get Transform Parameter\n @{"] + pub fn SetParameters(self: Pin<&mut Transform>, parameters: &CxxVector); + pub fn GetParameters_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + #[doc = " Return the number of optimizable parameters"] + pub fn GetNumberOfParameters(self: &Transform) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " Set/Get Fixed Transform Parameter\n @{"] + pub fn SetFixedParameters(self: Pin<&mut Transform>, parameters: &CxxVector); + pub fn GetFixedParameters_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + #[doc = " Get the number of fixed parameters"] + pub fn GetNumberOfFixedParameters(self: &Transform) -> c_uint; + #[doc = " Apply transform to a point.\n\n The dimension of the point must match the transform."] + pub fn TransformPoint_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + point: &CxxVector, + ) -> UniquePtr>; + #[doc = " Apply transform to a vector at a point.\n\n The ITK concept of a vector is a direction at a specific point,\n for example the difference between two points is a vector.\n\n For linear transforms the point does not matter, in general\n the vector is transformed by the Jacobian with respect to point\n position.\n\n The dimension of the vector and point must match the transform."] + pub fn TransformVector_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + vector: &CxxVector, + point: &CxxVector, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + pub fn WriteTransform(self: &Transform, filename: &CxxString); + #[doc = " \\brief Return a new inverse transform of the same type as this.\n\n Creates a new transform object and tries to set the value to the\n inverse. As not all transform types have inverse and some\n transforms are not invertible, an exception will be throw is\n there is no inverse."] + pub unsafe fn GetInverse_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + placement_return_type: *mut Transform, + ); + pub fn itk_simple_Transform_ToString_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + ) -> UniquePtr; + #[doc = " \\brief Performs actually coping if needed to make object unique.\n\n The Transform class by default performs lazy coping and\n assignment. This method make sure that coping actually happens\n to the itk::Transform pointed to is only pointed to by this\n object."] + pub fn itk_simple_Transform_MakeUnique_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Transform>, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Get the TransformEnum of the underlying Transform.\n\n A SimpleITK Transform object can internally hold any ITK transform. This\n method returns the TransformEnum representing the internal ITK\n transform. This value may be used to identify which SimpleITK\n class the transform can be converted to."] + pub fn GetTransformEnum(self: &Transform) -> TransformEnum; + #[doc = " \\brief By default a 3-d identity transform is constructed"] + pub unsafe fn itk_simple_Transform_new_autocxx_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Transform, + ); + pub unsafe fn itk_simple_Transform_new1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Transform, + transform: *mut TransformBase, + ); + #[doc = " \\brief Construct a specific transformation\n\n \\deprecated This constructor will be removed in future releases."] + pub unsafe fn itk_simple_Transform_new2_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Transform, + dimensions: c_uint, + type_: TransformEnum, + ); + #[doc = " \\brief Use an image to construct a transform.\n\n The input displacement image is transferred to the constructed\n transform object. The input image is modified to be a default\n constructed Image object.\n\n Only the sitkDisplacementField transformation type can currently\n be constructed this way. Image must be of sitkVectorFloat64 pixel\n type with the number of components equal to the image dimension.\n\n \\deprecated This constructor will be removed in future releases."] + pub unsafe fn itk_simple_Transform_new3_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Transform, + displacement: Pin<&mut Image>, + type_: TransformEnum, + ); + pub unsafe fn itk_simple_Transform_new4_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Transform, + arg1: &Transform, + ); + pub unsafe fn Transform_destructor_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut Transform, + ); + pub fn IsLinear_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + ) -> bool; + pub fn SetIdentity_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Transform>, + ); + #[doc = " \\brief Try to change the current transform to it's inverse.\n\n If the transform has an inverse, i.e. non-singular linear\n transforms, then a new ITK transform is created of the same type\n and this object is set to it.\n\n However not all transform have a direct inverse, if the inverse\n does not exist or fails false will be returned and this transform\n will not be modified."] + pub fn SetInverse_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut Transform>, + ) -> bool; + #[doc = " return user readable name for the SimpleITK transform"] + pub fn GetName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &Transform, + ) -> UniquePtr; + #[doc = " \\brief itk::simple::ResampleImageFilter Procedural Interface\n\n These functions call the execute method of ResampleImageFilter\n in order to support a procedural API.\n\n The difference between the three functions is in the way the output\n image's domain parameters are specified (origin, spacing,\n direction). The first function uses the parameters from the input image,\n the second uses the parameters of a reference image, and the third uses\n explicitly specified parameters.\n\n \\sa itk::simple::ResampleImageFilter for the object oriented interface\n @{"] + pub unsafe fn Resample_autocxx_wrapper_0x663a7a2eb658d678( + image1: &Image, + transform: *mut Transform, + interpolator: InterpolatorEnum, + defaultPixelValue: f64, + outputPixelType: PixelIDValueEnum, + useNearestNeighborExtrapolator: bool, + placement_return_type: *mut Image, + ); + #[doc = " parameters"] + pub fn GetTranslation_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &AffineTransform, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + pub fn SetTranslation(self: Pin<&mut AffineTransform>, translation: &CxxVector); + #[namespace = "itk::simple"] + pub fn SetMatrix(self: Pin<&mut AffineTransform>, matrix: &CxxVector); + pub fn GetMatrix_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &AffineTransform, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + #[doc = " fixed parameter"] + pub fn SetCenter(self: Pin<&mut AffineTransform>, params: &CxxVector); + pub fn GetCenter_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &AffineTransform, + ) -> UniquePtr>; + #[namespace = "itk::simple"] + #[doc = " additional methods"] + pub fn Scale(self: Pin<&mut AffineTransform>, factor: &CxxVector, pre: bool); + #[namespace = "itk::simple"] + #[cxx_name = "Scale"] + pub fn Scale1(self: Pin<&mut AffineTransform>, factor: f64, pre: bool); + #[namespace = "itk::simple"] + pub fn Shear( + self: Pin<&mut AffineTransform>, + axis1: c_int, + axis2: c_int, + coef: f64, + pre: bool, + ); + #[namespace = "itk::simple"] + pub fn Translate(self: Pin<&mut AffineTransform>, offset: &CxxVector, pre: bool); + #[namespace = "itk::simple"] + pub fn Rotate( + self: Pin<&mut AffineTransform>, + axis1: c_int, + axis2: c_int, + angle: f64, + pre: bool, + ); + pub unsafe fn itk_simple_AffineTransform_new_autocxx_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut AffineTransform, + dimensions: c_uint, + ); + pub unsafe fn itk_simple_AffineTransform_new1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut AffineTransform, + arg1: &AffineTransform, + ); + pub unsafe fn itk_simple_AffineTransform_new2_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut AffineTransform, + arg1: &Transform, + ); + pub unsafe fn itk_simple_AffineTransform_new3_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut AffineTransform, + matrix: &CxxVector, + translation: &CxxVector, + fixedCenter: &CxxVector, + ); + pub unsafe fn AffineTransform_destructor_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut AffineTransform, + ); + #[doc = " Name of this class"] + pub fn itk_simple_AffineTransform_GetName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &AffineTransform, + ) -> UniquePtr; + pub fn itk_simple_ElastixImageFilter_GetName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: &ElastixImageFilter, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Sets a fixed image. Stores the image into the container of fixed images."] + pub fn SetFixedImage(self: Pin<&mut ElastixImageFilter>, fixedImage: &Image); + #[namespace = "itk::simple"] + #[cxx_name = "SetFixedImage"] + #[doc = " \\brief Sets multiple fixed images. Stores the images into the container of fixed images."] + pub fn SetFixedImage1( + self: Pin<&mut ElastixImageFilter>, + fixedImages: &CxxVector, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Adds an image to the end of the container of fixed images."] + pub fn AddFixedImage(self: Pin<&mut ElastixImageFilter>, fixedImage: &Image); + #[namespace = "itk::simple"] + #[doc = " \\brief Retrieves a reference to the fixed image at the specified (zero-based) \\p index."] + pub fn GetFixedImage<'a>( + self: Pin<&'a mut ElastixImageFilter>, + index: c_ulong, + ) -> Pin<&'a mut Image>; + #[namespace = "itk::simple"] + #[cxx_name = "GetFixedImage"] + #[doc = " \\brief Retrieves a reference to the container of fixed images."] + pub fn GetFixedImage1<'a>( + self: Pin<&'a mut ElastixImageFilter>, + ) -> Pin<&'a mut CxxVector>; + #[namespace = "itk::simple"] + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of fixed images."] + pub fn RemoveFixedImage(self: Pin<&mut ElastixImageFilter>, index: c_ulong); + #[namespace = "itk::simple"] + #[cxx_name = "RemoveFixedImage"] + #[doc = " \\brief Removes all fixed images."] + pub fn RemoveFixedImage1(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns the number of fixed images."] + pub fn GetNumberOfFixedImages(self: Pin<&mut ElastixImageFilter>) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " \\brief Sets a moving image. Stores the image into the container of moving images."] + pub fn SetMovingImage(self: Pin<&mut ElastixImageFilter>, movingImages: &Image); + #[namespace = "itk::simple"] + #[cxx_name = "SetMovingImage"] + #[doc = " \\brief Sets multiple moving images. Stores the images into the container of moving images."] + pub fn SetMovingImage1( + self: Pin<&mut ElastixImageFilter>, + movingImage: &CxxVector, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Adds an image to the end of the container of moving images."] + pub fn AddMovingImage(self: Pin<&mut ElastixImageFilter>, movingImage: &Image); + #[namespace = "itk::simple"] + #[doc = " \\brief Retrieves a reference to the moving image at the specified (zero-based) \\p index."] + pub fn GetMovingImage<'a>( + self: Pin<&'a mut ElastixImageFilter>, + index: c_ulong, + ) -> Pin<&'a mut Image>; + #[namespace = "itk::simple"] + #[cxx_name = "GetMovingImage"] + #[doc = " \\brief Retrieves a reference to the moving image at the specified (zero-based) \\p index."] + pub fn GetMovingImage1<'a>( + self: Pin<&'a mut ElastixImageFilter>, + ) -> Pin<&'a mut CxxVector>; + #[namespace = "itk::simple"] + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of moving images."] + pub fn RemoveMovingImage(self: Pin<&mut ElastixImageFilter>, index: c_ulong); + #[namespace = "itk::simple"] + #[cxx_name = "RemoveMovingImage"] + #[doc = " \\brief Removes all moving images."] + pub fn RemoveMovingImage1(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns the number of moving images."] + pub fn GetNumberOfMovingImages(self: Pin<&mut ElastixImageFilter>) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " \\brief Sets a fixed mask. Stores the image into the container of fixed masks."] + pub fn SetFixedMask(self: Pin<&mut ElastixImageFilter>, fixedMask: &Image); + #[namespace = "itk::simple"] + #[cxx_name = "SetFixedMask"] + #[doc = " \\brief Sets multiple fixed masks. Stores the images into the container of fixed masks."] + pub fn SetFixedMask1(self: Pin<&mut ElastixImageFilter>, fixedMasks: &CxxVector); + #[namespace = "itk::simple"] + #[doc = " \\brief Adds an image to the end of the container of fixed masks."] + pub fn AddFixedMask(self: Pin<&mut ElastixImageFilter>, fixedMask: &Image); + #[namespace = "itk::simple"] + #[doc = " \\brief Retrieves a reference to the fixed mask at the specified (zero-based) \\p index."] + pub fn GetFixedMask<'a>( + self: Pin<&'a mut ElastixImageFilter>, + index: c_ulong, + ) -> Pin<&'a mut Image>; + #[namespace = "itk::simple"] + #[cxx_name = "GetFixedMask"] + #[doc = " \\brief Retrieves a reference to the container of fixed masks."] + pub fn GetFixedMask1<'a>( + self: Pin<&'a mut ElastixImageFilter>, + ) -> Pin<&'a mut CxxVector>; + #[namespace = "itk::simple"] + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of fixed masks."] + pub fn RemoveFixedMask(self: Pin<&mut ElastixImageFilter>, index: c_ulong); + #[namespace = "itk::simple"] + #[cxx_name = "RemoveFixedMask"] + #[doc = " \\brief Removes all fixed masks."] + pub fn RemoveFixedMask1(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns the number of fixed masks."] + pub fn GetNumberOfFixedMasks(self: Pin<&mut ElastixImageFilter>) -> c_uint; + #[namespace = "itk::simple"] + #[doc = " \\brief Sets a moving mask. Stores the image into the container of moving masks."] + pub fn SetMovingMask(self: Pin<&mut ElastixImageFilter>, movingMask: &Image); + #[namespace = "itk::simple"] + #[cxx_name = "SetMovingMask"] + #[doc = " \\brief Sets multiple moving masks. Stores the images into the container of moving masks."] + pub fn SetMovingMask1( + self: Pin<&mut ElastixImageFilter>, + movingMasks: &CxxVector, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Adds an image to the end of the container of moving masks."] + pub fn AddMovingMask(self: Pin<&mut ElastixImageFilter>, movingMask: &Image); + #[namespace = "itk::simple"] + #[doc = " \\brief Retrieves a reference to the moving mask at the specified (zero-based) \\p index."] + pub fn GetMovingMask<'a>( + self: Pin<&'a mut ElastixImageFilter>, + index: c_ulong, + ) -> Pin<&'a mut Image>; + #[namespace = "itk::simple"] + #[cxx_name = "GetMovingMask"] + #[doc = " \\brief Retrieves a reference to the container of moving masks."] + pub fn GetMovingMask1<'a>( + self: Pin<&'a mut ElastixImageFilter>, + ) -> Pin<&'a mut CxxVector>; + #[namespace = "itk::simple"] + #[doc = " \\brief Removes an image at the specified (zero-based) \\p index from the container of moving masks."] + pub fn RemoveMovingMask(self: Pin<&mut ElastixImageFilter>, index: c_ulong); + #[namespace = "itk::simple"] + #[cxx_name = "RemoveMovingMask"] + #[doc = " \\brief Removes all moving masks."] + pub fn RemoveMovingMask1(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns the number of moving masks."] + pub fn GetNumberOfMovingMasks(self: Pin<&mut ElastixImageFilter>) -> c_uint; + #[doc = " \\brief Specifies a set of points from the fixed image by a point set file, \\p fixedPointSetFileName."] + pub fn SetFixedPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + fixedPointSetFileName: UniquePtr, + ); + #[doc = " \\brief Returns the name of the current point set file of points from the fixed image."] + pub fn GetFixedPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Clears the current point set file name of points from the fixed image."] + pub fn RemoveFixedPointSetFileName(self: Pin<&mut ElastixImageFilter>); + #[doc = " \\brief Specifies a set of points from the moving image by a point set file, \\p movingPointSetFileName."] + pub fn SetMovingPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + movingPointSetFileName: UniquePtr, + ); + #[doc = " \\brief Returns the name of the current point set file of points from the moving image."] + pub fn GetMovingPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Clears the current point set file name of points from the moving image."] + pub fn RemoveMovingPointSetFileName(self: Pin<&mut ElastixImageFilter>); + #[doc = " \\brief Sets the output directory."] + pub fn SetOutputDirectory_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + outputDirectory: UniquePtr, + ); + #[doc = " \\brief Returns the current output directory."] + pub fn GetOutputDirectory_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Clears the name of the current output directory. (Does not remove the actual directory.)"] + pub fn RemoveOutputDirectory(self: Pin<&mut ElastixImageFilter>); + #[doc = " \\brief Sets the name of the current log file."] + pub fn SetLogFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + logFileName: UniquePtr, + ); + #[doc = " \\brief Returns the name of the current log file."] + pub fn GetLogFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Clears the name of the current log file."] + pub fn RemoveLogFileName(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Switches logging to file on (`true`) or off (`false`), as specified by its function argument."] + pub fn SetLogToFile(self: Pin<&mut ElastixImageFilter>, logToFile: bool); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns whether logging to file is switched on."] + pub fn GetLogToFile(self: Pin<&mut ElastixImageFilter>) -> bool; + #[namespace = "itk::simple"] + #[doc = " \\brief Switches logging to file on"] + pub fn LogToFileOn(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Switches logging to file off."] + pub fn LogToFileOff(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Switches logging to console on (`true`) or off (`false`), as specified by its function argument."] + pub fn SetLogToConsole(self: Pin<&mut ElastixImageFilter>, arg1: bool); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns whether logging to console is switched on."] + pub fn GetLogToConsole(self: Pin<&mut ElastixImageFilter>) -> bool; + #[namespace = "itk::simple"] + #[doc = " \\brief Switches logging to console on"] + pub fn LogToConsoleOn(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Switches logging to console off"] + pub fn LogToConsoleOff(self: Pin<&mut ElastixImageFilter>); + #[namespace = "itk::simple"] + #[doc = " \\brief Sets the maximum number of threads to the specified number \\p n.\n \\note As a side effect, it may modify the *global* maximum number of threads, as it internally calls ITK's\n `MultiThreaderBase.SetGlobalMaximumNumberOfThreads`."] + pub fn SetNumberOfThreads(self: Pin<&mut ElastixImageFilter>, n: c_int); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns the current maximum number of threads."] + pub fn GetNumberOfThreads(self: Pin<&mut ElastixImageFilter>) -> c_int; + #[doc = " \\brief Specifies the parameter map by a \\p transformName (\"translation\", \"rigid\" , \"affine\", \"nonrigid\", or\n \"bspline\"), and optionally \\p numberOfResolutions and \\p finalGridSpacingInPhysicalUnits."] + pub fn SetParameterMap_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + transformName: UniquePtr, + numberOfResolutions: c_uint, + finalGridSpacingInPhysicalUnits: f64, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Returns the number of parameter maps."] + pub fn GetNumberOfParameterMaps(self: Pin<&mut ElastixImageFilter>) -> c_uint; + #[doc = " \\brief Sets the value of the parameter specified by \\p key, in all parameter maps."] + pub fn SetParameter_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + key: UniquePtr, + value: UniquePtr, + ); + #[doc = " \\brief Sets the values of the parameter specified by \\p key, in all parameter maps."] + pub unsafe fn SetParameter1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + key: UniquePtr, + value: *mut CxxVector, + ); + #[doc = " \\brief Sets the value of the parameter specified by \\p key, in the parameter map at the specified (zero-based) \\p\n index."] + pub fn SetParameter2_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + index: c_uint, + key: UniquePtr, + value: UniquePtr, + ); + #[doc = " \\brief Sets the values of the parameter specified by \\p key, in the parameter map at the specified (zero-based) \\p\n index."] + pub unsafe fn SetParameter3_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + index: c_uint, + key: UniquePtr, + value: *mut CxxVector, + ); + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified value to all parameter maps."] + pub fn AddParameter_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + key: UniquePtr, + value: UniquePtr, + ); + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified value to the parameter map at the specified\n (zero-based) \\p index."] + pub fn AddParameter1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + index: c_uint, + key: UniquePtr, + value: UniquePtr, + ); + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified values to all parameter maps."] + pub unsafe fn AddParameter2_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + key: UniquePtr, + value: *mut CxxVector, + ); + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified values to the parameter map at the specified\n (zero-based) \\p index."] + pub unsafe fn AddParameter3_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + index: c_uint, + key: UniquePtr, + value: *mut CxxVector, + ); + #[doc = " \\brief Retrieves the values of the parameter specified by \\p key, when there is only one parameter map."] + pub fn GetParameter_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + key: UniquePtr, + ) -> UniquePtr>; + #[doc = " \\brief Retrieves the values of the parameter specified by \\p key, from the parameter map at the specified\n (zero-based) \\p index."] + pub fn GetParameter1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + index: c_uint, + key: UniquePtr, + ) -> UniquePtr>; + #[doc = " \\brief Removes the parameter specified by \\p key from all parameter maps."] + pub fn RemoveParameter_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + key: UniquePtr, + ); + #[doc = " \\brief Removes the parameter specified by \\p key from the parameter map at the specified (zero-based) \\p index."] + pub fn RemoveParameter1_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + index: c_uint, + key: UniquePtr, + ); + #[doc = " \\brief Specifies the initial transformation by the specified transform parameter file name."] + pub fn SetInitialTransformParameterFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + initialTransformParmaterFileName: UniquePtr, + ); + #[doc = " \\brief Returns the initial transform parameter file name."] + pub fn GetInitialTransformParameterFileName_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + ) -> UniquePtr; + #[namespace = "itk::simple"] + #[doc = " \\brief Clears the initial transform parameter file name."] + pub fn RemoveInitialTransformParameterFileName(self: Pin<&mut ElastixImageFilter>); + #[doc = " \\brief Executes the registration, and returns the result image.\n \\note Before executing, the number of moving images must equal the number of fixed images,\n the number of fixed masks must be either zero, or one, or equal to the number of fixed images,\n and the number of moving masks must be either zero, or one, or equal to the number of moving images"] + pub unsafe fn Execute_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + placement_return_type: *mut Image, + ); + #[doc = " \\brief Returns the result image."] + pub unsafe fn GetResultImage_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: Pin<&mut ElastixImageFilter>, + placement_return_type: *mut Image, + ); + #[namespace = "itk::simple"] + #[doc = " \\brief Prints all parameter maps to standard output."] + pub fn PrintParameterMap(self: Pin<&mut ElastixImageFilter>); + #[doc = " \\brief Default-constructor."] + pub unsafe fn itk_simple_ElastixImageFilter_new_autocxx_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut ElastixImageFilter, + ); + #[doc = " \\brief Destructor."] + pub unsafe fn ElastixImageFilter_destructor_autocxx_wrapper_0x663a7a2eb658d678( + autocxx_gen_this: *mut ElastixImageFilter, + ); + #[namespace = "itk"] + #[cxx_name = "DataObject"] + type DataObject; + #[namespace = "itk::simple"] + #[cxx_name = "PixelIDValueEnum"] + #[doc = " \\brief Enumerated values of pixelIDs\n\n Each PixelID's value corresponds to the index of the PixelID type,\n in the type list \"InstantiatedPixelIDTypeList\". It is possible that\n different configurations for SimpleITK could result in different\n values for pixelID. So these enumerated values should be used.\n\n Additionally, not all PixelID an instantiated in for the tool\n kit. If a PixelID is not instantiated then it's value is\n -1. Therefore it is likely that multiple elements in the\n enumeration will have a zero value. Therefore the first preferred\n method is to + use \"if\" statements, with the first branch checking\n for the Unknown value.\n\n If a switch case statement is needed the ConditionalValue\n meta-programming object can be used as follows:\n \\code\n switch( pixelIDValue )\n {\n case sitk::sitkUnknown:\n // handle exceptional case\n break\n case sitk::ConditionalValue< sitk::sitkUInt8 != sitk::sitkUnknown, sitk::sitkUInt8, -2 >::Value:\n ...\n break;\n case sitk::ConditionalValue< sitk::sitkInt8 != sitk::sitkUnknown, sitk::sitkInt8, -3 >::Value:\n ...\n break;\n case sitk::ConditionalValue< sitk::N != sitk::sitkUnknown, sitk::N, -N >::Value:\n ...\n break;\n default:\n // handle another exceptional case\n }\n \\endcode"] + type PixelIDValueEnum = super::itk::simple::PixelIDValueEnum; + type std_complex_float_AutocxxConcrete; + type std_complex_double_AutocxxConcrete; + #[namespace = "itk"] + #[cxx_name = "TransformBase"] + type TransformBase; + #[namespace = "itk::simple"] + #[cxx_name = "TransformEnum"] + type TransformEnum = super::itk::simple::TransformEnum; + #[namespace = "itk::simple"] + #[cxx_name = "PimpleTransformBase"] + type PimpleTransformBase; + type c_int = autocxx::c_int; + type c_uint = autocxx::c_uint; + type c_void = autocxx::c_void; + type c_ulong = autocxx::c_ulong; + include!("sitkAdditionalProcedures.h"); + include!("sitkAffineTransform.h"); + include!("sitkElastixImageFilter.h"); + include!("sitkInterpolator.h"); + include!("sitkImage.h"); + include!("sitkTransform.h"); + include!("autocxxgen_ffi.h"); + } + extern "Rust" {} + } + #[allow(unused_imports)] + use super::ffi as output; + #[allow(unused_imports)] + use bindgen::root; + pub use cxxbridge::autocxx_make_string_0x663a7a2eb658d678 as make_string; + pub use cxxbridge::std_complex_double_AutocxxConcrete; + pub use cxxbridge::std_complex_float_AutocxxConcrete; + pub mod itk { + pub use super::cxxbridge::DataObject; + pub use super::cxxbridge::TransformBase; + #[allow(unused_imports)] + use super::{bindgen, cxxbridge, output}; + pub mod simple { + #[allow(unused_imports)] + pub use super::super::bindgen::root::itk::simple::InterpolatorEnum; + #[allow(unused_imports)] + use super::{bindgen, cxxbridge, output}; + use crate::ffi::ToCppString; + unsafe impl cxx::ExternType for InterpolatorEnum { + type Id = cxx::type_id!("itk::simple::InterpolatorEnum"); + type Kind = cxx::kind::Trivial; + } + #[repr(transparent)] + #[doc = " \\class Image\n \\brief The Image class for SimpleITK\n\n This Image class can represent 2D, 3D, and 4D images. The pixel\n types may be a scalar, a multi-component vector or a\n run-length-encoded (RLE) \"label\". The dimension, pixel type and\n size is specified at construction.\n\n A fundamental concept of ITK images is that they occupy physical\n space where the image is defined by an origin, spacing, and\n direction cosine matrix. The attributes are taken into\n consideration when doing most operations on an image. A meta-data\n dictionary is also associated with the image, which may contain\n additional fields from reading but these attributes are not\n propagated by image filters.\n\n The SimpleITK Image provides a single facade interface to several\n ITK image types. Internally, the SimpleITK Image maintains a\n pointer to the ITK image class, and performs reference counting\n and lazy copying. This means that deep copying of an image\n including it's buffer is delayed until the image is\n modified. This removes the need to + use pointers to SimpleITK\n Image class, as copying and returning by value do not\n unnecessarily duplicate the data.\n\n \\sa itk::Image itk::VectorImage itk::LabelMap itk::ImageBase"] + pub struct Image { + _hidden_contents: ::core::cell::UnsafeCell< + ::core::mem::MaybeUninit, + >, + } + unsafe impl cxx::ExternType for Image { + type Id = cxx::type_id!("itk::simple::Image"); + type Kind = cxx::kind::Opaque; + } + #[repr(transparent)] + #[doc = " \\class Transform\n \\brief A simplified wrapper around a variety of ITK transforms.\n\n The interface to ITK transform objects to be used with the\n ImageRegistrationMethod, ResampleImageFilter and other SimpleITK\n process objects. The transforms are designed to have a serialized\n array of parameters to facilitate optimization for registration.\n\n Provides a base class interface to any type of ITK\n transform. Objects of this type may have their interface converted\n to a derived interface while keeping the same reference to the ITK\n object.\n\n Additionally, this class provides a basic interface to a composite\n transforms.\n\n \\sa itk::CompositeTransform"] + pub struct Transform { + _hidden_contents: ::core::cell::UnsafeCell< + ::core::mem::MaybeUninit, + >, + } + unsafe impl cxx::ExternType for Transform { + type Id = cxx::type_id!("itk::simple::Transform"); + type Kind = cxx::kind::Opaque; + } + #[repr(transparent)] + #[doc = " \\class AffineTransform\n \\brief An affine transformation about a fixed center with\n translation for a 2D or 3D coordinate.\n\n \\sa itk::AffineTransform"] + pub struct AffineTransform { + _hidden_contents: ::core::cell::UnsafeCell< + ::core::mem::MaybeUninit< + super::super::bindgen::root::itk::simple::AffineTransform, + >, + >, + } + unsafe impl cxx::ExternType for AffineTransform { + type Id = cxx::type_id!("itk::simple::AffineTransform"); + type Kind = cxx::kind::Opaque; + } + #[repr(transparent)] + #[doc = " \\class ElastixImageFilter\n \\brief The class that wraps the elastix registration library."] + pub struct ElastixImageFilter { + _hidden_contents: ::core::cell::UnsafeCell< + ::core::mem::MaybeUninit< + super::super::bindgen::root::itk::simple::ElastixImageFilter, + >, + >, + } + unsafe impl cxx::ExternType for ElastixImageFilter { + type Id = cxx::type_id!("itk::simple::ElastixImageFilter"); + type Kind = cxx::kind::Opaque; + } + #[doc = " \\brief itk::simple::ResampleImageFilter Procedural Interface\n\n These functions call the execute method of ResampleImageFilter\n in order to support a procedural API.\n\n The difference between the three functions is in the way the output\n image's domain parameters are specified (origin, spacing,\n direction). The first function uses the parameters from the input image,\n the second uses the parameters of a reference image, and the third uses\n explicitly specified parameters.\n\n \\sa itk::simple::ResampleImageFilter for the object oriented interface\n @{"] + pub fn Resample<'a>( + image1: &'a output::itk::simple::Image, + transform: impl autocxx::ValueParam + 'a, + interpolator: output::itk::simple::InterpolatorEnum, + defaultPixelValue: f64, + outputPixelType: output::itk::simple::PixelIDValueEnum, + useNearestNeighborExtrapolator: bool, + ) -> impl autocxx::moveit::new::New + 'a + { + unsafe { + autocxx::moveit::new::by_raw(move |placement_return_type| { + let mut space0 = autocxx::ValueParamHandler::default(); + let mut space0 = ::core::pin::Pin::new_unchecked(&mut space0); + space0.as_mut().populate(transform); + let placement_return_type = + placement_return_type.get_unchecked_mut().as_mut_ptr(); + cxxbridge::Resample_autocxx_wrapper_0x663a7a2eb658d678( + image1, + space0.get_ptr(), + interpolator, + defaultPixelValue, + outputPixelType, + useNearestNeighborExtrapolator, + placement_return_type, + ) + }) + } + } + #[allow(unused_imports)] + pub use super::super::bindgen::root::itk::simple::PixelIDValueEnum; + unsafe impl cxx::ExternType for PixelIDValueEnum { + type Id = cxx::type_id!("itk::simple::PixelIDValueEnum"); + type Kind = cxx::kind::Trivial; + } + #[allow(unused_imports)] + pub use super::super::bindgen::root::itk::simple::PixelIDValueType; + #[allow(unused_imports)] + pub use super::super::bindgen::root::itk::simple::TransformEnum; + unsafe impl cxx::ExternType for TransformEnum { + type Id = cxx::type_id!("itk::simple::TransformEnum"); + type Kind = cxx::kind::Trivial; + } + #[allow(unused_imports)] + pub use super::super::bindgen::root::itk::simple::ElastixImageFilter_VectorOfImage; + pub use super::super::cxxbridge::PimpleTransformBase; + impl Image { + #[doc = " \\brief Advanced method not commonly needed\n\n This method is designed to support implementations \"in-place\" object behavior for methods which operate on\n r-value references. The returned image is a new image which has a low level pointer to this object's image\n buffer, without the SimpleITK or ITK reference counting. This is implemented by setting the new ITK Image's\n buffer to the same as this objects without ownership.\n\n \\warning This method bypasses the SimpleITK reference counting, and the reference needs to be manually maintained\n in the scope. The resulting object is designed only to be a temporary.\n\n In the following example this method is used instead of an `std::move` call when the filter's first argument\n takes an r-value reference. The `img` object will container the results of the filter execution, and the `img`\n image buffer will be preserved in case of exceptions, and the meta-data will remain in the img object.\n \\code\n filter.Execute( img.ProxyForInPlaceOperation() );\n \\endcode\n\n The meta-data dictionary is not copied to the returned proxy image."] + pub fn ProxyForInPlaceOperation<'a>( + self: ::core::pin::Pin<&'a mut output::itk::simple::Image>, + ) -> impl autocxx::moveit::new::New + 'a + { + unsafe { + autocxx::moveit::new::by_raw(move |placement_return_type| { + let placement_return_type = + placement_return_type.get_unchecked_mut().as_mut_ptr(); + cxxbridge::ProxyForInPlaceOperation_autocxx_wrapper_0x663a7a2eb658d678( + self, + placement_return_type, + ) + }) + } + } + #[doc = " Return the pixel type as a human readable string value."] + pub fn GetPixelIDTypeAsString( + self: &output::itk::simple::Image, + ) -> cxx::UniquePtr { + cxxbridge::GetPixelIDTypeAsString_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " Get/Set the Origin in physical space\n @{"] + pub fn GetOrigin( + self: &output::itk::simple::Image, + ) -> cxx::UniquePtr> { + cxxbridge::GetOrigin_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " Get/Set the Spacing of the Image as an std::vector .\n\n The spacing describes the physical size of each pixel. The\n length of the vector is equal to the dimension of the Image.\n @{"] + pub fn GetSpacing( + self: &output::itk::simple::Image, + ) -> cxx::UniquePtr> { + cxxbridge::GetSpacing_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Set/Get the Direction\n\n Internally, the Direction is represented by a matrix 2x2 for a\n 2D and 3x3 for a 3D image. The matrix is passed as a 1D\n array in row-major form.\n @{"] + pub fn GetDirection( + self: &output::itk::simple::Image, + ) -> cxx::UniquePtr> { + cxxbridge::GetDirection_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " Transform index to physical point"] + pub fn TransformIndexToPhysicalPoint( + self: &output::itk::simple::Image, + index: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::TransformIndexToPhysicalPoint_autocxx_wrapper_0x663a7a2eb658d678( + self, index, + ) + } + #[doc = " Transform physical point to index"] + pub fn TransformPhysicalPointToIndex( + self: &output::itk::simple::Image, + point: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::TransformPhysicalPointToIndex_autocxx_wrapper_0x663a7a2eb658d678( + self, point, + ) + } + #[doc = " Transform physical point to continuous index"] + pub fn TransformPhysicalPointToContinuousIndex( + self: &output::itk::simple::Image, + point: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge :: TransformPhysicalPointToContinuousIndex_autocxx_wrapper_0x663a7a2eb658d678 (self , point) + } + #[doc = " Transform continuous index to physical point"] + pub fn TransformContinuousIndexToPhysicalPoint( + self: &output::itk::simple::Image, + index: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge :: TransformContinuousIndexToPhysicalPoint_autocxx_wrapper_0x663a7a2eb658d678 (self , index) + } + #[doc = " \\brief Interpolate pixel value at a continuous index.\n\n This method is not supported for Label pixel types.\n\n The valid range of continuous index is [-0.5, size-0.5] for each dimension. An exception is thrown if index is out\n of bounds.\n\n @param index The continuous index must be at least the length of the image dimension.\n @param interp The interpolation type to use, only sitkNearest and sitkLinear are supported for Vector and Complex\n pixel types.\n\n @return All supported pixel types are returned as an array, where complex numbers are returned with the real\n followed by the complex component."] + pub fn EvaluateAtContinuousIndex( + self: &output::itk::simple::Image, + index: &cxx::CxxVector, + interp: output::itk::simple::InterpolatorEnum, + ) -> cxx::UniquePtr> { + cxxbridge::EvaluateAtContinuousIndex_autocxx_wrapper_0x663a7a2eb658d678( + self, index, interp, + ) + } + #[doc = " Interpolate pixel value at a physical point.\n\n This method is not supported for Label pixel types.\n\n An exception is thrown if the point is out of the defined region for the image.\n\n @param point The physical point at which the interpolation is computed.\n @param interp The interpolation type to use, only sitkNearest and sitkLinear are supported for Vector and Complex\n pixel types.\n\n @return All supported pixel types are returned as an array, where complex numbers are returned with the real\n followed by the complex component."] + pub fn EvaluateAtPhysicalPoint( + self: &output::itk::simple::Image, + point: &cxx::CxxVector, + interp: output::itk::simple::InterpolatorEnum, + ) -> cxx::UniquePtr> { + cxxbridge::EvaluateAtPhysicalPoint_autocxx_wrapper_0x663a7a2eb658d678( + self, point, interp, + ) + } + #[doc = " autocxx bindings couldn't be generated: A C++ std::vector was found containing some type that cxx can't accommodate as a vector element (unsigned int)"] + fn GetSize(_uhoh: autocxx::BindingGenerationFailure) {} + #[doc = " \\brief get a vector of keys in from the meta-data dictionary\n\n Returns a vector of keys to the key/value entries in the\n image's meta-data dictionary. Iterate through with these keys\n to get the values."] + pub fn GetMetaDataKeys( + self: &output::itk::simple::Image, + ) -> cxx::UniquePtr> { + cxxbridge::GetMetaDataKeys_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Get the value of a meta-data dictionary entry as a string.\n\n If the key is not in the dictionary then an exception is\n thrown.\n\n string types in the dictionary are returned as their native\n strings. Other types are printed to string before returning."] + pub fn GetMetaData( + self: &output::itk::simple::Image, + key: &cxx::CxxString, + ) -> cxx::UniquePtr { + cxxbridge::GetMetaData_autocxx_wrapper_0x663a7a2eb658d678(self, key) + } + pub fn ToString( + self: &output::itk::simple::Image, + ) -> cxx::UniquePtr { + cxxbridge::ToString_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Convert the first dimension to the components for image with vector pixel type.\n\n This method will convert a scalar image to a vector image with\n the number of components equal to the size of the first\n dimension. If the image is already a vector image then the\n image is returned.\n\n The components of the direction cosine matrix for the first dimension must be the identity matrix, or else an\n exception is thrown.\n\n An exception is thrown if the image is 2D or if the pixel type is a label or complex pixel type.\n\n \\param inPlace If true then the image is made unique and converted in place updating this image,\n otherwise a copy of the image is made and returned.\n\n \\sa ToScalarImage"] + pub fn ToVectorImage<'a>( + self: ::core::pin::Pin<&'a mut output::itk::simple::Image>, + inPlace: bool, + ) -> impl autocxx::moveit::new::New + 'a + { + unsafe { + autocxx::moveit::new::by_raw(move |placement_return_type| { + let placement_return_type = + placement_return_type.get_unchecked_mut().as_mut_ptr(); + cxxbridge::ToVectorImage_autocxx_wrapper_0x663a7a2eb658d678( + self, + inPlace, + placement_return_type, + ) + }) + } + } + #[doc = " \\brief Convert a image of vector pixel type to a scalar image with N+1 dimensions.\n\n This method will convert a vector image to a scalar image with\n the size of the first dimension equal to the number of\n components. If the image is already a scalar image then the\n image is returned.\n\n For the additional dimension the origin is set to zero, the spacing to one, and the new components of the\n direction cosine to the identity matrix.\n\n An exception is thrown if the image is has SITK_MAX_DIMENSION dimensions or if the pixel type is a label or\n complex pixel type.\n\n \\param inPlace If true then the image is made unique and converted in place updating this image,\n otherwise a copy of the image is made and returned.\n\n \\sa ToVectorImage"] + pub fn ToScalarImage<'a>( + self: ::core::pin::Pin<&'a mut output::itk::simple::Image>, + inPlace: bool, + ) -> impl autocxx::moveit::new::New + 'a + { + unsafe { + autocxx::moveit::new::by_raw(move |placement_return_type| { + let placement_return_type = + placement_return_type.get_unchecked_mut().as_mut_ptr(); + cxxbridge::ToScalarImage_autocxx_wrapper_0x663a7a2eb658d678( + self, + inPlace, + placement_return_type, + ) + }) + } + } + pub fn GetPixelAsVectorInt8( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorInt8_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorUInt8( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorUInt8_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorInt16( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorInt16_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorUInt16( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorUInt16_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorInt32( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorInt32_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorUInt32( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorUInt32_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorInt64( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorInt64_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorUInt64( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorUInt64_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorFloat32( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorFloat32_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsVectorFloat64( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::GetPixelAsVectorFloat64_autocxx_wrapper_0x663a7a2eb658d678(self, idx) + } + pub fn GetPixelAsComplexFloat32( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr { + cxxbridge::GetPixelAsComplexFloat32_autocxx_wrapper_0x663a7a2eb658d678( + self, idx, + ) + } + pub fn GetPixelAsComplexFloat64( + self: &output::itk::simple::Image, + idx: &cxx::CxxVector, + ) -> cxx::UniquePtr { + cxxbridge::GetPixelAsComplexFloat64_autocxx_wrapper_0x663a7a2eb658d678( + self, idx, + ) + } + pub fn SetPixelAsComplexFloat32( + self: ::core::pin::Pin<&mut output::itk::simple::Image>, + idx: &cxx::CxxVector, + v: impl autocxx::ValueParam, + ) { + let mut space0 = autocxx::ValueParamHandler::default(); + let mut space0 = unsafe { ::core::pin::Pin::new_unchecked(&mut space0) }; + unsafe { + space0.as_mut().populate(v); + cxxbridge::SetPixelAsComplexFloat32_autocxx_wrapper_0x663a7a2eb658d678( + self, + idx, + space0.get_ptr(), + ) + } + } + pub fn SetPixelAsComplexFloat64( + self: ::core::pin::Pin<&mut output::itk::simple::Image>, + idx: &cxx::CxxVector, + v: impl autocxx::ValueParam, + ) { + let mut space0 = autocxx::ValueParamHandler::default(); + let mut space0 = unsafe { ::core::pin::Pin::new_unchecked(&mut space0) }; + unsafe { + space0.as_mut().populate(v); + cxxbridge::SetPixelAsComplexFloat64_autocxx_wrapper_0x663a7a2eb658d678( + self, + idx, + space0.get_ptr(), + ) + } + } + #[doc = " autocxx bindings couldn't be generated: Problem handling function argument size: A C++ std::vector was found containing some type that cxx can't accommodate as a vector element (unsigned int)"] + fn Allocate(_uhoh: autocxx::BindingGenerationFailure) {} + #[doc = " autocxx bindings couldn't be generated: This method is private"] + fn InternalInitialization(_uhoh: autocxx::BindingGenerationFailure) {} + #[doc = " \\brief Default constructor, creates an image of size 0"] + pub fn new() -> impl autocxx::moveit::new::New { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge::new_autocxx_autocxx_wrapper_0x663a7a2eb658d678(this) + }) + } + } + #[doc = " \\brief Constructors for 2D, 3D an optionally 4D images where\n pixel type and number of components can be specified.\n\n If the pixel type is a scalar or a label pixel type, then the\n number of components must be specified as 0 or 1.\n\n If the pixel type is a vector pixel type, then the number of\n components defaults to the image dimension, unless the\n numberOfComponents is explicitly specified.\n\n Unlike the standard convention for Dimensional Vectors the size\n parameter must be the exact dimension requesting. That is, it must be of\n length 2 of a 2D image, 3 for a 3D image and 4 for a 4D image.\n @{"] + pub fn new3( + width: autocxx::c_uint, + height: autocxx::c_uint, + valueEnum: output::itk::simple::PixelIDValueEnum, + ) -> impl autocxx::moveit::new::New { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge::new3_autocxx_wrapper_0x663a7a2eb658d678( + this, width, height, valueEnum, + ) + }) + } + } + pub fn new4( + width: autocxx::c_uint, + height: autocxx::c_uint, + depth: autocxx::c_uint, + valueEnum: output::itk::simple::PixelIDValueEnum, + ) -> impl autocxx::moveit::new::New { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge::new4_autocxx_wrapper_0x663a7a2eb658d678( + this, width, height, depth, valueEnum, + ) + }) + } + } + #[doc = " autocxx bindings couldn't be generated: Problem handling function argument size: A C++ std::vector was found containing some type that cxx can't accommodate as a vector element (unsigned int)"] + fn new5(_uhoh: autocxx::BindingGenerationFailure) {} + #[doc = " autocxx bindings couldn't be generated: Problem handling function argument pimpleImage: Found an attempt at using a forward declaration (itk::simple::PimpleImageBase) inside a templated cxx type such as UniquePtr or CxxVector. If the forward declaration is a typedef, perhaps autocxx wasn't sure whether or not it involved a forward declaration. If you're sure it didn't, then you may be able to solve this by using instantiable!."] + fn new6(_uhoh: autocxx::BindingGenerationFailure) {} + } + impl Transform { + #[doc = " Get access to internal ITK data object.\n\n The return value should immediately be assigned to as\n itk::SmartPointer.\n\n In many cases the value may need to be dynamically cast to\n the actual transform type.\n\n @{"] + pub fn GetITKBase( + self: ::core::pin::Pin<&mut output::itk::simple::Transform>, + ) -> *mut output::itk::TransformBase { + cxxbridge::itk_simple_Transform_GetITKBase_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + pub fn GetITKBase1( + self: &output::itk::simple::Transform, + ) -> *const output::itk::TransformBase { + cxxbridge::itk_simple_Transform_GetITKBase1_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + #[doc = " Return the dimension of the Transform ( 2D or 3D )"] + pub fn GetDimension(self: &output::itk::simple::Transform) -> autocxx::c_uint { + cxxbridge::itk_simple_Transform_GetDimension_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + pub fn GetParameters( + self: &output::itk::simple::Transform, + ) -> cxx::UniquePtr> { + cxxbridge::GetParameters_autocxx_wrapper_0x663a7a2eb658d678(self) + } + pub fn GetFixedParameters( + self: &output::itk::simple::Transform, + ) -> cxx::UniquePtr> { + cxxbridge::GetFixedParameters_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " Apply transform to a point.\n\n The dimension of the point must match the transform."] + pub fn TransformPoint( + self: &output::itk::simple::Transform, + point: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::TransformPoint_autocxx_wrapper_0x663a7a2eb658d678(self, point) + } + #[doc = " Apply transform to a vector at a point.\n\n The ITK concept of a vector is a direction at a specific point,\n for example the difference between two points is a vector.\n\n For linear transforms the point does not matter, in general\n the vector is transformed by the Jacobian with respect to point\n position.\n\n The dimension of the vector and point must match the transform."] + pub fn TransformVector( + self: &output::itk::simple::Transform, + vector: &cxx::CxxVector, + point: &cxx::CxxVector, + ) -> cxx::UniquePtr> { + cxxbridge::TransformVector_autocxx_wrapper_0x663a7a2eb658d678( + self, vector, point, + ) + } + #[doc = " \\brief Return a new inverse transform of the same type as this.\n\n Creates a new transform object and tries to set the value to the\n inverse. As not all transform types have inverse and some\n transforms are not invertible, an exception will be throw is\n there is no inverse."] + pub fn GetInverse<'a>( + self: &'a output::itk::simple::Transform, + ) -> impl autocxx::moveit::new::New + 'a + { + unsafe { + autocxx::moveit::new::by_raw(move |placement_return_type| { + let placement_return_type = + placement_return_type.get_unchecked_mut().as_mut_ptr(); + cxxbridge::GetInverse_autocxx_wrapper_0x663a7a2eb658d678( + self, + placement_return_type, + ) + }) + } + } + pub fn ToString( + self: &output::itk::simple::Transform, + ) -> cxx::UniquePtr { + cxxbridge::itk_simple_Transform_ToString_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + #[doc = " \\brief Performs actually coping if needed to make object unique.\n\n The Transform class by default performs lazy coping and\n assignment. This method make sure that coping actually happens\n to the itk::Transform pointed to is only pointed to by this\n object."] + pub fn MakeUnique(self: ::core::pin::Pin<&mut output::itk::simple::Transform>) { + cxxbridge::itk_simple_Transform_MakeUnique_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + #[doc = " autocxx bindings couldn't be generated: This method is private"] + fn InternalInitialization(_uhoh: autocxx::BindingGenerationFailure) {} + #[doc = " \\brief By default a 3-d identity transform is constructed"] + pub fn new() -> impl autocxx::moveit::new::New { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge :: itk_simple_Transform_new_autocxx_autocxx_wrapper_0x663a7a2eb658d678 (this) + }) + } + } + pub unsafe fn new1( + transform: *mut output::itk::TransformBase, + ) -> impl autocxx::moveit::new::New { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge::itk_simple_Transform_new1_autocxx_wrapper_0x663a7a2eb658d678( + this, transform, + ) + }) + } + #[doc = " \\brief Construct a specific transformation\n\n \\deprecated This constructor will be removed in future releases."] + pub fn new2( + dimensions: autocxx::c_uint, + type_: output::itk::simple::TransformEnum, + ) -> impl autocxx::moveit::new::New { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge::itk_simple_Transform_new2_autocxx_wrapper_0x663a7a2eb658d678( + this, dimensions, type_, + ) + }) + } + } + #[doc = " \\brief Use an image to construct a transform.\n\n The input displacement image is transferred to the constructed\n transform object. The input image is modified to be a default\n constructed Image object.\n\n Only the sitkDisplacementField transformation type can currently\n be constructed this way. Image must be of sitkVectorFloat64 pixel\n type with the number of components equal to the image dimension.\n\n \\deprecated This constructor will be removed in future releases."] + pub fn new3<'a>( + displacement: ::core::pin::Pin<&'a mut output::itk::simple::Image>, + type_: output::itk::simple::TransformEnum, + ) -> impl autocxx::moveit::new::New + 'a { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge::itk_simple_Transform_new3_autocxx_wrapper_0x663a7a2eb658d678( + this, + displacement, + type_, + ) + }) + } + } + pub fn IsLinear(self: &output::itk::simple::Transform) -> bool { + cxxbridge::IsLinear_autocxx_wrapper_0x663a7a2eb658d678(self) + } + pub fn SetIdentity(self: ::core::pin::Pin<&mut output::itk::simple::Transform>) { + cxxbridge::SetIdentity_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Try to change the current transform to it's inverse.\n\n If the transform has an inverse, i.e. non-singular linear\n transforms, then a new ITK transform is created of the same type\n and this object is set to it.\n\n However not all transform have a direct inverse, if the inverse\n does not exist or fails false will be returned and this transform\n will not be modified."] + pub fn SetInverse( + self: ::core::pin::Pin<&mut output::itk::simple::Transform>, + ) -> bool { + cxxbridge::SetInverse_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " return user readable name for the SimpleITK transform"] + pub fn GetName( + self: &output::itk::simple::Transform, + ) -> cxx::UniquePtr { + cxxbridge::GetName_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " autocxx bindings couldn't be generated: Problem handling function argument pimpleTransform: Found an attempt at using a forward declaration (itk::simple::PimpleTransformBase) inside a templated cxx type such as UniquePtr or CxxVector. If the forward declaration is a typedef, perhaps autocxx wasn't sure whether or not it involved a forward declaration. If you're sure it didn't, then you may be able to solve this by using instantiable!."] + fn SetPimpleTransform(_uhoh: autocxx::BindingGenerationFailure) {} + } + impl AffineTransform { + #[doc = " parameters"] + pub fn GetTranslation( + self: &output::itk::simple::AffineTransform, + ) -> cxx::UniquePtr> { + cxxbridge::GetTranslation_autocxx_wrapper_0x663a7a2eb658d678(self) + } + pub fn GetMatrix( + self: &output::itk::simple::AffineTransform, + ) -> cxx::UniquePtr> { + cxxbridge::GetMatrix_autocxx_wrapper_0x663a7a2eb658d678(self) + } + pub fn GetCenter( + self: &output::itk::simple::AffineTransform, + ) -> cxx::UniquePtr> { + cxxbridge::GetCenter_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " autocxx bindings couldn't be generated: This method is private"] + fn InternalInitialization(_uhoh: autocxx::BindingGenerationFailure) {} + pub fn new( + dimensions: autocxx::c_uint, + ) -> impl autocxx::moveit::new::New { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge :: itk_simple_AffineTransform_new_autocxx_autocxx_wrapper_0x663a7a2eb658d678 (this , dimensions) + }) + } + } + pub fn new2<'a>( + arg1: &'a output::itk::simple::Transform, + ) -> impl autocxx::moveit::new::New + 'a { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge :: itk_simple_AffineTransform_new2_autocxx_wrapper_0x663a7a2eb658d678 (this , arg1) + }) + } + } + pub fn new3<'a>( + matrix: &'a cxx::CxxVector, + translation: &'a cxx::CxxVector, + fixedCenter: &'a cxx::CxxVector, + ) -> impl autocxx::moveit::new::New + 'a { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge :: itk_simple_AffineTransform_new3_autocxx_wrapper_0x663a7a2eb658d678 (this , matrix , translation , fixedCenter) + }) + } + } + #[doc = " Name of this class"] + pub fn GetName( + self: &output::itk::simple::AffineTransform, + ) -> cxx::UniquePtr { + cxxbridge::itk_simple_AffineTransform_GetName_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + #[doc = " autocxx bindings couldn't be generated: Problem handling function argument pimpleTransform: Found an attempt at using a forward declaration (itk::simple::PimpleTransformBase) inside a templated cxx type such as UniquePtr or CxxVector. If the forward declaration is a typedef, perhaps autocxx wasn't sure whether or not it involved a forward declaration. If you're sure it didn't, then you may be able to solve this by using instantiable!."] + fn SetPimpleTransform(_uhoh: autocxx::BindingGenerationFailure) {} + } + impl ElastixImageFilter { + pub fn GetName( + self: &output::itk::simple::ElastixImageFilter, + ) -> cxx::UniquePtr { + cxxbridge :: itk_simple_ElastixImageFilter_GetName_autocxx_wrapper_0x663a7a2eb658d678 (self) + } + #[doc = " \\brief Specifies a set of points from the fixed image by a point set file, \\p fixedPointSetFileName."] + pub fn SetFixedPointSetFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + fixedPointSetFileName: impl ToCppString, + ) { + cxxbridge::SetFixedPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678( + self, + fixedPointSetFileName.into_cpp(), + ) + } + #[doc = " \\brief Returns the name of the current point set file of points from the fixed image."] + pub fn GetFixedPointSetFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + ) -> cxx::UniquePtr { + cxxbridge::GetFixedPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Specifies a set of points from the moving image by a point set file, \\p movingPointSetFileName."] + pub fn SetMovingPointSetFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + movingPointSetFileName: impl ToCppString, + ) { + cxxbridge::SetMovingPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678( + self, + movingPointSetFileName.into_cpp(), + ) + } + #[doc = " \\brief Returns the name of the current point set file of points from the moving image."] + pub fn GetMovingPointSetFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + ) -> cxx::UniquePtr { + cxxbridge::GetMovingPointSetFileName_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Sets the output directory."] + pub fn SetOutputDirectory( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + outputDirectory: impl ToCppString, + ) { + cxxbridge::SetOutputDirectory_autocxx_wrapper_0x663a7a2eb658d678( + self, + outputDirectory.into_cpp(), + ) + } + #[doc = " \\brief Returns the current output directory."] + pub fn GetOutputDirectory( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + ) -> cxx::UniquePtr { + cxxbridge::GetOutputDirectory_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Sets the name of the current log file."] + pub fn SetLogFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + logFileName: impl ToCppString, + ) { + cxxbridge::SetLogFileName_autocxx_wrapper_0x663a7a2eb658d678( + self, + logFileName.into_cpp(), + ) + } + #[doc = " \\brief Returns the name of the current log file."] + pub fn GetLogFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + ) -> cxx::UniquePtr { + cxxbridge::GetLogFileName_autocxx_wrapper_0x663a7a2eb658d678(self) + } + #[doc = " \\brief Specifies the parameter map by a \\p transformName (\"translation\", \"rigid\" , \"affine\", \"nonrigid\", or\n \"bspline\"), and optionally \\p numberOfResolutions and \\p finalGridSpacingInPhysicalUnits."] + pub fn SetParameterMap( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + transformName: impl ToCppString, + numberOfResolutions: autocxx::c_uint, + finalGridSpacingInPhysicalUnits: f64, + ) { + cxxbridge::SetParameterMap_autocxx_wrapper_0x663a7a2eb658d678( + self, + transformName.into_cpp(), + numberOfResolutions, + finalGridSpacingInPhysicalUnits, + ) + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn SetParameterMap1_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn SetParameterMaps_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn SetParameterMap2_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn AddParameterMap_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn GetParameterMap_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn GetParameterMaps_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn GetDefaultParameterMap_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " \\brief Sets the value of the parameter specified by \\p key, in all parameter maps."] + pub fn SetParameter( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + key: impl ToCppString, + value: impl ToCppString, + ) { + cxxbridge::SetParameter_autocxx_wrapper_0x663a7a2eb658d678( + self, + key.into_cpp(), + value.into_cpp(), + ) + } + #[doc = " \\brief Sets the values of the parameter specified by \\p key, in all parameter maps."] + pub fn SetParameter1( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + key: impl ToCppString, + value: impl autocxx::ValueParam>, + ) { + let mut space0 = autocxx::ValueParamHandler::default(); + let mut space0 = unsafe { ::core::pin::Pin::new_unchecked(&mut space0) }; + unsafe { + space0.as_mut().populate(value); + cxxbridge::SetParameter1_autocxx_wrapper_0x663a7a2eb658d678( + self, + key.into_cpp(), + space0.get_ptr(), + ) + } + } + #[doc = " \\brief Sets the value of the parameter specified by \\p key, in the parameter map at the specified (zero-based) \\p\n index."] + pub fn SetParameter2( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + index: autocxx::c_uint, + key: impl ToCppString, + value: impl ToCppString, + ) { + cxxbridge::SetParameter2_autocxx_wrapper_0x663a7a2eb658d678( + self, + index, + key.into_cpp(), + value.into_cpp(), + ) + } + #[doc = " \\brief Sets the values of the parameter specified by \\p key, in the parameter map at the specified (zero-based) \\p\n index."] + pub fn SetParameter3( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + index: autocxx::c_uint, + key: impl ToCppString, + value: impl autocxx::ValueParam>, + ) { + let mut space0 = autocxx::ValueParamHandler::default(); + let mut space0 = unsafe { ::core::pin::Pin::new_unchecked(&mut space0) }; + unsafe { + space0.as_mut().populate(value); + cxxbridge::SetParameter3_autocxx_wrapper_0x663a7a2eb658d678( + self, + index, + key.into_cpp(), + space0.get_ptr(), + ) + } + } + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified value to all parameter maps."] + pub fn AddParameter( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + key: impl ToCppString, + value: impl ToCppString, + ) { + cxxbridge::AddParameter_autocxx_wrapper_0x663a7a2eb658d678( + self, + key.into_cpp(), + value.into_cpp(), + ) + } + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified value to the parameter map at the specified\n (zero-based) \\p index."] + pub fn AddParameter1( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + index: autocxx::c_uint, + key: impl ToCppString, + value: impl ToCppString, + ) { + cxxbridge::AddParameter1_autocxx_wrapper_0x663a7a2eb658d678( + self, + index, + key.into_cpp(), + value.into_cpp(), + ) + } + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified values to all parameter maps."] + pub fn AddParameter2( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + key: impl ToCppString, + value: impl autocxx::ValueParam>, + ) { + let mut space0 = autocxx::ValueParamHandler::default(); + let mut space0 = unsafe { ::core::pin::Pin::new_unchecked(&mut space0) }; + unsafe { + space0.as_mut().populate(value); + cxxbridge::AddParameter2_autocxx_wrapper_0x663a7a2eb658d678( + self, + key.into_cpp(), + space0.get_ptr(), + ) + } + } + #[doc = " \\brief Adds a parameter specified by \\p key, with the specified values to the parameter map at the specified\n (zero-based) \\p index."] + pub fn AddParameter3( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + index: autocxx::c_uint, + key: impl ToCppString, + value: impl autocxx::ValueParam>, + ) { + let mut space0 = autocxx::ValueParamHandler::default(); + let mut space0 = unsafe { ::core::pin::Pin::new_unchecked(&mut space0) }; + unsafe { + space0.as_mut().populate(value); + cxxbridge::AddParameter3_autocxx_wrapper_0x663a7a2eb658d678( + self, + index, + key.into_cpp(), + space0.get_ptr(), + ) + } + } + #[doc = " \\brief Retrieves the values of the parameter specified by \\p key, when there is only one parameter map."] + pub fn GetParameter( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + key: impl ToCppString, + ) -> cxx::UniquePtr> { + cxxbridge::GetParameter_autocxx_wrapper_0x663a7a2eb658d678(self, key.into_cpp()) + } + #[doc = " \\brief Retrieves the values of the parameter specified by \\p key, from the parameter map at the specified\n (zero-based) \\p index."] + pub fn GetParameter1( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + index: autocxx::c_uint, + key: impl ToCppString, + ) -> cxx::UniquePtr> { + cxxbridge::GetParameter1_autocxx_wrapper_0x663a7a2eb658d678( + self, + index, + key.into_cpp(), + ) + } + #[doc = " \\brief Removes the parameter specified by \\p key from all parameter maps."] + pub fn RemoveParameter( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + key: impl ToCppString, + ) { + cxxbridge::RemoveParameter_autocxx_wrapper_0x663a7a2eb658d678( + self, + key.into_cpp(), + ) + } + #[doc = " \\brief Removes the parameter specified by \\p key from the parameter map at the specified (zero-based) \\p index."] + pub fn RemoveParameter1( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + index: autocxx::c_uint, + key: impl ToCppString, + ) { + cxxbridge::RemoveParameter1_autocxx_wrapper_0x663a7a2eb658d678( + self, + index, + key.into_cpp(), + ) + } + #[doc = " \\brief Specifies the initial transformation by the specified transform parameter file name."] + pub fn SetInitialTransformParameterFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + initialTransformParmaterFileName: impl ToCppString, + ) { + cxxbridge :: SetInitialTransformParameterFileName_autocxx_wrapper_0x663a7a2eb658d678 (self , initialTransformParmaterFileName . into_cpp ()) + } + #[doc = " \\brief Returns the initial transform parameter file name."] + pub fn GetInitialTransformParameterFileName( + self: ::core::pin::Pin<&mut output::itk::simple::ElastixImageFilter>, + ) -> cxx::UniquePtr { + cxxbridge :: GetInitialTransformParameterFileName_autocxx_wrapper_0x663a7a2eb658d678 (self) + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn ReadParameterFile_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn WriteParameterFile_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " \\brief Executes the registration, and returns the result image.\n \\note Before executing, the number of moving images must equal the number of fixed images,\n the number of fixed masks must be either zero, or one, or equal to the number of fixed images,\n and the number of moving masks must be either zero, or one, or equal to the number of moving images"] + pub fn Execute<'a>( + self: ::core::pin::Pin<&'a mut output::itk::simple::ElastixImageFilter>, + ) -> impl autocxx::moveit::new::New + 'a + { + unsafe { + autocxx::moveit::new::by_raw(move |placement_return_type| { + let placement_return_type = + placement_return_type.get_unchecked_mut().as_mut_ptr(); + cxxbridge::Execute_autocxx_wrapper_0x663a7a2eb658d678( + self, + placement_return_type, + ) + }) + } + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn GetTransformParameterMap_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: std::map"] + fn GetTransformParameterMap1_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " \\brief Returns the result image."] + pub fn GetResultImage<'a>( + self: ::core::pin::Pin<&'a mut output::itk::simple::ElastixImageFilter>, + ) -> impl autocxx::moveit::new::New + 'a + { + unsafe { + autocxx::moveit::new::by_raw(move |placement_return_type| { + let placement_return_type = + placement_return_type.get_unchecked_mut().as_mut_ptr(); + cxxbridge::GetResultImage_autocxx_wrapper_0x663a7a2eb658d678( + self, + placement_return_type, + ) + }) + } + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: itk::simple::ElastixImageFilter_ParameterMapType"] + fn PrintParameterMap1_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " autocxx bindings couldn't be generated: This item depends on some other type(s) which autocxx could not generate, some of them are: itk::simple::ElastixImageFilter_ParameterMapVectorType, itk::simple::ElastixImageFilter_ParameterMapType"] + fn PrintParameterMap2_autocxx_wrapper_0x663a7a2eb658d678( + _uhoh: autocxx::BindingGenerationFailure, + ) { + } + #[doc = " \\brief Default-constructor."] + pub fn new() -> impl autocxx::moveit::new::New { + unsafe { + autocxx::moveit::new::by_raw(move |this| { + let this = this.get_unchecked_mut().as_mut_ptr(); + cxxbridge :: itk_simple_ElastixImageFilter_new_autocxx_autocxx_wrapper_0x663a7a2eb658d678 (this) + }) + } + } + } + unsafe impl autocxx::moveit::MakeCppStorage for output::itk::simple::Image { + unsafe fn allocate_uninitialized_cpp_storage() -> *mut output::itk::simple::Image { + cxxbridge::Image_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678() + } + unsafe fn free_uninitialized_cpp_storage(arg0: *mut output::itk::simple::Image) { + cxxbridge::Image_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678(arg0) + } + } + unsafe impl autocxx::moveit::MakeCppStorage for output::itk::simple::Transform { + unsafe fn allocate_uninitialized_cpp_storage() -> *mut output::itk::simple::Transform + { + cxxbridge::Transform_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678() + } + unsafe fn free_uninitialized_cpp_storage( + arg0: *mut output::itk::simple::Transform, + ) { + cxxbridge::Transform_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678(arg0) + } + } + impl AsRef for output::itk::simple::AffineTransform { + fn as_ref( + self: &output::itk::simple::AffineTransform, + ) -> &output::itk::simple::Transform { + cxxbridge::cast_AffineTransform_to_Transform_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + } + unsafe impl autocxx::moveit::MakeCppStorage for output::itk::simple::AffineTransform { + unsafe fn allocate_uninitialized_cpp_storage( + ) -> *mut output::itk::simple::AffineTransform { + cxxbridge::AffineTransform_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678() + } + unsafe fn free_uninitialized_cpp_storage( + arg0: *mut output::itk::simple::AffineTransform, + ) { + cxxbridge::AffineTransform_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678(arg0) + } + } + unsafe impl autocxx::moveit::MakeCppStorage for output::itk::simple::ElastixImageFilter { + unsafe fn allocate_uninitialized_cpp_storage( + ) -> *mut output::itk::simple::ElastixImageFilter { + cxxbridge::ElastixImageFilter_autocxx_alloc_autocxx_wrapper_0x663a7a2eb658d678() + } + unsafe fn free_uninitialized_cpp_storage( + arg0: *mut output::itk::simple::ElastixImageFilter, + ) { + cxxbridge::ElastixImageFilter_autocxx_free_autocxx_wrapper_0x663a7a2eb658d678( + arg0, + ) + } + } + unsafe impl autocxx::moveit::new::CopyNew for output::itk::simple::Image { + unsafe fn copy_new( + img: &output::itk::simple::Image, + this: ::core::pin::Pin< + &mut ::core::mem::MaybeUninit, + >, + ) { + cxxbridge::new1_autocxx_wrapper_0x663a7a2eb658d678( + this.get_unchecked_mut().as_mut_ptr(), + img, + ) + } + } + unsafe impl autocxx::moveit::new::MoveNew for output::itk::simple::Image { + #[doc = " \\brief Move constructor and assignment.\n\n @param img After the operation img is valid only for\n destructing and assignment; all other operations have undefined\n behavior."] + unsafe fn move_new( + mut img: ::core::pin::Pin< + autocxx::moveit::MoveRef<'_, output::itk::simple::Image>, + >, + this: ::core::pin::Pin< + &mut ::core::mem::MaybeUninit, + >, + ) { + cxxbridge::new2_autocxx_wrapper_0x663a7a2eb658d678( + this.get_unchecked_mut().as_mut_ptr(), + { + let r: &mut _ = ::core::pin::Pin::into_inner_unchecked(img.as_mut()); + r + }, + ) + } + } + impl Drop for output::itk::simple::Image { + fn drop(self: &mut output::itk::simple::Image) { + unsafe { cxxbridge::Image_destructor_autocxx_wrapper_0x663a7a2eb658d678(self) } + } + } + unsafe impl autocxx::moveit::new::CopyNew for output::itk::simple::Transform { + unsafe fn copy_new( + arg1: &output::itk::simple::Transform, + this: ::core::pin::Pin< + &mut ::core::mem::MaybeUninit, + >, + ) { + cxxbridge::itk_simple_Transform_new4_autocxx_wrapper_0x663a7a2eb658d678( + this.get_unchecked_mut().as_mut_ptr(), + arg1, + ) + } + } + impl Drop for output::itk::simple::Transform { + fn drop(self: &mut output::itk::simple::Transform) { + unsafe { + cxxbridge::Transform_destructor_autocxx_wrapper_0x663a7a2eb658d678(self) + } + } + } + unsafe impl autocxx::moveit::new::CopyNew for output::itk::simple::AffineTransform { + unsafe fn copy_new( + arg1: &output::itk::simple::AffineTransform, + this: ::core::pin::Pin< + &mut ::core::mem::MaybeUninit, + >, + ) { + cxxbridge::itk_simple_AffineTransform_new1_autocxx_wrapper_0x663a7a2eb658d678( + this.get_unchecked_mut().as_mut_ptr(), + arg1, + ) + } + } + impl Drop for output::itk::simple::AffineTransform { + fn drop(self: &mut output::itk::simple::AffineTransform) { + unsafe { + cxxbridge::AffineTransform_destructor_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + } + } + impl Drop for output::itk::simple::ElastixImageFilter { + #[doc = " \\brief Destructor."] + fn drop(self: &mut output::itk::simple::ElastixImageFilter) { + unsafe { + cxxbridge::ElastixImageFilter_destructor_autocxx_wrapper_0x663a7a2eb658d678( + self, + ) + } + } + } + } + } + pub mod std { + #[allow(unused_imports)] + use super::{bindgen, cxxbridge, output}; + #[repr(transparent)] + pub struct complex { + _hidden_contents: ::core::cell::UnsafeCell< + ::core::mem::MaybeUninit>, + >, + } + } +} diff --git a/src/lib.rs b/src/lib.rs index 057a7e7..54f8a8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,485 +1,101 @@ -mod sys; +//! This crate does two things: +//! - find an affine transform or translation that transforms one image into the other +//! - use bspline or nearest neighbor interpolation to apply a transformation to an image +//! +//! To do this, [SimpleITK](https://github.com/SimpleITK/SimpleITK), which is written in +//! C++, is used. An adapter library is created using [autocxx](https://crates.io/crates/autocxx) +//! to expose the required functionality in SimpleITK. Because of this, compilation of this crate +//! requires quite some time, several GB of memory, up to 50 GB of hard disk space, as well as +//! cmake, a C++ compiler, llvm and git. Use at your own risk! +//! +//! # Examples +//! ## Registration +//! ``` +//! use ndarray::Array2; +//! use sitk_registration_sys::registration::{AffineTransform, julia_image}; +//! +//! let j = julia_image(0f32, 0f32).unwrap(); +//! let shape = j.shape(); +//! let origin = [ +//! ((shape[1] - 1) as f64) / 2f64, +//! ((shape[0] - 1) as f64) / 2f64, +//! ]; +//! let s = AffineTransform::new([1.2, 0., 0., 1., 5., 7.], origin, [shape[0], shape[1]]); +//! let k: Array2<_> = s.transform_image_bspline(j.view()).unwrap().into(); +//! let t = AffineTransform::register_affine(j.view(), k.view()).unwrap().inverse().unwrap(); +//! let d = (t.matrix() - s.matrix()).powi(2).sum(); +//! assert!(d < 0.025, "d: {}, t: {:?}", d, t.parameters); +//! ``` +//! +//! ## Interpolation +//! ``` +//! use ndarray::Array2; +//! use sitk_registration_sys::registration::{AffineTransform, julia_image}; +//! +//! let j = julia_image(-120f32, 10f32).unwrap(); +//! let k = julia_image(0f32, 0f32).unwrap(); +//! let shape = j.shape(); +//! let origin = [ +//! ((shape[1] - 1) as f64) / 2f64, +//! ((shape[0] - 1) as f64) / 2f64, +//! ]; +//! let transform = AffineTransform::new([1., 0., 0., 1., 120., -10.], origin, [shape[0], shape[1]]); +//! let n: Array2<_> = transform.transform_image_bspline(j.view()).unwrap().into(); +//! let d = (k.mapv(|x| x as f64) - n.mapv(|x| x as f64)).powi(2).sum(); +//! assert!(d <= (shape[0] * shape[1]) as f64); +//! ``` -use crate::sys::{interp, register}; -use anyhow::{Result, anyhow}; -use ndarray::{Array2, ArrayView2, AsArray, Ix2, array, s}; -use serde::{Deserialize, Serialize}; -use serde_yaml::{from_reader, to_writer}; -use std::fs::File; -use std::ops::Mul; -use std::path::PathBuf; +extern crate link_cplusplus; +pub mod registration; -/// a trait marking number types that can be used in sitk: -/// (u/i)(8/16/32/64), (u/i)size, f(32/64) -pub trait PixelType: Clone { - const PT: u8; +/// The bindings generated by [autocxx](https://google.github.io/autocxx). +/// Everything in here is unsafe. +pub use ffi::itk::simple; + +use autocxx::prelude::*; + +include_cpp! { + #include "sitkAdditionalProcedures.h" + #include "sitkAffineTransform.h" + #include "sitkElastixImageFilter.h" + #include "sitkInterpolator.h" + #include "sitkImage.h" + #include "sitkTransform.h" + safety!(unsafe) + generate!("itk::simple::AffineTransform") + generate!("itk::simple::ElastixImageFilter") + generate!("itk::simple::InterpolatorEnum") + generate!("itk::simple::Image") + generate!("itk::simple::Resample") + generate!("itk::simple::Transform") + opaque!("itk::simple::ElastixImageFilter") // deleted constructor } -macro_rules! sitk_impl { - ($($T:ty: $sitk:expr $(,)?)*) => { - $( - impl PixelType for $T { - const PT: u8 = $sitk; - } - )* - }; -} +/// Manually generated bindings for some things that autocxx does not understand. +#[cxx::bridge] +pub mod ffi_extra { + unsafe extern "C++" { + include!("ffi_extra.h"); -sitk_impl! { - u8: 1, - i8: 2, - u16: 3, - i16: 4, - u32: 5, - i32: 6, - u64: 7, - i64: 8, - f32: 9, - f64: 10, -} + #[namespace = "itk::simple"] + type ElastixImageFilter = crate::ffi::itk::simple::ElastixImageFilter; + type ParameterMap; -#[cfg(target_pointer_width = "64")] -sitk_impl!(usize: 7); -#[cfg(target_pointer_width = "32")] -sitk_impl!(usize: 5); -#[cfg(target_pointer_width = "64")] -sitk_impl!(isize: 8); -#[cfg(target_pointer_width = "32")] -sitk_impl!(isize: 6); + fn new_parameter_map() -> UniquePtr; + fn insert(self: Pin<&mut ParameterMap>, key: &CxxString, value: &CxxVector); + fn keys(self: &ParameterMap) -> UniquePtr>; + fn get(self: &ParameterMap, key: &CxxString) -> UniquePtr>; -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Transform { - pub parameters: [f64; 6], - pub dparameters: [f64; 6], - pub origin: [f64; 2], - pub shape: [usize; 2], -} + fn get_transform_parameter_map( + tfilter: &mut ElastixImageFilter, + index: u32, + ) -> UniquePtr; -impl Mul for Transform { - type Output = Transform; + fn get_default_parameter_map(kind: &CxxString) -> UniquePtr; - #[allow(clippy::suspicious_arithmetic_impl)] - fn mul(self, other: Transform) -> Transform { - let m = self.matrix().dot(&other.matrix()); - let dm = self.dmatrix().dot(&other.matrix()) + self.matrix().dot(&other.dmatrix()); - Transform { - parameters: [ - m[[0, 0]], - m[[0, 1]], - m[[1, 0]], - m[[1, 1]], - m[[2, 0]], - m[[2, 1]], - ], - dparameters: [ - dm[[0, 0]], - dm[[0, 1]], - dm[[1, 0]], - dm[[1, 1]], - dm[[2, 0]], - dm[[2, 1]], - ], - origin: self.origin, - shape: self.shape, - } - } -} - -impl PartialEq for Transform { - fn eq(&self, other: &Self) -> bool { - self.parameters == other.parameters - && self.dparameters == other.dparameters - && self.origin == other.origin - && self.shape == other.shape - } -} - -impl Eq for Transform {} - -impl Transform { - /// parameters: flat 2x2 part of matrix, translation; origin: center of rotation - pub fn new(parameters: [f64; 6], origin: [f64; 2], shape: [usize; 2]) -> Self { - Self { - parameters, - dparameters: [0f64; 6], - origin, - shape, - } - } - - /// find the affine transform which transforms moving into fixed - pub fn register_affine<'a, A, T>(fixed: A, moving: A) -> Result - where - T: 'a + PixelType, - A: AsArray<'a, T, Ix2>, - { - let (parameters, origin, shape) = register(fixed, moving, true)?; - Ok(Transform { - parameters, - dparameters: [0f64; 6], - origin, - shape, - }) - } - - /// find the translation which transforms moving into fixed - pub fn register_translation<'a, A, T>(fixed: A, moving: A) -> Result - where - T: 'a + PixelType, - A: AsArray<'a, T, Ix2>, - { - let (parameters, origin, shape) = register(fixed, moving, false)?; - Ok(Transform { - parameters, - dparameters: [0f64; 6], - origin, - shape, - }) - } - - /// create a transform from a xy translation - pub fn from_translation(translation: [f64; 2]) -> Self { - Transform { - parameters: [1f64, 0f64, 0f64, 1f64, translation[0], translation[1]], - dparameters: [0f64; 6], - origin: [0f64; 2], - shape: [0usize; 2], - } - } - - /// read a transform from a file - pub fn from_file(path: PathBuf) -> Result { - let file = File::open(path)?; - Ok(from_reader(file)?) - } - - /// write a transform to a file - pub fn to_file(&self, path: PathBuf) -> Result<()> { - let mut file = std::fs::OpenOptions::new() - .create(true) - .write(true) - .truncate(true) - .open(path)?; - to_writer(&mut file, self)?; - Ok(()) - } - - /// true if transform does nothing - pub fn is_unity(&self) -> bool { - self.parameters == [1f64, 0f64, 0f64, 1f64, 0f64, 0f64] - } - - /// transform an image using nearest neighbor interpolation - pub fn transform_image_bspline<'a, A, T>(&self, image: A) -> Result> - where - T: 'a + PixelType, - A: AsArray<'a, T, Ix2>, - { - interp(self.parameters, self.origin, image, false) - } - - /// transform an image using bspline interpolation - pub fn transform_image_nearest_neighbor<'a, A, T>(&self, image: A) -> Result> - where - T: 'a + PixelType, - A: AsArray<'a, T, Ix2>, - { - interp(self.parameters, self.origin, image, true) - } - - /// get coordinates resulting from transforming input coordinates - pub fn transform_coordinates<'a, A, T>(&self, coordinates: A) -> Result> - where - T: 'a + Clone + Into, - A: AsArray<'a, T, Ix2>, - { - let coordinates = coordinates.into(); - let s = coordinates.shape(); - if s[1] != 2 { - return Err(anyhow!("coordinates must have two columns")); - } - let m = self.matrix(); - let mut res = Array2::zeros([s[0], s[1]]); - for i in 0..s[0] { - let a = array![ - coordinates[[i, 0]].clone().into(), - coordinates[[i, 1]].clone().into(), - 1f64 - ] - .to_owned(); - let b = m.dot(&a); - res.slice_mut(s![i, ..]).assign(&b.slice(s![..2])); - } - Ok(res) - } - - /// get the matrix defining the transform - pub fn matrix(&self) -> Array2 { - Array2::from_shape_vec( - (3, 3), - vec![ - self.parameters[0], - self.parameters[1], - self.parameters[4], - self.parameters[2], - self.parameters[3], - self.parameters[5], - 0f64, - 0f64, - 1f64, - ], - ) - .unwrap() - } - - /// get the matrix describing the error of the transform - pub fn dmatrix(&self) -> Array2 { - Array2::from_shape_vec( - (3, 3), - vec![ - self.dparameters[0], - self.dparameters[1], - self.dparameters[4], - self.dparameters[2], - self.dparameters[3], - self.dparameters[5], - 0f64, - 0f64, - 1f64, - ], - ) - .unwrap() - } - - /// get the inverse transform - pub fn inverse(&self) -> Result { - fn det(a: ArrayView2) -> f64 { - (a[[0, 0]] * a[[1, 1]]) - (a[[0, 1]] * a[[1, 0]]) - } - - let m = self.matrix(); - let d = det(m.slice(s![..2, ..2])); - if d == 0f64 { - return Err(anyhow!("transform matrix is not invertible")); - } - let parameters = [ - det(m.slice(s![1.., 1..])) / d, - -det(m.slice(s![..;2, 1..])) / d, - -det(m.slice(s![1.., ..;2])) / d, - det(m.slice(s![..;2, ..;2])) / d, - det(m.slice(s![..2, 1..])) / d, - -det(m.slice(s![..2, ..;2])) / d, - ]; - - Ok(Transform { - parameters, - dparameters: [0f64; 6], - origin: self.origin, - shape: self.shape, - }) - } - - /// adapt the transform to a new origin and shape - pub fn adapt(&mut self, origin: [f64; 2], shape: [usize; 2]) { - self.origin = [ - origin[0] + (((self.shape[0] - shape[0]) as f64) / 2f64), - origin[1] + (((self.shape[1] - shape[1]) as f64) / 2f64), - ]; - self.shape = shape; - } -} - -#[cfg(test)] -mod tests { - use super::*; - use anyhow::Result; - use ndarray::Array2; - use num::Complex; - use tempfile::NamedTempFile; - - /// An example of generating julia fractals. - fn julia_image(shift_x: f32, shift_y: f32) -> Result> { - let imgx = 800; - let imgy = 600; - - let scalex = 3.0 / imgx as f32; - let scaley = 3.0 / imgy as f32; - - let mut im = Array2::::zeros((imgy, imgx)); - for x in 0..imgx { - for y in 0..imgy { - let cy = (y as f32 + shift_y) * scalex - 1.5; - let cx = (x as f32 + shift_x) * scaley - 1.5; - - let c = Complex::new(-0.4, 0.6); - let mut z = Complex::new(cy, cx); - - let mut i = 0; - while i < 255 && z.norm() <= 2.0 { - z = z * z + c; - i += 1; - } - - im[[y, x]] = i as u8; - } - } - Ok(im) - } - - #[test] - fn test_serialization() -> Result<()> { - let file = NamedTempFile::new()?; - let t = Transform::new([1.2, 0.3, -0.4, 0.9, 10.2, -9.5], [59.5, 49.5], [120, 100]); - t.to_file(file.path().to_path_buf())?; - let s = Transform::from_file(file.path().to_path_buf())?; - assert_eq!(s, t); - Ok(()) - } - - macro_rules! interp_tests_bspline { - ($($name:ident: $t:ty $(,)?)*) => { - $( - #[test] - fn $name() -> Result<()> { - let j = julia_image(-120f32, 10f32)?.mapv(|x| x as $t); - let k = julia_image(0f32, 0f32)?.mapv(|x| x as $t); - let shape = j.shape(); - let origin = [ - ((shape[1] - 1) as f64) / 2f64, - ((shape[0] - 1) as f64) / 2f64, - ]; - let transform = Transform::new([1., 0., 0., 1., 120., -10.], origin, [shape[0], shape[1]]); - let n = transform.transform_image_bspline(j.view())?; - let d = (k.mapv(|x| x as f64) - n.mapv(|x| x as f64)).powi(2).sum(); - assert!(d <= (shape[0] * shape[1]) as f64); - Ok(()) - } - )* - } - } - - interp_tests_bspline! { - interpbs_u8: u8, - interpbs_i8: i8, - interpbs_u16: u16, - interpbs_i16: i16, - interpbs_u32: u32, - interpbs_i32: i32, - interpbs_u64: u64, - interpbs_i64: i64, - interpbs_f32: f32, - interpbs_f64: f64, - } - - macro_rules! interp_tests_nearest_neighbor { - ($($name:ident: $t:ty $(,)?)*) => { - $( - #[test] - fn $name() -> Result<()> { - let j = julia_image(-120f32, 10f32)?.mapv(|x| x as $t); - let k = julia_image(0f32, 0f32)?.mapv(|x| x as $t); - let shape = j.shape(); - let origin = [ - ((shape[1] - 1) as f64) / 2f64, - ((shape[0] - 1) as f64) / 2f64, - ]; - let j0 = j.clone(); - let k0 = k.clone(); - let transform = Transform::new([1., 0., 0., 1., 120., -10.], origin, [shape[0], shape[1]]); - // make sure j & k weren't mutated - assert!(j.iter().zip(j0.iter()).map(|(a, b)| a == b).all(|x| x)); - assert!(k.iter().zip(k0.iter()).map(|(a, b)| a == b).all(|x| x)); - let n = transform.transform_image_nearest_neighbor(j.view())?; - let d = (k.mapv(|x| x as f64) - n.mapv(|x| x as f64)).powi(2).sum(); - assert!(d <= (shape[0] * shape[1]) as f64); - Ok(()) - } - )* - } - } - - interp_tests_nearest_neighbor! { - interpnn_u8: u8, - interpnn_i8: i8, - interpnn_u16: u16, - interpnn_i16: i16, - interpnn_u32: u32, - interpnn_i32: i32, - interpnn_u64: u64, - interpnn_i64: i64, - interpnn_f32: f32, - interpnn_f64: f64, - } - - macro_rules! registration_tests_translation { - ($($name:ident: $t:ty $(,)?)*) => { - $( - #[test] - fn $name() -> Result<()> { - let j = julia_image(0f32, 0f32)?.mapv(|x| x as $t); - let k = julia_image(10f32, 20f32)?.mapv(|x| x as $t); - let j0 = j.clone(); - let k0 = k.clone(); - let t = Transform::register_translation(j.view(), k.view())?; - // make sure j & k weren't mutated - assert!(j.iter().zip(j0.iter()).map(|(a, b)| a == b).all(|x| x)); - assert!(k.iter().zip(k0.iter()).map(|(a, b)| a == b).all(|x| x)); - let mut m = Array2::eye(3); - m[[0, 2]] = -10f64; - m[[1, 2]] = -20f64; - let d = (t.matrix() - m).powi(2).sum(); - assert!(d < 0.01); - Ok(()) - } - )* - } - } - - registration_tests_translation! { - registration_translation_u8: u8, - registration_translation_i8: i8, - registration_translation_u16: u16, - registration_translation_i16: i16, - registration_translation_u32: u32, - registration_translation_i32: i32, - registration_translation_u64: u64, - registration_translation_i64: i64, - registration_translation_f32: f32, - registration_translation_f64: f64, - } - - macro_rules! registration_tests_affine { - ($($name:ident: $t:ty $(,)?)*) => { - $( - #[test] - fn $name() -> Result<()> { - let j = julia_image(0f32, 0f32)?.mapv(|x| x as $t); - let shape = j.shape(); - let origin = [ - ((shape[1] - 1) as f64) / 2f64, - ((shape[0] - 1) as f64) / 2f64, - ]; - let s = Transform::new([1.2, 0., 0., 1., 5., 7.], origin, [shape[0], shape[1]]); - let k = s.transform_image_bspline(j.view())?; - let t = Transform::register_affine(j.view(), k.view())?.inverse()?; - let d = (t.matrix() - s.matrix()).powi(2).sum(); - assert!(d < 0.01); - Ok(()) - } - )* - } - } - - registration_tests_affine! { - registration_tests_affine_u8: u8, - registration_tests_affine_i8: i8, - registration_tests_affine_u16: u16, - registration_tests_affine_i16: i16, - registration_tests_affine_u32: u32, - registration_tests_affine_i32: i32, - registration_tests_affine_u64: u64, - registration_tests_affine_i64: i64, - registration_tests_affine_f32: f32, - registration_tests_affine_f64: f64, + fn set_parameter_map( + tfilter: &mut ElastixImageFilter, + parameter_map: &UniquePtr, + ); } } diff --git a/src/registration.rs b/src/registration.rs new file mode 100644 index 0000000..c9aaff0 --- /dev/null +++ b/src/registration.rs @@ -0,0 +1,645 @@ +//! Some structs and methods to make working with registration and interpolation methods in +//! SimpleITK more Rust friendly. + +use crate::simple; +use anyhow::{Result, anyhow}; +use autocxx::prelude::*; +use cxx::{CxxVector, UniquePtr, let_cxx_string}; +use ndarray::{Array2, ArrayView2, AsArray, Ix2, array, s}; +use serde::{Deserialize, Serialize}; +use serde_yaml::{from_reader, to_writer}; +use std::fs::File; +use std::marker::PhantomData; +use std::ops::{Deref, DerefMut, Mul}; +use std::path::PathBuf; +use num::Complex; +use tempfile::tempdir; + +/// a trait marking number types that can be used in sitk: +/// (u/i)(8/16/32/64), (u/i)size, f(32/64) +pub trait PixelType: Clone { + const PT: simple::PixelIDValueEnum; +} + +macro_rules! pixel_type_impl { + ($($T:ty: $sitk:expr $(,)?)*) => { + $( + impl PixelType for $T { + const PT: simple::PixelIDValueEnum = $sitk; + } + )* + }; +} + +pixel_type_impl! { + u8: simple::PixelIDValueEnum::sitkUInt8, + i8: simple::PixelIDValueEnum::sitkInt8, + u16: simple::PixelIDValueEnum::sitkUInt16, + i16: simple::PixelIDValueEnum::sitkInt16, + u32: simple::PixelIDValueEnum::sitkUInt32, + i32: simple::PixelIDValueEnum::sitkInt32, + u64: simple::PixelIDValueEnum::sitkUInt64, + i64: simple::PixelIDValueEnum::sitkInt64, + f32: simple::PixelIDValueEnum::sitkFloat32, + f64: simple::PixelIDValueEnum::sitkFloat64, +} + +#[cfg(target_pointer_width = "64")] +pixel_type_impl!(usize: simple::PixelIDValueEnum::sitkUInt64); +#[cfg(target_pointer_width = "32")] +pixel_type_impl!(usize: simple::PixelIDValueEnum::sitkUInt32); +#[cfg(target_pointer_width = "64")] +pixel_type_impl!(isize: simple::PixelIDValueEnum::sitkInt64); +#[cfg(target_pointer_width = "32")] +pixel_type_impl!(isize: simple::PixelIDValueEnum::sitkInt32); + +/// Struct holding a pointer to an image +pub struct Image { + image: UniquePtr, + pixel_type: PhantomData, +} + +impl Deref for Image { + type Target = UniquePtr; + + fn deref(&self) -> &Self::Target { + &self.image + } +} + +impl Image { + /// encapsulate an itk::simple::Image + pub fn new(image: UniquePtr) -> Self { + Self { + image, + pixel_type: PhantomData, + } + } + + /// take an ndarray Array2 and turn it into a SimpleITK image + pub fn from_array<'a, A>(array: A) -> Self + where + T: 'a + PixelType, + A: AsArray<'a, T, Ix2>, + { + let array = array.into(); + let shape = array.shape(); + let width = (shape[1] as u32).into(); + let height = (shape[0] as u32).into(); + let mut image = simple::Image::new3(width, height, T::PT).within_unique_ptr(); + image.pin_mut().MakeUnique(); + let buffer = image.pin_mut().GetBufferAsVoid(); + unsafe { std::ptr::copy(array.as_ptr(), buffer as *mut T, shape[0] * shape[1]) }; + Self { + image, + pixel_type: PhantomData, + } + } + + /// return as an ndarray Array2 + pub fn as_array(&self) -> Array2 { + let width = u32::from(self.image.GetWidth()) as usize; + let height = u32::from(self.image.GetHeight()) as usize; + let mut array = Array2::::uninit((height, width)); + let buffer = self.image.GetBufferAsVoid1(); + unsafe { + std::ptr::copy( + buffer as *const T, + array.as_mut_ptr() as *mut T, + width * height, + ); + array.assume_init() + } + } +} + +impl<'a, A, T> From for Image +where + T: 'a + PixelType, + A: AsArray<'a, T, Ix2>, +{ + fn from(value: A) -> Self { + Self::from_array(value.into()) + } +} + +impl From> for Array2 +where + T: PixelType, +{ + fn from(value: Image) -> Self { + value.as_array() + } +} + +/// a struct describing the transform +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +pub struct AffineTransform { + /// flattened 2x2 rotation matrix + translation + pub parameters: [f64; 6], + /// error / significance on parameters + pub dparameters: [f64; 6], + /// the point about which rotations are performed + pub origin: [f64; 2], + /// the shape of images for which this transform is meant + pub shape: [usize; 2], +} + +impl Mul for AffineTransform { + type Output = AffineTransform; + + #[allow(clippy::suspicious_arithmetic_impl)] + fn mul(self, other: AffineTransform) -> AffineTransform { + let m = self.matrix().dot(&other.matrix()); + let dm = self.dmatrix().dot(&other.matrix()) + self.matrix().dot(&other.dmatrix()); + AffineTransform { + parameters: [ + m[[0, 0]], + m[[0, 1]], + m[[1, 0]], + m[[1, 1]], + m[[2, 0]], + m[[2, 1]], + ], + dparameters: [ + dm[[0, 0]], + dm[[0, 1]], + dm[[1, 0]], + dm[[1, 1]], + dm[[2, 0]], + dm[[2, 1]], + ], + origin: self.origin, + shape: self.shape, + } + } +} + +impl Eq for AffineTransform {} + +impl AffineTransform { + /// parameters: flat 2x2 part of matrix, translation; origin: center of rotation + pub fn new(parameters: [f64; 6], origin: [f64; 2], shape: [usize; 2]) -> Self { + Self { + parameters, + dparameters: [0f64; 6], + origin, + shape, + } + } + + /// find the affine transform which transforms moving into fixed + pub fn register_affine(fixed: F, moving: M) -> Result + where + F: Into>, + M: Into>, + T: PixelType, + { + Self::register(fixed, moving, true) + } + + /// find the translation which transforms moving into fixed + pub fn register_translation(fixed: F, moving: M) -> Result + where + F: Into>, + M: Into>, + T: PixelType, + { + Self::register(fixed, moving, false) + } + + /// find the transform which transforms moving into fixed + pub fn register(fixed: F, moving: M, affine: bool) -> Result + where + F: Into>, + M: Into>, + T: PixelType, + { + let tmp_folder = tempdir()?; + let fixed = fixed.into(); + let moving = moving.into(); + let width = u32::from(fixed.GetWidth()) as usize; + let height = u32::from(fixed.GetHeight()) as usize; + let_cxx_string!(transform_name = if affine { "affine" } else { "translation" }); + let parameter_map = crate::ffi_extra::get_default_parameter_map(&transform_name); + let mut tfilter = simple::ElastixImageFilter::new().within_box(); + tfilter.as_mut().LogToConsoleOff(); + tfilter.as_mut().LogToFileOff(); + tfilter.as_mut().SetLogToFile(false); + tfilter.as_mut().SetFixedImage(&fixed); + tfilter.as_mut().SetMovingImage(&moving); + crate::ffi_extra::set_parameter_map(&mut tfilter, ¶meter_map); + tfilter.as_mut().SetParameter("WriteResultImage", "False"); + tfilter + .as_mut() + .SetOutputDirectory(tmp_folder.path().display().to_string()); + let _ = tfilter.as_mut().Execute().within_unique_ptr(); + let_cxx_string!(tp = "TransformParameters"); + let p = crate::ffi_extra::get_transform_parameter_map(tfilter.as_mut().deref_mut(), 0) + .get(&tp) + .iter() + .map(|i| i.to_string_lossy().parse::()) + .collect::, _>>()?; + let parameters = if affine { + [p[0], p[1], p[2], p[3], p[4], p[5]] + } else { + [1.0, 0.0, 0.0, 1.0, p[0], p[1]] + }; + let origin = [((height - 1) as f64) / 2.0, ((width - 1) as f64) / 2.0]; + let shape = [height, width]; + Ok(AffineTransform::new(parameters, origin, shape)) + } + + /// create a transform from a xy translation + pub fn from_translation(translation: [f64; 2]) -> Self { + AffineTransform { + parameters: [1f64, 0f64, 0f64, 1f64, translation[0], translation[1]], + dparameters: [0f64; 6], + origin: [0f64; 2], + shape: [0usize; 2], + } + } + + /// read a transform from a file + pub fn from_file(path: PathBuf) -> Result { + let file = File::open(path)?; + Ok(from_reader(file)?) + } + + /// write a transform to a file + pub fn to_file(&self, path: PathBuf) -> Result<()> { + let mut file = std::fs::OpenOptions::new() + .create(true) + .write(true) + .truncate(true) + .open(path)?; + to_writer(&mut file, self)?; + Ok(()) + } + + /// true if transform does nothing + pub fn is_unity(&self) -> bool { + self.parameters == [1f64, 0f64, 0f64, 1f64, 0f64, 0f64] + } + + /// transform an image using nearest neighbor interpolation + pub fn transform_image_bspline(&self, image: I) -> Result> + where + I: Into>, + T: PixelType, + { + Self::interp(self, image, false) + } + + /// transform an image using bspline interpolation + pub fn transform_image_nearest_neighbor(&self, image: I) -> Result> + where + I: Into>, + T: PixelType, + { + Self::interp(self, image, true) + } + + /// transform an image + pub fn interp(&self, image: I, nearest_neighbor: bool) -> Result> + where + I: Into>, + T: PixelType, + { + let image = image.into(); + let width = u32::from(image.GetWidth()) as usize; + let height = u32::from(image.GetHeight()) as usize; + let origin = [((width - 1) as f64) / 2f64, ((height - 1) as f64) / 2f64]; + let p = self.parameters; + let matrix = cxx_vector([p[0], p[1], p[2], p[3]]); + let translation = cxx_vector([p[4], p[5]]); + let fixed_center = cxx_vector(origin); + let affine_transform = + simple::AffineTransform::new3(&matrix, &translation, &fixed_center).within_unique_ptr(); + let transform = <_ as AsRef>::as_ref(affine_transform.as_ref().unwrap()); + let interpolator = if nearest_neighbor { + simple::InterpolatorEnum::sitkBSpline + } else { + simple::InterpolatorEnum::sitkNearestNeighbor + }; + Ok(Image::::new( + simple::Resample( + &image, + transform, + interpolator, + 0.0, + simple::PixelIDValueEnum::sitkUnknown, + nearest_neighbor, + ) + .within_unique_ptr(), + )) + } + + /// get coordinates resulting from transforming input coordinates, coordinates must have two + /// columns: x & y + pub fn transform_coordinates<'a, A, T>(&self, coordinates: A) -> Result> + where + T: 'a + Clone + Into, + A: AsArray<'a, T, Ix2>, + { + let coordinates = coordinates.into(); + let s = coordinates.shape(); + if s[1] != 2 { + return Err(anyhow!("coordinates must have two columns")); + } + let m = self.matrix(); + let mut res = Array2::zeros([s[0], s[1]]); + for i in 0..s[0] { + let a = array![ + coordinates[[i, 0]].clone().into(), + coordinates[[i, 1]].clone().into(), + 1f64 + ] + .to_owned(); + let b = m.dot(&a); + res.slice_mut(s![i, ..]).assign(&b.slice(s![..2])); + } + Ok(res) + } + + /// get the matrix defining the transform + pub fn matrix(&self) -> Array2 { + Array2::from_shape_vec( + (3, 3), + vec![ + self.parameters[0], + self.parameters[1], + self.parameters[4], + self.parameters[2], + self.parameters[3], + self.parameters[5], + 0f64, + 0f64, + 1f64, + ], + ) + .unwrap() + } + + /// get the matrix describing the error of the transform + pub fn dmatrix(&self) -> Array2 { + Array2::from_shape_vec( + (3, 3), + vec![ + self.dparameters[0], + self.dparameters[1], + self.dparameters[4], + self.dparameters[2], + self.dparameters[3], + self.dparameters[5], + 0f64, + 0f64, + 1f64, + ], + ) + .unwrap() + } + + /// get the inverse transform + pub fn inverse(&self) -> Result { + fn det(a: ArrayView2) -> f64 { + (a[[0, 0]] * a[[1, 1]]) - (a[[0, 1]] * a[[1, 0]]) + } + + let m = self.matrix(); + let d = det(m.slice(s![..2, ..2])); + if d == 0f64 { + return Err(anyhow!("transform matrix is not invertible")); + } + let parameters = [ + det(m.slice(s![1.., 1..])) / d, + -det(m.slice(s![..;2, 1..])) / d, + -det(m.slice(s![1.., ..;2])) / d, + det(m.slice(s![..;2, ..;2])) / d, + det(m.slice(s![..2, 1..])) / d, + -det(m.slice(s![..2, ..;2])) / d, + ]; + + Ok(AffineTransform { + parameters, + dparameters: [0f64; 6], + origin: self.origin, + shape: self.shape, + }) + } + + /// adapt the transform to a new origin and shape + pub fn adapt(&mut self, origin: [f64; 2], shape: [usize; 2]) { + self.origin = [ + origin[0] + (((self.shape[0] - shape[0]) as f64) / 2f64), + origin[1] + (((self.shape[1] - shape[1]) as f64) / 2f64), + ]; + self.shape = shape; + } +} + +/// conveniently collect an iterator into a CxxVector +pub fn cxx_vector(vec: I) -> UniquePtr> +where + I: IntoIterator, + T: cxx::vector::VectorElement + cxx::ExternType, +{ + let mut v = CxxVector::new(); + v.pin_mut().extend(vec); + v +} + +/// An example of generating julia fractals, for testing purposes. +pub fn julia_image(shift_x: f32, shift_y: f32) -> Result> { + let imgx = 800; + let imgy = 600; + + let scalex = 3.0 / imgx as f32; + let scaley = 3.0 / imgy as f32; + + let mut im = Array2::::zeros((imgy, imgx)); + for x in 0..imgx { + for y in 0..imgy { + let cy = (y as f32 + shift_y) * scalex - 1.5; + let cx = (x as f32 + shift_x) * scaley - 1.5; + + let c = Complex::new(-0.4, 0.6); + let mut z = Complex::new(cy, cx); + + let mut i = 0; + while i < 255 && z.norm() <= 2.0 { + z = z * z + c; + i += 1; + } + + im[[y, x]] = i as u8; + } + } + Ok(im) +} + + +#[cfg(test)] +mod tests { + use super::*; + use anyhow::Result; + use ndarray::Array2; + use tempfile::NamedTempFile; + + #[test] + fn test_serialization() -> Result<()> { + let file = NamedTempFile::new()?; + let t = AffineTransform::new([1.2, 0.3, -0.4, 0.9, 10.2, -9.5], [59.5, 49.5], [120, 100]); + t.to_file(file.path().to_path_buf())?; + let s = AffineTransform::from_file(file.path().to_path_buf())?; + assert_eq!(s, t); + Ok(()) + } + + macro_rules! interp_tests_bspline { + ($($name:ident: $t:ty $(,)?)*) => { + $( + #[test] + fn $name() -> Result<()> { + let j = julia_image(-120f32, 10f32)?.mapv(|x| x as $t); + let k = julia_image(0f32, 0f32)?.mapv(|x| x as $t); + let shape = j.shape(); + let origin = [ + ((shape[1] - 1) as f64) / 2f64, + ((shape[0] - 1) as f64) / 2f64, + ]; + let transform = AffineTransform::new([1., 0., 0., 1., 120., -10.], origin, [shape[0], shape[1]]); + let n: Array2<_> = transform.transform_image_bspline(j.view())?.into(); + let d = (k.mapv(|x| x as f64) - n.mapv(|x| x as f64)).powi(2).sum(); + assert!(d <= (shape[0] * shape[1]) as f64); + Ok(()) + } + )* + } + } + + interp_tests_bspline! { + interpbs_u8: u8, + interpbs_i8: i8, + interpbs_u16: u16, + interpbs_i16: i16, + interpbs_u32: u32, + interpbs_i32: i32, + interpbs_u64: u64, + interpbs_i64: i64, + interpbs_f32: f32, + interpbs_f64: f64, + } + + macro_rules! interp_tests_nearest_neighbor { + ($($name:ident: $t:ty $(,)?)*) => { + $( + #[test] + fn $name() -> Result<()> { + let j = julia_image(-120f32, 10f32)?.mapv(|x| x as $t); + let k = julia_image(0f32, 0f32)?.mapv(|x| x as $t); + let shape = j.shape(); + let origin = [ + ((shape[1] - 1) as f64) / 2f64, + ((shape[0] - 1) as f64) / 2f64, + ]; + let j0 = j.clone(); + let k0 = k.clone(); + let transform = AffineTransform::new([1., 0., 0., 1., 120., -10.], origin, [shape[0], shape[1]]); + // make sure j & k weren't mutated + assert!(j.iter().zip(j0.iter()).map(|(a, b)| a == b).all(|x| x)); + assert!(k.iter().zip(k0.iter()).map(|(a, b)| a == b).all(|x| x)); + let n: Array2<_> = transform.transform_image_nearest_neighbor(j.view())?.into(); + let d = (k.mapv(|x| x as f64) - n.mapv(|x| x as f64)).powi(2).sum(); + assert!(d <= (shape[0] * shape[1]) as f64); + Ok(()) + } + )* + } + } + + interp_tests_nearest_neighbor! { + interpnn_u8: u8, + interpnn_i8: i8, + interpnn_u16: u16, + interpnn_i16: i16, + interpnn_u32: u32, + interpnn_i32: i32, + interpnn_u64: u64, + interpnn_i64: i64, + interpnn_f32: f32, + interpnn_f64: f64, + } + + macro_rules! registration_tests_translation { + ($($name:ident: $t:ty $(,)?)*) => { + $( + #[test] + fn $name() -> Result<()> { + let j = julia_image(0f32, 0f32)?.mapv(|x| x as $t); + let k = julia_image(10f32, 20f32)?.mapv(|x| x as $t); + let j0 = j.clone(); + let k0 = k.clone(); + let t = AffineTransform::register_translation(j.view(), k.view())?; + // make sure j & k weren't mutated + assert!(j.iter().zip(j0.iter()).map(|(a, b)| a == b).all(|x| x)); + assert!(k.iter().zip(k0.iter()).map(|(a, b)| a == b).all(|x| x)); + let mut m = Array2::eye(3); + m[[0, 2]] = -10f64; + m[[1, 2]] = -20f64; + let d = (t.matrix() - m).powi(2).sum(); + assert!(d < 0.01, "d: {}, t: {:?}", d, t.parameters); + Ok(()) + } + )* + } + } + + registration_tests_translation! { + registration_translation_u8: u8, + registration_translation_i8: i8, + registration_translation_u16: u16, + registration_translation_i16: i16, + registration_translation_u32: u32, + registration_translation_i32: i32, + registration_translation_u64: u64, + registration_translation_i64: i64, + registration_translation_f32: f32, + registration_translation_f64: f64, + } + + macro_rules! registration_tests_affine { + ($($name:ident: $t:ty $(,)?)*) => { + $( + #[test] + fn $name() -> Result<()> { + let j = julia_image(0f32, 0f32)?.mapv(|x| x as $t); + let shape = j.shape(); + let origin = [ + ((shape[1] - 1) as f64) / 2f64, + ((shape[0] - 1) as f64) / 2f64, + ]; + let s = AffineTransform::new([1.2, 0., 0., 1., 5., 7.], origin, [shape[0], shape[1]]); + let k: Array2<_> = s.transform_image_bspline(j.view())?.into(); + let t = AffineTransform::register_affine(j.view(), k.view())?.inverse()?; + let d = (t.matrix() - s.matrix()).powi(2).sum(); + assert!(d < 0.025, "d: {}, t: {:?}", d, t.parameters); + Ok(()) + } + )* + } + } + + registration_tests_affine! { + registration_tests_affine_u8: u8, + registration_tests_affine_i8: i8, + registration_tests_affine_u16: u16, + registration_tests_affine_i16: i16, + registration_tests_affine_u32: u32, + registration_tests_affine_i32: i32, + registration_tests_affine_u64: u64, + registration_tests_affine_i64: i64, + registration_tests_affine_f32: f32, + registration_tests_affine_f64: f64, + } +} diff --git a/src/sys.rs b/src/sys.rs deleted file mode 100644 index ef34bdc..0000000 --- a/src/sys.rs +++ /dev/null @@ -1,362 +0,0 @@ -use crate::PixelType; -use anyhow::Result; -use libc::{c_double, c_uint}; -use ndarray::{Array2, AsArray, Ix2}; -use one_at_a_time_please::one_at_a_time; -use std::ptr; - -macro_rules! register_fn { - ($($name:ident: $T:ty $(,)?)*) => { - $( - fn $name( - width: c_uint, - height: c_uint, - fixed_arr: *const $T, - moving_arr: *const $T, - translation_or_affine: bool, - transform: &mut *mut c_double, - ); - )* - }; -} - -macro_rules! interp_fn { - ($($name:ident: $T:ty $(,)?)*) => { - $( - fn $name( - width: c_uint, - height: c_uint, - transform: *const c_double, - origin: *const c_double, - image: &mut *mut $T, - bspline_or_nn: bool, - ); - )* - }; -} - -unsafe extern "C" { - register_fn! { - register_u8: u8, - register_i8: i8, - register_u16: u16, - register_i16: i16, - register_u32: u32, - register_i32: i32, - register_u64: u64, - register_i64: i64, - register_f32: f32, - register_f64: f64, - } - - interp_fn! { - interp_u8: u8, - interp_i8: i8, - interp_u16: u16, - interp_i16: i16, - interp_u32: u32, - interp_i32: i32, - interp_u64: u64, - interp_i64: i64, - interp_f32: f32, - interp_f64: f64, - } -} - -pub(crate) fn interp<'a, A, T>( - parameters: [f64; 6], - origin: [f64; 2], - image: A, - bspline_or_nn: bool, -) -> Result> -where - T: 'a + PixelType, - A: AsArray<'a, T, Ix2>, -{ - let image = image.into(); - let shape: Vec = image.shape().to_vec(); - let width = shape[1] as c_uint; - let height = shape[0] as c_uint; - let mut im: Vec<_> = image.into_iter().cloned().collect(); - let im_ptr: *mut T = ptr::from_mut(unsafe { &mut *im.as_mut_ptr() }); - - match T::PT { - 1 => unsafe { - interp_u8( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut u8), - bspline_or_nn, - ); - }, - 2 => unsafe { - interp_i8( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut i8), - bspline_or_nn, - ); - }, - 3 => unsafe { - interp_u16( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut u16), - bspline_or_nn, - ); - }, - 4 => unsafe { - interp_i16( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut i16), - bspline_or_nn, - ); - }, - 5 => unsafe { - interp_u32( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut u32), - bspline_or_nn, - ); - }, - 6 => unsafe { - interp_i32( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut i32), - bspline_or_nn, - ); - }, - 7 => unsafe { - interp_u64( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut u64), - bspline_or_nn, - ); - }, - 8 => unsafe { - interp_i64( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut i64), - bspline_or_nn, - ); - }, - 9 => unsafe { - interp_f32( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut f32), - bspline_or_nn, - ); - }, - 10 => unsafe { - interp_f64( - width, - height, - parameters.as_ptr(), - origin.as_ptr(), - &mut (im_ptr as *mut f64), - bspline_or_nn, - ); - }, - _ => {} - } - Ok(Array2::from_shape_vec( - (shape[0], shape[1]), - im.into_iter().collect(), - )?) -} - -#[one_at_a_time] -pub(crate) fn register<'a, A, T>( - fixed: A, - moving: A, - translation_or_affine: bool, -) -> Result<([f64; 6], [f64; 2], [usize; 2])> -where - T: 'a + PixelType, - A: AsArray<'a, T, Ix2>, -{ - let fixed = fixed.into(); - let moving = moving.into(); - let shape: Vec = fixed.shape().to_vec(); - let width = shape[1] as c_uint; - let height = shape[0] as c_uint; - let fixed: Vec<_> = fixed.into_iter().collect(); - let moving: Vec<_> = moving.into_iter().collect(); - let fixed_ptr = fixed.as_ptr(); - let moving_ptr = moving.as_ptr(); - let mut transform: Vec = vec![0.0; 6]; - let mut transform_ptr: *mut c_double = ptr::from_mut(unsafe { &mut *transform.as_mut_ptr() }); - - // let ma0 = &mut moving as *mut Vec as usize; - // println!("ma0: {:#x}", ma0); - - match T::PT { - 1 => { - unsafe { - register_u8( - width, - height, - fixed_ptr as *const u8, - moving_ptr as *const u8, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 2 => { - unsafe { - register_i8( - width, - height, - fixed_ptr as *const i8, - moving_ptr as *const i8, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 3 => { - unsafe { - register_u16( - width, - height, - fixed_ptr as *const u16, - moving_ptr as *const u16, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 4 => { - unsafe { - register_i16( - width, - height, - fixed_ptr as *const i16, - moving_ptr as *const i16, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 5 => { - unsafe { - register_u32( - width, - height, - fixed_ptr as *const u32, - moving_ptr as *const u32, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 6 => { - unsafe { - register_i32( - width, - height, - fixed_ptr as *const i32, - moving_ptr as *const i32, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 7 => { - unsafe { - register_u64( - width, - height, - fixed_ptr as *const u64, - moving_ptr as *const u64, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 8 => { - unsafe { - register_i64( - width, - height, - fixed_ptr as *const i64, - moving_ptr as *const i64, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 9 => { - unsafe { - register_f32( - width, - height, - fixed_ptr as *const f32, - moving_ptr as *const f32, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - 10 => { - unsafe { - register_f64( - width, - height, - fixed_ptr as *const f64, - moving_ptr as *const f64, - translation_or_affine, - &mut transform_ptr, - ) - }; - } - _ => {} - } - - // let ma1 = &mut moving as *mut Vec as usize; - // println!("ma1: {:#x}", ma1); - - // println!("{}", fixed.len()); - // println!("{}", moving.len()); - - Ok(( - [ - transform[0] as f64, - transform[1] as f64, - transform[2] as f64, - transform[3] as f64, - transform[4] as f64, - transform[5] as f64, - ], - [ - ((shape[0] - 1) as f64) / 2f64, - ((shape[1] - 1) as f64) / 2f64, - ], - [shape[0], shape[1]], - )) -}