# Algorithms

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

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

**Page:** 6

---

## [New external module: ITKTopologyControl](https://discourse.itk.org/t/new-external-module-itktopologycontrol/5393)

<div class="topic-metadata">

**Author:** [@dyoll](https://discourse.itk.org/u/dyoll)\
**Replies:** 2\
**Last updated:** [February 24, 2023, 9:06pm UTC](https://discourse.itk.org/t/new-external-module-itktopologycontrol/5393 "2023-02-24T21:06:03Z")

</div>

Feel free to try out this new external module: GitHub - dyollb/ITKTopologyControl: ITK external module to control topology of binary mask regions It kind of works like morphological closing, but in the erode phase it pr…

---

## [Edge Issues: Displacement Registration](https://discourse.itk.org/t/edge-issues-displacement-registration/5749)

<div class="topic-metadata">

**Author:** [@elapins](https://discourse.itk.org/u/elapins)\
**Replies:** 0\
**Last updated:** [February 23, 2023, 8:04pm UTC](https://discourse.itk.org/t/edge-issues-displacement-registration/5749 "2023-02-23T20:04:04Z")

</div>

I have been trying to register the images attached via the displacement registration method provided: Image Registration Method Displacement 1 — SimpleITK 2.0rc2 documentation However, it seems that the edges of my resu…

---

## [Registering binary mask to x-ray image (2D to 2D) rigid image registration SimpleITK](https://discourse.itk.org/t/registering-binary-mask-to-x-ray-image-2d-to-2d-rigid-image-registration-simpleitk/5741)

<div class="topic-metadata">

**Author:** [@isuruwi](https://discourse.itk.org/u/isuruwi)\
**Replies:** 3\
**Last updated:** [February 22, 2023, 11:44pm UTC](https://discourse.itk.org/t/registering-binary-mask-to-x-ray-image-2d-to-2d-rigid-image-registration-simpleitk/5741 "2023-02-22T23:44:04Z")

</div>

I have an xray image and it’s corresponding predicted binary mask image (2D). I’m currently using simpleITK to rigidly register the binary mask to the x-ray image. However, when I apply the final transform to the moving …

---

## [Universal Registration Framework](https://discourse.itk.org/t/universal-registration-framework/5729)

<div class="topic-metadata">

**Author:** [@elapins](https://discourse.itk.org/u/elapins)\
**Replies:** 9\
**Last updated:** [February 21, 2023, 6:32pm UTC](https://discourse.itk.org/t/universal-registration-framework/5729 "2023-02-21T18:32:56Z")

</div>

Hello, Is it possible to write a registration framework that would work for any image pair? Meaning, the same inputs and framework would work on image pairs of different specimens? Or is the ITK registration framework …

---

## [About using mask and sampling simultaneously in registration](https://discourse.itk.org/t/about-using-mask-and-sampling-simultaneously-in-registration/5712)

<div class="topic-metadata">

**Author:** [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Replies:** 2\
**Last updated:** [February 21, 2023, 10:52am UTC](https://discourse.itk.org/t/about-using-mask-and-sampling-simultaneously-in-registration/5712 "2023-02-21T10:52:17Z")

</div>

When these two strategies are used at the same time, is the sampling point selected only in the mask area?

---

## [Order o Rotation Euler3D](https://discourse.itk.org/t/order-o-rotation-euler3d/4536)

<div class="topic-metadata">

**Author:** [@Luis\_Carlos\_Carneiro](https://discourse.itk.org/u/Luis_Carlos_Carneiro)\
**Replies:** 17\
**Last updated:** [February 21, 2023, 10:03am UTC](https://discourse.itk.org/t/order-o-rotation-euler3d/4536 "2023-02-21T10:03:08Z")

</div>

Dear All, If I do a Registration of Euler3D. The result transform has a Rotation and a Translation. Which is the first operation in Rotation. Is in X? Or is in Z? Thanks, Luís Gonçalves

---

## [SimpleITK & MetaIO: changing the .raw extension](https://discourse.itk.org/t/simpleitk-metaio-changing-the-raw-extension/5724)

<div class="topic-metadata">

**Author:** [@ingmar.voigt](https://discourse.itk.org/u/ingmar.voigt)\
**Replies:** 2\
**Last updated:** [February 20, 2023, 2:20pm UTC](https://discourse.itk.org/t/simpleitk-metaio-changing-the-raw-extension/5724 "2023-02-20T14:20:23Z")

</div>

Dear all, When I save MHD images using https://simpleitk.org/doxygen/latest/html/classitk\_1\_1simple\_1\_1ImageFileWriter.html, is there a way to save with a different extension other than “.raw”/“.zraw”? VTK does support…

---

## [Coordinate System and Registration Transform Results](https://discourse.itk.org/t/coordinate-system-and-registration-transform-results/5718)

<div class="topic-metadata">

**Author:** [@elapins](https://discourse.itk.org/u/elapins)\
**Replies:** 3\
**Last updated:** [February 20, 2023, 2:02pm UTC](https://discourse.itk.org/t/coordinate-system-and-registration-transform-results/5718 "2023-02-20T14:02:56Z")

</div>

When I print the parameters for a certain image registration, what point is this translating?? the top left? or the center? I understand that the resulting transform transforms the fixed image to the moving, but what exa…

---

## [Registration: Dimensional Differences in Images, Padding](https://discourse.itk.org/t/registration-dimensional-differences-in-images-padding/5723)

<div class="topic-metadata">

**Author:** [@elapins](https://discourse.itk.org/u/elapins)\
**Replies:** 3\
**Last updated:** [February 18, 2023, 6:43pm UTC](https://discourse.itk.org/t/registration-dimensional-differences-in-images-padding/5723 "2023-02-18T18:43:34Z")

</div>

How does ITK/SimpleITK account for dimensional differences between images during registration?? OR do they need to be padded accordingly?

---

## [Affine Transform: Offset vs. fixed center](https://discourse.itk.org/t/affine-transform-offset-vs-fixed-center/5721)

<div class="topic-metadata">

**Author:** [@elapins](https://discourse.itk.org/u/elapins)\
**Replies:** 2\
**Last updated:** [February 18, 2023, 4:12pm UTC](https://discourse.itk.org/t/affine-transform-offset-vs-fixed-center/5721 "2023-02-18T16:12:39Z")

</div>

When initializing an affine transform for a registration framework, what is the difference between the offset and the fixed center inputs?

---

## [SimpleITK Registration](https://discourse.itk.org/t/simpleitk-registration/5709)

<div class="topic-metadata">

**Author:** [@elapins](https://discourse.itk.org/u/elapins)\
**Replies:** 2\
**Last updated:** [February 17, 2023, 9:10pm UTC](https://discourse.itk.org/t/simpleitk-registration/5709 "2023-02-17T21:10:28Z")

</div>

Hello, I have been trying to implement a SimpleITK registration framework to register a reference image that has no change with a deformed image (warped image). I split the reference image up into subregions and try to…

---

## [Labelmap to scaler](https://discourse.itk.org/t/labelmap-to-scaler/5693)

<div class="topic-metadata">

**Author:** [@Sean\_Hatton](https://discourse.itk.org/u/Sean_Hatton)\
**Replies:** 4\
**Last updated:** [February 15, 2023, 5:46pm UTC](https://discourse.itk.org/t/labelmap-to-scaler/5693 "2023-02-15T17:46:26Z")

</div>

How do you get a labelmap back to a scalar image? I have been trying the below, but I keep getting a labelmap with on object, not a scalar. LabelmapToBinary didn’t work. Thoughts? I am trying to run mrc2tif but it won’t …

---

## [Extract Head Scan From CT Angiogram](https://discourse.itk.org/t/extract-head-scan-from-ct-angiogram/5698)

<div class="topic-metadata">

**Author:** [@niruta](https://discourse.itk.org/u/niruta)\
**Replies:** 4\
**Last updated:** [February 13, 2023, 4:26am UTC](https://discourse.itk.org/t/extract-head-scan-from-ct-angiogram/5698 "2023-02-13T04:26:46Z")

</div>

I want to extract head data from a CT Angiogram which contains the neck scan as well. Is there any way to do this ? This is how the data looks.

---

## [z-maps for comparing PET images](https://discourse.itk.org/t/z-maps-for-comparing-pet-images/5414)

<div class="topic-metadata">

**Author:** [@Keyn34](https://discourse.itk.org/u/Keyn34)\
**Replies:** 7\
**Last updated:** [February 10, 2023, 9:51pm UTC](https://discourse.itk.org/t/z-maps-for-comparing-pet-images/5414 "2023-02-10T21:51:59Z")

</div>

Hello all, I am trying to compute z-maps for PET images to test it as a comparison methodology/metric with SimpleITK on Python. The formula is simple, but I always have a completely black image with an insanely broad (…

---

## [Write mesh data (cell data) with python - it is not working?](https://discourse.itk.org/t/write-mesh-data-cell-data-with-python-it-is-not-working/5682)

<div class="topic-metadata">

**Author:** [@tutti](https://discourse.itk.org/u/tutti)\
**Replies:** 6\
**Last updated:** [February 10, 2023, 1:19am UTC](https://discourse.itk.org/t/write-mesh-data-cell-data-with-python-it-is-not-working/5682 "2023-02-10T01:19:45Z")

</div>

Hi guys, I’m trying to write the mesh data with point and cell data using python (based on C++). This is my Python codes: from itk import BinaryMask3DMeshSource MeshType = itk.Mesh\[itk.F, 3\] ImageType = itk.Image\[itk…

---

## [Blank result with non-default variance for the Gaussian smoothing filter GPU implementation](https://discourse.itk.org/t/blank-result-with-non-default-variance-for-the-gaussian-smoothing-filter-gpu-implementation/5479)

<div class="topic-metadata">

**Author:** [@Mumumia](https://discourse.itk.org/u/Mumumia)\
**Replies:** 4\
**Last updated:** [February 9, 2023, 2:39pm UTC](https://discourse.itk.org/t/blank-result-with-non-default-variance-for-the-gaussian-smoothing-filter-gpu-implementation/5479 "2023-02-09T14:39:15Z")

</div>

Hi experts, We have implemented the GPU-supported Gaussian smoothing filter. It works ok for the default variance and kernelWidth. However, when changing the variance parameter to a user-specified value, the GPU version…

---

## [About multilevel registration](https://discourse.itk.org/t/about-multilevel-registration/5675)

<div class="topic-metadata">

**Author:** [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Replies:** 0\
**Last updated:** [February 6, 2023, 2:14am UTC](https://discourse.itk.org/t/about-multilevel-registration/5675 "2023-02-06T02:14:23Z")

</div>

At the time of registration, I chose two levels of registration to speed up the registration using the image pyramid. But after the first level of registration, I almost got the correct results, but the second level of r…

---

## [Transformation translation error?](https://discourse.itk.org/t/transformation-translation-error/5673)

<div class="topic-metadata">

**Author:** [@Matthieu\_Brucher](https://discourse.itk.org/u/Matthieu_Brucher)\
**Replies:** 0\
**Last updated:** [February 4, 2023, 6:59pm UTC](https://discourse.itk.org/t/transformation-translation-error/5673 "2023-02-04T18:59:22Z")

</div>

I’m trying to use the example from Register Image to Another Using Landmarks — v5.3.0 to set up a registration based on matching set of points. The estimated transform seems to me OK: AffineTransform (0x157604c30) RTTI…

---

## [Sitk AffineTransform vs Pytorch grid sample](https://discourse.itk.org/t/sitk-affinetransform-vs-pytorch-grid-sample/3603)

<div class="topic-metadata">

**Author:** [@prms](https://discourse.itk.org/u/prms)\
**Replies:** 11\
**Last updated:** [January 26, 2023, 6:45pm UTC](https://discourse.itk.org/t/sitk-affinetransform-vs-pytorch-grid-sample/3603 "2023-01-26T18:45:28Z")

</div>

I’m comparing the result of SITK AffineTransform and Pytorch grid\_sample. The difference between them is that sitk treats origin as the centre of rotation while Pytorch treats the centre of the image as the centre of rot…

---

## [Suitability of registration algorithms for a specific image type](https://discourse.itk.org/t/suitability-of-registration-algorithms-for-a-specific-image-type/5636)

<div class="topic-metadata">

**Author:** [@ericrhenry](https://discourse.itk.org/u/ericrhenry)\
**Replies:** 4\
**Last updated:** [January 20, 2023, 3:58pm UTC](https://discourse.itk.org/t/suitability-of-registration-algorithms-for-a-specific-image-type/5636 "2023-01-20T15:58:02Z")

</div>

I am new to ITK, and have been exploring the different registration algorithms available. (Kudos on the breadth and depth of examples provided, BTW.) Most of the illustrations I have seen deal with biomedical images, of …

---

## [Gradient magnitude (0) at the first iteration](https://discourse.itk.org/t/gradient-magnitude-0-at-the-first-iteration/5628)

<div class="topic-metadata">

**Author:** [@suzume](https://discourse.itk.org/u/suzume)\
**Replies:** 0\
**Last updated:** [January 14, 2023, 2:27pm UTC](https://discourse.itk.org/t/gradient-magnitude-0-at-the-first-iteration/5628 "2023-01-14T14:27:49Z")

</div>

Hi, the iteration stopped at the first iteration no matter what the initial transform parameters are and the stop reason is " RegularStepGradientDescentOptimizer: Gradient magnitude tolerance met after 0 iterations. Grad…

---

## [about dicom regesition](https://discourse.itk.org/t/about-dicom-regesition/5618)

<div class="topic-metadata">

**Author:** [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Replies:** 2\
**Last updated:** [January 10, 2023, 9:58am UTC](https://discourse.itk.org/t/about-dicom-regesition/5618 "2023-01-10T09:58:32Z")

</div>

When using 3Dslicer, I found that some plug-ins will transfer dicom images to other formats for registration. I want to know what is the advantage of this?

---

## [New example: Deform a Volume With a Thin Plate Spline](https://discourse.itk.org/t/new-example-deform-a-volume-with-a-thin-plate-spline/5619)

<div class="topic-metadata">

**Author:** [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Replies:** 0\
**Last updated:** [January 9, 2023, 2:52pm UTC](https://discourse.itk.org/t/new-example-deform-a-volume-with-a-thin-plate-spline/5619 "2023-01-09T14:52:21Z")

</div>

Hi folks, Just a quick note that we have a new example on how to deform a 3D volume with a thin plate spline: https://examples.itk.org/src/core/transform/deformavolumewithathinplatespline/documentation

---

## [Get the transformation or displacement vector field with SITK](https://discourse.itk.org/t/get-the-transformation-or-displacement-vector-field-with-sitk/5610)

<div class="topic-metadata">

**Author:** [@VHK](https://discourse.itk.org/u/VHK)\
**Replies:** 4\
**Last updated:** [January 5, 2023, 3:21pm UTC](https://discourse.itk.org/t/get-the-transformation-or-displacement-vector-field-with-sitk/5610 "2023-01-05T15:21:33Z")

</div>

Hello everyone, I did the registration and want to calculate TRE (target registration error) with SITK. I have the fixed image and the deformed moving image, and the landmarks. To compute TRE, I need to get the transfo…

---

## [Adjust window/level of the image](https://discourse.itk.org/t/adjust-window-level-of-the-image/5590)

<div class="topic-metadata">

**Author:** [@suzume](https://discourse.itk.org/u/suzume)\
**Replies:** 6\
**Last updated:** [December 24, 2022, 1:56am UTC](https://discourse.itk.org/t/adjust-window-level-of-the-image/5590 "2022-12-24T01:56:57Z")

</div>

Hello, I want to change the window/level of the portal image to make it looks similar to the DRR image. Is there useful tools in ITK to achieve it? Or what can I do to make it? The portal image and the DRR image are at…

---

## [Issues with TransformContinuousIndexToPhysicalPoint for anisotropic images](https://discourse.itk.org/t/issues-with-transformcontinuousindextophysicalpoint-for-anisotropic-images/5588)

<div class="topic-metadata">

**Author:** [@nifti](https://discourse.itk.org/u/nifti)\
**Replies:** 3\
**Last updated:** [December 22, 2022, 5:50pm UTC](https://discourse.itk.org/t/issues-with-transformcontinuousindextophysicalpoint-for-anisotropic-images/5588 "2022-12-22T17:50:44Z")

</div>

Hi all, I have a very basic question regarding the TransformContinuousIndexToPhysicalPoint() function. I have two images: isotropically sampled image (1x1x1) anisotropically acquired image (0.2x0.2x5) I would like t…

---

## [Parameters in BSplineTransform](https://discourse.itk.org/t/parameters-in-bsplinetransform/3395)

<div class="topic-metadata">

**Author:** [@prms](https://discourse.itk.org/u/prms)\
**Replies:** 10\
**Last updated:** [December 20, 2022, 2:19pm UTC](https://discourse.itk.org/t/parameters-in-bsplinetransform/3395 "2022-12-20T14:19:34Z")

</div>

I’m trying to register images using BSplineTransform. I’m not clear about the total number of parameters in case of BSplineTransform. In the case of AffineTransform, for 3D images, there are 12 parameters and I can count…

---

## [Export ITK points into DICOM SR planar annotations?](https://discourse.itk.org/t/export-itk-points-into-dicom-sr-planar-annotations/5555)

<div class="topic-metadata">

**Author:** [@hapap](https://discourse.itk.org/u/hapap)\
**Replies:** 7\
**Last updated:** [December 13, 2022, 10:37pm UTC](https://discourse.itk.org/t/export-itk-points-into-dicom-sr-planar-annotations/5555 "2022-12-13T22:37:36Z")

</div>

Hi! We have various points-of-interest in our software and would like to export them into DICOM format files. To my understanding, the correct format for this would be DICOM Structured Reports (SR) and its planar annota…

---

## [itk::OnePlusOneEvolutionaryOptimizerv4\<double\> How to adjust parameters for this optimizer？](https://discourse.itk.org/t/itk-oneplusoneevolutionaryoptimizerv4-double-how-to-adjust-parameters-for-this-optimizer/5567)

<div class="topic-metadata">

**Author:** [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Replies:** 0\
**Last updated:** [December 13, 2022, 2:53am UTC](https://discourse.itk.org/t/itk-oneplusoneevolutionaryoptimizerv4-double-how-to-adjust-parameters-for-this-optimizer/5567 "2022-12-13T02:53:32Z")

</div>

Can’t this optimizer optimize the 3d-3d itk:: VersorRigid3DTransform? When I use this optimizer, I can’t always find the results. I use cascade registration. The first stage is a translation, which can work normally. But…

---

## [Convex Hull as Hit-or-Miss](https://discourse.itk.org/t/convex-hull-as-hit-or-miss/5563)

<div class="topic-metadata">

**Author:** [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Replies:** 3\
**Last updated:** [December 12, 2022, 11:16pm UTC](https://discourse.itk.org/t/convex-hull-as-hit-or-miss/5563 "2022-12-12T23:16:20Z")

</div>

I am trying to implement convex hull algorithm calling hit-or-miss several times with 90 degrees rotated structural elements. It is not working properly. using ShapedNeighborhoodIteratorType\_Heart\_Hull =itk::ConstSha…

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

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