# Algorithms

**URL:** https://discourse.itk.org/c/algorithms/7.md?no_subcategories=false&page=10

[Latest](https://discourse.itk.org/latest.md) · [Categories](https://discourse.itk.org/categories.md) · [Tags](https://discourse.itk.org/tags.md)

**Page:** 11

---

## [BSpline registration for non-overlapping images](https://discourse.itk.org/t/bspline-registration-for-non-overlapping-images/4097)

<div class="topic-metadata">

**Author:** [@ctorti](https://discourse.itk.org/u/ctorti)\
**Replies:** 0\
**Last updated:** [May 4, 2021, 9:02pm UTC](https://discourse.itk.org/t/bspline-registration-for-non-overlapping-images/4097 "2021-05-04T21:02:43Z")

</div>

Having run into problems trying to use landmarks to initiate a bspline registration of 3D CT and MR images, I decided to try a workaround: I cropped the CT image such that the field of view (in all three directions) is …

---

## [Can LevenbergMarquardtOptimizer be constrained with bounds ?](https://discourse.itk.org/t/can-levenbergmarquardtoptimizer-be-constrained-with-bounds/4075)

<div class="topic-metadata">

**Author:** [@agp](https://discourse.itk.org/u/agp)\
**Replies:** 0\
**Last updated:** [April 26, 2021, 9:32am UTC](https://discourse.itk.org/t/can-levenbergmarquardtoptimizer-be-constrained-with-bounds/4075 "2021-04-26T09:32:04Z")

</div>

Hello everyone, I have been working on registering a statistical shape model to a 3D pointset, using ITK and statismo I have tested multiple optimizers available in ITK to optimize a composite transform of a itk::Stati…

---

## [3D point coordinates projection issue on the DRR image plane](https://discourse.itk.org/t/3d-point-coordinates-projection-issue-on-the-drr-image-plane/4018)

<div class="topic-metadata">

**Author:** [@isuruwi](https://discourse.itk.org/u/isuruwi)\
**Replies:** 5\
**Last updated:** [April 8, 2021, 2:33pm UTC](https://discourse.itk.org/t/3d-point-coordinates-projection-issue-on-the-drr-image-plane/4018 "2021-04-08T14:33:08Z")

</div>

I have implemented a code to get the corresponding 2D projection coordinate (i.e. x, y positions) of each vertex coordinate (i.e. 3D) on the DRR image projection plane. But, I have a problem regarding this DRR projectio…

---

## [How to get the desired voxel index for region growing algorithms by using VTK voxel index?](https://discourse.itk.org/t/how-to-get-the-desired-voxel-index-for-region-growing-algorithms-by-using-vtk-voxel-index/4016)

<div class="topic-metadata">

**Author:** [@happyITK](https://discourse.itk.org/u/happyITK)\
**Replies:** 6\
**Last updated:** [April 7, 2021, 2:18pm UTC](https://discourse.itk.org/t/how-to-get-the-desired-voxel-index-for-region-growing-algorithms-by-using-vtk-voxel-index/4016 "2021-04-07T14:18:44Z")

</div>

Hi everyone! I’m a beginner of ITK and VTK.Now I want to use the 3D region growing algorithms to segment specific tissues.But I’m confused how to get the voxel index. I have finished the vulume rendering and could get …

---

## [How to generate the attenuation matrix?](https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005)

<div class="topic-metadata">

**Author:** [@Massoud](https://discourse.itk.org/u/Massoud)\
**Replies:** 3\
**Last updated:** [April 5, 2021, 9:22pm UTC](https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005 "2021-04-05T21:22:19Z")

</div>

Hi everyone, I am using rtkfdk.exe to generate 3D image by using measured input projections (0-360 degree) and the Geometry.xml file. I would like to extract the attenuation matrix (Ax=p) where x is the 3D image matrix …

---

## [SimpleITK Apply VersorRigid3DTransform to Image Direction](https://discourse.itk.org/t/simpleitk-apply-versorrigid3dtransform-to-image-direction/3995)

<div class="topic-metadata">

**Author:** [@Nick\_Rubert](https://discourse.itk.org/u/Nick_Rubert)\
**Replies:** 1\
**Last updated:** [April 1, 2021, 7:39pm UTC](https://discourse.itk.org/t/simpleitk-apply-versorrigid3dtransform-to-image-direction/3995 "2021-04-01T19:39:54Z")

</div>

Hi board, Is there an easy way to apply a VersorRigid3DTransform to a SimpleITK image direction and get the corresponding transformed image direction? Another way to state my question might be: Are there easy ways to g…

---

## [Anyone registering multi-spectral remote sensing images](https://discourse.itk.org/t/anyone-registering-multi-spectral-remote-sensing-images/3968)

<div class="topic-metadata">

**Author:** [@Arrigo\_Benedetti](https://discourse.itk.org/u/Arrigo_Benedetti)\
**Replies:** 3\
**Last updated:** [March 24, 2021, 3:07pm UTC](https://discourse.itk.org/t/anyone-registering-multi-spectral-remote-sensing-images/3968 "2021-03-24T15:07:56Z")

</div>

I was wondering if anyone in this forum has ever used ITK/SimpleITK to register hyper spectral satellite imagery. Any advice is very welcome!

---

## [gap filling of breaks between vessels](https://discourse.itk.org/t/gap-filling-of-breaks-between-vessels/3925)

<div class="topic-metadata">

**Author:** [@fuentesdt](https://discourse.itk.org/u/fuentesdt)\
**Replies:** 2\
**Last updated:** [March 9, 2021, 3:41pm UTC](https://discourse.itk.org/t/gap-filling-of-breaks-between-vessels/3925 "2021-03-09T15:41:45Z")

</div>

Hi, Is there any functionality in itk for gap/hole filling specific to vessels? something like this tensor voting method: Risser, Laurent, Franck Plouraboué, and Xavier Descombes. “Gap filling of 3-D microvascular networ…

---

## [Measure Image Similarity Before Registration](https://discourse.itk.org/t/measure-image-similarity-before-registration/3945)

<div class="topic-metadata">

**Author:** [@PauloFavero](https://discourse.itk.org/u/PauloFavero)\
**Replies:** 1\
**Last updated:** [March 9, 2021, 3:32pm UTC](https://discourse.itk.org/t/measure-image-similarity-before-registration/3945 "2021-03-09T15:32:47Z")

</div>

Hello everyone, I need to measure the similarity between two images based on a transform. I have an affine transform already stored on the system and then, I would like to use this transform with the MattesMutualInforma…

---

## [OpenCV x ITK image conversion using OpenCVImageBridge](https://discourse.itk.org/t/opencv-x-itk-image-conversion-using-opencvimagebridge/3907)

<div class="topic-metadata">

**Author:** [@PauloFavero](https://discourse.itk.org/u/PauloFavero)\
**Replies:** 4\
**Last updated:** [March 9, 2021, 2:27pm UTC](https://discourse.itk.org/t/opencv-x-itk-image-conversion-using-opencvimagebridge/3907 "2021-03-09T14:27:11Z")

</div>

Hi everyone, I would like to convert simpleITK images to OpenCV images and vice versa. The conversion from OpenCV to ITK is working fine like the example below: cv::Mat movingImage = cv::imread(moving\_image\_path); cv:…

---

## [Speed up ITK Registration Pipeline](https://discourse.itk.org/t/speed-up-itk-registration-pipeline/3941)

<div class="topic-metadata">

**Author:** [@PauloFavero](https://discourse.itk.org/u/PauloFavero)\
**Replies:** 3\
**Last updated:** [March 9, 2021, 1:54pm UTC](https://discourse.itk.org/t/speed-up-itk-registration-pipeline/3941 "2021-03-09T13:54:37Z")

</div>

Hello Everyone, I implemented a registration pipeline using MattesMutualInformation as the metric algorithm. I am reaching convergence around 50 iterations but these iterations are taking nearly 4 minutes. My computer …

---

## [Copy Image into another image taking into account origin & spacing](https://discourse.itk.org/t/copy-image-into-another-image-taking-into-account-origin-spacing/3899)

<div class="topic-metadata">

**Author:** [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Replies:** 2\
**Last updated:** [March 8, 2021, 6:42pm UTC](https://discourse.itk.org/t/copy-image-into-another-image-taking-into-account-origin-spacing/3899 "2021-03-08T18:42:42Z")

</div>

What would be the basic steps to copy a source image into an existing destination image that takes into account the origin and spacing of both? I have googled a bit and found https://itk.org/ITKExamples/src/Filtering/Im…

---

## [Visualize 2D transform](https://discourse.itk.org/t/visualize-2d-transform/3896)

<div class="topic-metadata">

**Author:** [@rogertrullo](https://discourse.itk.org/u/rogertrullo)\
**Replies:** 5\
**Last updated:** [February 26, 2021, 3:04pm UTC](https://discourse.itk.org/t/visualize-2d-transform/3896 "2021-02-26T15:04:39Z")

</div>

Hi all, I am using SimpleITK to perform non rigid registration (bsplines). I am also using 3d Slicer to visualize the produced transform. Now the transform .tfm file is only read by slicer if it’s a 3d transform and not…

---

## [Is order of transforms in a composite transform reversed relative to transform order during registration?](https://discourse.itk.org/t/is-order-of-transforms-in-a-composite-transform-reversed-relative-to-transform-order-during-registration/3829)

<div class="topic-metadata">

**Author:** [@Roy123](https://discourse.itk.org/u/Roy123)\
**Replies:** 0\
**Last updated:** [February 3, 2021, 2:48pm UTC](https://discourse.itk.org/t/is-order-of-transforms-in-a-composite-transform-reversed-relative-to-transform-order-during-registration/3829 "2021-02-03T14:48:18Z")

</div>

Hi, I have a question regarding the sample code for composite registration found in the simple itk website (The Python code version): In that example the following steps took place in the following order: Affine t…

---

## [Mutual Information Metric in Registration](https://discourse.itk.org/t/mutual-information-metric-in-registration/3812)

<div class="topic-metadata">

**Author:** [@Luis\_Carlos\_Carneiro](https://discourse.itk.org/u/Luis_Carlos_Carneiro)\
**Replies:** 8\
**Last updated:** [January 31, 2021, 9:30pm UTC](https://discourse.itk.org/t/mutual-information-metric-in-registration/3812 "2021-01-31T21:30:23Z")

</div>

Dear All, If I do a registration between two equal/same images. And the result be a perfect match. What will be the final value of the metric? With Mutual Information metric. Thanks, Luís Gonçalves

---

## [Kdtree returned indices and distances](https://discourse.itk.org/t/kdtree-returned-indices-and-distances/3809)

<div class="topic-metadata">

**Author:** [@aestebanlansaque](https://discourse.itk.org/u/aestebanlansaque)\
**Replies:** 0\
**Last updated:** [January 29, 2021, 11:04am UTC](https://discourse.itk.org/t/kdtree-returned-indices-and-distances/3809 "2021-01-29T11:04:53Z")

</div>

Good morning everyone, I am using itk::Statistics::KdTreeGenerator::KdTree in order to find correspondences but it looks like distances are not sorted and always one value is 0 (which might be true for few vertices). F…

---

## [Deformable registration, but only allow deformation in one direction](https://discourse.itk.org/t/deformable-registration-but-only-allow-deformation-in-one-direction/3789)

<div class="topic-metadata">

**Author:** [@Nick\_Rubert](https://discourse.itk.org/u/Nick_Rubert)\
**Replies:** 6\
**Last updated:** [January 24, 2021, 11:28pm UTC](https://discourse.itk.org/t/deformable-registration-but-only-allow-deformation-in-one-direction/3789 "2021-01-24T23:28:53Z")

</div>

Hi message board, I would like to implement the algorithm described in the first paragraph of section 2.3 of this paper: The algorithm performs deformable registration between two images but only allows for stretch…

---

## [Cumulative Gausian Optimizer for Registration](https://discourse.itk.org/t/cumulative-gausian-optimizer-for-registration/3777)

<div class="topic-metadata">

**Author:** [@Michael7](https://discourse.itk.org/u/Michael7)\
**Replies:** 5\
**Last updated:** [January 21, 2021, 8:41am UTC](https://discourse.itk.org/t/cumulative-gausian-optimizer-for-registration/3777 "2021-01-21T08:41:59Z")

</div>

Hi, I’m trying to configure and set an itk::CumulativeGaussianOptimizer instance to run a registration ( itk::PointSetToPointSetRegistrationMethod\<PointSetType, PointSetType \>) procedure. Nevertheless, I seem to find n…

---

## [Binary image to cloud points in physical coordinates](https://discourse.itk.org/t/binary-image-to-cloud-points-in-physical-coordinates/3781)

<div class="topic-metadata">

**Author:** [@ainor](https://discourse.itk.org/u/ainor)\
**Replies:** 5\
**Last updated:** [January 19, 2021, 4:12pm UTC](https://discourse.itk.org/t/binary-image-to-cloud-points-in-physical-coordinates/3781 "2021-01-19T16:12:09Z")

</div>

I have a binary 3d image. How can I extract a point cloud from the image surface in physical coordinates?

---

## [Closest point of a plane to a 3d image in physical coordinates.](https://discourse.itk.org/t/closest-point-of-a-plane-to-a-3d-image-in-physical-coordinates/3779)

<div class="topic-metadata">

**Author:** [@ainor](https://discourse.itk.org/u/ainor)\
**Replies:** 3\
**Last updated:** [January 19, 2021, 2:41pm UTC](https://discourse.itk.org/t/closest-point-of-a-plane-to-a-3d-image-in-physical-coordinates/3779 "2021-01-19T14:41:15Z")

</div>

I have a 3d image formed from a volume of slices. Each Slices in the volume is a binary image (the region of interest has pixels with a value of 255 and the rest of the image is zero). I have a plane in the physical coo…

---

## [How to obtain the physical coordinates of the nodes in an ITK :: Mesh obtained from a 3D volume of CT images](https://discourse.itk.org/t/how-to-obtain-the-physical-coordinates-of-the-nodes-in-an-itk-mesh-obtained-from-a-3d-volume-of-ct-images/3773)

<div class="topic-metadata">

**Author:** [@ainor](https://discourse.itk.org/u/ainor)\
**Replies:** 1\
**Last updated:** [January 18, 2021, 10:37pm UTC](https://discourse.itk.org/t/how-to-obtain-the-physical-coordinates-of-the-nodes-in-an-itk-mesh-obtained-from-a-3d-volume-of-ct-images/3773 "2021-01-18T22:37:58Z")

</div>

I am using ITK library to get a mesh from a 3D image, the 3D image is a volume of slices. I get the mesh using itk::BinaryMask3DMeshSource . But I need to get its physical coordinate for each mesh node and I don’t know h…

---

## [Resampling a displacement-field transformed image](https://discourse.itk.org/t/resampling-a-displacement-field-transformed-image/1884)

<div class="topic-metadata">

**Author:** [@Nino](https://discourse.itk.org/u/Nino)\
**Replies:** 7\
**Last updated:** [January 4, 2021, 12:55am UTC](https://discourse.itk.org/t/resampling-a-displacement-field-transformed-image/1884 "2021-01-04T00:55:38Z")

</div>

Hi guys, I am using a DisplacementField transformation and resample the image with the ResampleImageFilter. Everything is working great! Now I am wondering how the resample method is working? Does it invoke the InverseD…

---

## [OrientedGaussianInterpolateImageFilter Python ITK](https://discourse.itk.org/t/orientedgaussianinterpolateimagefilter-python-itk/3708)

<div class="topic-metadata">

**Author:** [@Nick\_Rubert](https://discourse.itk.org/u/Nick_Rubert)\
**Replies:** 2\
**Last updated:** [December 17, 2020, 8:43pm UTC](https://discourse.itk.org/t/orientedgaussianinterpolateimagefilter-python-itk/3708 "2020-12-17T20:43:43Z")

</div>

Hi message board, I’m trying to port some code from Python ITK v 4.13.0 to Python wrapped ITK v 5.1.1 or SimpleITK \`\`\` 2.0.0 (ITK 5.1). In ITK v 4.13 I’m using the OrientedGaussianInterpolateImageFilter to simulate bl…

---

## [Registering vertebra CT and MRI](https://discourse.itk.org/t/registering-vertebra-ct-and-mri/3694)

<div class="topic-metadata">

**Author:** [@Ray\_Jian](https://discourse.itk.org/u/Ray_Jian)\
**Replies:** 6\
**Last updated:** [December 11, 2020, 1:42am UTC](https://discourse.itk.org/t/registering-vertebra-ct-and-mri/3694 "2020-12-11T01:42:52Z")

</div>

Hello, All. I am trying to register vertebra in spine CT and MRI. The average size of the vertebra MRI is (200-300, 100-200, 15). The average number of intensity in MRI is around 500. Which is calculated by this. min\_…

---

## [RegistrationV4 and BsplineTransform Parallellization](https://discourse.itk.org/t/registrationv4-and-bsplinetransform-parallellization/3683)

<div class="topic-metadata">

**Author:** [@machadoL](https://discourse.itk.org/u/machadoL)\
**Replies:** 4\
**Last updated:** [December 8, 2020, 9:34pm UTC](https://discourse.itk.org/t/registrationv4-and-bsplinetransform-parallellization/3683 "2020-12-08T21:34:28Z")

</div>

Hello everyone. As I’ve been mentioning in my previous posts, I am working in a deformable registration pipeline. It happens that I am running my tests in a supercomputer and noticed that the code I wrote using ITK cla…

---

## [speed up registration process](https://discourse.itk.org/t/speed-up-registration-process/3667)

<div class="topic-metadata">

**Author:** [@pierrectl](https://discourse.itk.org/u/pierrectl)\
**Replies:** 2\
**Last updated:** [December 1, 2020, 9:25am UTC](https://discourse.itk.org/t/speed-up-registration-process/3667 "2020-12-01T09:25:27Z")

</div>

hello everyone, I currently develop a registration algorithm using itk framework. Everything seems to work well, except that execution time is very long, especially metric computation (as expected). I have one question:…

---

## [LBFGS optimizer](https://discourse.itk.org/t/lbfgs-optimizer/3658)

<div class="topic-metadata">

**Author:** [@pierrectl](https://discourse.itk.org/u/pierrectl)\
**Replies:** 3\
**Last updated:** [December 1, 2020, 9:24am UTC](https://discourse.itk.org/t/lbfgs-optimizer/3658 "2020-12-01T09:24:47Z")

</div>

hello everyone, I was wondering if itk developers provided a registration example between two 3d images using LBFGS optimizer ? I already checked test examples and program throws the following exception when computing r…

---

## [itk::ERROR Image(0x55f0ab8f5690): A spacing of 0 is not allowed: Spacing is \[0, 0, 0\]](https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648)

<div class="topic-metadata">

**Author:** [@machadoL](https://discourse.itk.org/u/machadoL)\
**Replies:** 3\
**Last updated:** [November 26, 2020, 4:41pm UTC](https://discourse.itk.org/t/itk-error-image-0x55f0ab8f5690-a-spacing-of-0-is-not-allowed-spacing-is-0-0-0/3648 "2020-11-26T16:41:23Z")

</div>

Hello, everyone! I am struggling with that error: itk::ERROR Image(0x55f0ab8f5690): A spacing of 0 is not allowed: Spacing is \[0, 0, 0\] The situation is the following: I am performing a multistage image registration. …

---

## [particle swarm optimizer](https://discourse.itk.org/t/particle-swarm-optimizer/3504)

<div class="topic-metadata">

**Author:** [@pierrectl](https://discourse.itk.org/u/pierrectl)\
**Replies:** 8\
**Last updated:** [November 26, 2020, 12:42pm UTC](https://discourse.itk.org/t/particle-swarm-optimizer/3504 "2020-11-26T12:42:36Z")

</div>

Hello everyone, I was wondering if itk developers provided a registration example between two 3d images using particle swarm optimizer ? Thank you

---

## [affine transform followed by translation understanding](https://discourse.itk.org/t/affine-transform-followed-by-translation-understanding/3643)

<div class="topic-metadata">

**Author:** [@prms](https://discourse.itk.org/u/prms)\
**Replies:** 1\
**Last updated:** [November 23, 2020, 1:08am UTC](https://discourse.itk.org/t/affine-transform-followed-by-translation-understanding/3643 "2020-11-23T01:08:34Z")

</div>

I’ve been trying affine transform with translation. There are a few things I noticed while using them. It might be due to my limited understanding of the subject matter. Any help is highly appreciated. The notebook with …

[Previous page](https://discourse.itk.org/c/algorithms/7.md?no_subcategories=false&page=9)

[Next page](https://discourse.itk.org/c/algorithms/7.md?no_subcategories=false&page=11)
