# Algorithms

**URL:** https://discourse.itk.org/c/algorithms/7.md?page=3

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

**Page:** 4

---

## [Surface Closing in Breast Segmentation from MRI Images](https://discourse.itk.org/t/surface-closing-in-breast-segmentation-from-mri-images/6403)

<div class="topic-metadata">

**Author:** [@Miri\_Trope](https://discourse.itk.org/u/Miri_Trope)\
**Replies:** 3\
**Last updated:** [January 21, 2024, 11:50pm UTC](https://discourse.itk.org/t/surface-closing-in-breast-segmentation-from-mri-images/6403 "2024-01-21T23:50:42Z")

</div>

Hello everyone, I’m currently facing an issue in obtaining a closed surface for the segmentation output of the attached MRI breast image. The algorithm’s objective is to segment the breast (body). As you can see, the sur…

---

## [Alternatives to TriangleMeshToBinaryImageFilter](https://discourse.itk.org/t/alternatives-to-trianglemeshtobinaryimagefilter/6386)

<div class="topic-metadata">

**Author:** [@CrownMella](https://discourse.itk.org/u/CrownMella)\
**Replies:** 3\
**Last updated:** [January 11, 2024, 5:31pm UTC](https://discourse.itk.org/t/alternatives-to-trianglemeshtobinaryimagefilter/6386 "2024-01-11T17:31:41Z")

</div>

Hi all, As title suggests, are there any other ways to convert a mesh to an image? the current filter causes these barcode artefacts to appear and this ruins the image. I’ve tried using VTK and the barcodes don’t appear…

---

## [Orientation did not changed after rotation](https://discourse.itk.org/t/orientation-did-not-changed-after-rotation/6384)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.itk.org/u/Jakub_Mitura)\
**Replies:** 5\
**Last updated:** [January 9, 2024, 1:34pm UTC](https://discourse.itk.org/t/orientation-did-not-changed-after-rotation/6384 "2024-01-09T13:34:14Z")

</div>

Hello I adapted method of 3d rotation around center point from \[1\]. It basically constructs rotation matrix and do euler transformation. However when I check direction and origin the do not change, although in principle…

---

## [Wrong distance map](https://discourse.itk.org/t/wrong-distance-map/6342)

<div class="topic-metadata">

**Author:** [@Sean\_Hatton](https://discourse.itk.org/u/Sean_Hatton)\
**Replies:** 1\
**Last updated:** [December 8, 2023, 8:17pm UTC](https://discourse.itk.org/t/wrong-distance-map/6342 "2023-12-08T20:17:20Z")

</div>

I have a weird problem with distancemaps. I am in a Python 3.7 environment with SITK 2.2 (SITK 2.3 not supported on Python 3.7). I was able to run sitk.SignedMaurerDistanceMap and sitk.SignedDanielssonDistanceMap altern…

---

## [RTK reconstruction, using ParkerShortScanImageFilter, but the result is incorrect](https://discourse.itk.org/t/rtk-reconstruction-using-parkershortscanimagefilter-but-the-result-is-incorrect/6325)

<div class="topic-metadata">

**Author:** [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Replies:** 3\
**Last updated:** [December 7, 2023, 9:48am UTC](https://discourse.itk.org/t/rtk-reconstruction-using-parkershortscanimagefilter-but-the-result-is-incorrect/6325 "2023-12-07T09:48:02Z")

</div>

For the correct reconstruction result, there should be a rectangle in the middle, but the RTK reconstruction result looks like it is missing some data, becoming a quadrilateral. Is my projection data 845, covering 0-34…

---

## [Use JoinSeriesImageFilter to append 4D images into 5D](https://discourse.itk.org/t/use-joinseriesimagefilter-to-append-4d-images-into-5d/6324)

<div class="topic-metadata">

**Author:** [@cpinter](https://discourse.itk.org/u/cpinter)\
**Replies:** 3\
**Last updated:** [November 30, 2023, 2:16pm UTC](https://discourse.itk.org/t/use-joinseriesimagefilter-to-append-4d-images-into-5d/6324 "2023-11-30T14:16:56Z")

</div>

Hi all, I have a series of 4D images (3D + scalar component) with the same dimensions, scalar type, number of scalar components, and I’d like to append them into a single image (a time or other type of sequence of image…

---

## [Combining overlapping segmentations of same region from different images.](https://discourse.itk.org/t/combining-overlapping-segmentations-of-same-region-from-different-images/6309)

<div class="topic-metadata">

**Author:** [@ramirez](https://discourse.itk.org/u/ramirez)\
**Replies:** 11\
**Last updated:** [November 23, 2023, 3:04pm UTC](https://discourse.itk.org/t/combining-overlapping-segmentations-of-same-region-from-different-images/6309 "2023-11-23T15:04:19Z")

</div>

Hello everyone, There is a certain region in these images (MRI) whose boundaries end in one view but can be easily observed in another ( e.g., the posterior limit in the coronal plane can be extended in the sagittal pla…

---

## [Resolving Image Cropping Issue in NIFTI Image Resampling](https://discourse.itk.org/t/resolving-image-cropping-issue-in-nifti-image-resampling/6313)

<div class="topic-metadata">

**Author:** [@hjy0404](https://discourse.itk.org/u/hjy0404)\
**Replies:** 3\
**Last updated:** [November 21, 2023, 3:05am UTC](https://discourse.itk.org/t/resolving-image-cropping-issue-in-nifti-image-resampling/6313 "2023-11-21T03:05:56Z")

</div>

I am trying to resample a NIFTI image from a resolution of 512,512,661 to 512,512,147 using SimpleITK. Below is the code I’ve used: def resample\_to\_original\_size(isotropic\_img, ref\_img): original\_spacing = ref\_img.…

---

## [N4 bias field correction - Can't find "spline spacing" in simpleITK](https://discourse.itk.org/t/n4-bias-field-correction-cant-find-spline-spacing-in-simpleitk/6267)

<div class="topic-metadata">

**Author:** [@tonkeln](https://discourse.itk.org/u/tonkeln)\
**Replies:** 4\
**Last updated:** [October 30, 2023, 10:25am UTC](https://discourse.itk.org/t/n4-bias-field-correction-cant-find-spline-spacing-in-simpleitk/6267 "2023-10-30T10:25:40Z")

</div>

Hello everyone, In 3D Slicer (and ANTs) there is the parameter “spline spacing” or “spline distance” to define the distance between control points for the N4 bias field correction. I would like to reproduce a paper whe…

---

## [Point indices after 3D rotation](https://discourse.itk.org/t/point-indices-after-3d-rotation/6249)

<div class="topic-metadata">

**Author:** [@Eloy\_Schultz](https://discourse.itk.org/u/Eloy_Schultz)\
**Replies:** 10\
**Last updated:** [October 24, 2023, 8:07pm UTC](https://discourse.itk.org/t/point-indices-after-3d-rotation/6249 "2023-10-24T20:07:41Z")

</div>

Hello there, I am trying to rotate a CT-scan and then locate the centroid of a segmented lesion. I have a SITK image named image and a SITK image containing a binary segmentation mask named ann. The idea is as follows: …

---

## [Partial Volume and (linear) interpolation](https://discourse.itk.org/t/partial-volume-and-linear-interpolation/6254)

<div class="topic-metadata">

**Author:** [@Romain\_Valabregue](https://discourse.itk.org/u/Romain_Valabregue)\
**Replies:** 1\
**Last updated:** [October 17, 2023, 1:41pm UTC](https://discourse.itk.org/t/partial-volume-and-linear-interpolation/6254 "2023-10-17T13:41:45Z")

</div>

Hello I am trying to construct a ground truth partial volume map (of brain region) For instance I start with a high resolution (0.25 mm³) binnary mask of Gray Matter (GM) and I want to compute the partial volume at 1mm…

---

## [Image metrics that incorporate segmentation into registration](https://discourse.itk.org/t/image-metrics-that-incorporate-segmentation-into-registration/6223)

<div class="topic-metadata">

**Author:** [@beastwood](https://discourse.itk.org/u/beastwood)\
**Replies:** 1\
**Last updated:** [September 27, 2023, 8:18pm UTC](https://discourse.itk.org/t/image-metrics-that-incorporate-segmentation-into-registration/6223 "2023-09-27T20:18:33Z")

</div>

I am looking for a way to incorporate the results of image segmentation into an image registration framework and would love some feedback or advice on several possible avenues to pursue. Similar to @dyoll’s question (Me…

---

## [Metrics for registration of labelmaps](https://discourse.itk.org/t/metrics-for-registration-of-labelmaps/5755)

<div class="topic-metadata">

**Author:** [@dyoll](https://discourse.itk.org/u/dyoll)\
**Replies:** 1\
**Last updated:** [September 22, 2023, 3:02pm UTC](https://discourse.itk.org/t/metrics-for-registration-of-labelmaps/5755 "2023-09-22T15:02:42Z")

</div>

With the availability of machine learning it is now often possible to obtain reasonable guesses for segmentations. However, ML-based inference usually does not provide topological/connectivity guarantees for the resultin…

---

## [Is there a v4 version of the itkVersorTransformOptimizer class available？](https://discourse.itk.org/t/is-there-a-v4-version-of-the-itkversortransformoptimizer-class-available/6221)

<div class="topic-metadata">

**Author:** [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 8:46am UTC](https://discourse.itk.org/t/is-there-a-v4-version-of-the-itkversortransformoptimizer-class-available/6221 "2023-09-21T08:46:43Z")

</div>

When I was reviewing the documentation for itkVersorTransform, I saw that it is recommended to use the itk:: VersorRigid3DTransformOptimizer class. However, it is the v3 version, and I have temporarily used a RegularStep…

---

## [Is there no binary type '01' in the pixel type of SimpleItk?](https://discourse.itk.org/t/is-there-no-binary-type-01-in-the-pixel-type-of-simpleitk/6211)

<div class="topic-metadata">

**Author:** [@jumbojing](https://discourse.itk.org/u/jumbojing)\
**Replies:** 9\
**Last updated:** [September 15, 2023, 10:47pm UTC](https://discourse.itk.org/t/is-there-no-binary-type-01-in-the-pixel-type-of-simpleitk/6211 "2023-09-15T22:47:51Z")

</div>

Is there no binary type ‘01’ in the pixel type of SimpleItk?

---

## [How to set center z if the 3D image is rotated along z axis with ITK::affineTransform?](https://discourse.itk.org/t/how-to-set-center-z-if-the-3d-image-is-rotated-along-z-axis-with-itk-affinetransform/6186)

<div class="topic-metadata">

**Author:** [@SummerZ2020](https://discourse.itk.org/u/SummerZ2020)\
**Replies:** 0\
**Last updated:** [September 8, 2023, 8:14am UTC](https://discourse.itk.org/t/how-to-set-center-z-if-the-3d-image-is-rotated-along-z-axis-with-itk-affinetransform/6186 "2023-09-08T08:14:08Z")

</div>

Hello all, I am working on 3D image rotation now. And ITK is really a great tool to do image processing. I have used affinetransform to rotate the 3D image. The rotation is done along z axis, in my view, the center on z…

---

## [How to use ITK to segment bones in osteoporotic patients](https://discourse.itk.org/t/how-to-use-itk-to-segment-bones-in-osteoporotic-patients/6181)

<div class="topic-metadata">

**Author:** [@AeBoPi](https://discourse.itk.org/u/AeBoPi)\
**Replies:** 2\
**Last updated:** [September 6, 2023, 4:12pm UTC](https://discourse.itk.org/t/how-to-use-itk-to-segment-bones-in-osteoporotic-patients/6181 "2023-09-06T16:12:28Z")

</div>

Osteoporosis reduces bone density and thus the strength of bone in the CT data set (shown in the figure), making it impossible to use traditional thresholding techniques to handle segmentation. I noticed that the M…

---

## [How to ensure DRR generated image has the same size as Input Xray image during 2d/3dregistration](https://discourse.itk.org/t/how-to-ensure-drr-generated-image-has-the-same-size-as-input-xray-image-during-2d-3dregistration/3445)

<div class="topic-metadata">

**Author:** [@Henco](https://discourse.itk.org/u/Henco)\
**Replies:** 6\
**Last updated:** [September 4, 2023, 3:38am UTC](https://discourse.itk.org/t/how-to-ensure-drr-generated-image-has-the-same-size-as-input-xray-image-during-2d-3dregistration/3445 "2023-09-04T03:38:07Z")

</div>

Good Morning All, I have a question regarding the itk2d3dregistration module. I’m using it to register a CT liver volume to an XRay of said liver. I’ve extracted the vessels in both the 2d and 3d images and used those a…

---

## [Resample displacement field](https://discourse.itk.org/t/resample-displacement-field/6158)

<div class="topic-metadata">

**Author:** [@Xinyue](https://discourse.itk.org/u/Xinyue)\
**Replies:** 7\
**Last updated:** [September 1, 2023, 9:53am UTC](https://discourse.itk.org/t/resample-displacement-field/6158 "2023-09-01T09:53:53Z")

</div>

Hi, I am working on the image registration question, and I have my fix image, moving image and displacement field (deformation vector field). I have resampled my images to spacing 1.035003662109375, 1.035003662109375, …

---

## [I am trying to copy all the metadata/header information from one image to another.](https://discourse.itk.org/t/i-am-trying-to-copy-all-the-metadata-header-information-from-one-image-to-another/6120)

<div class="topic-metadata">

**Author:** [@Cristobal\_Rodero](https://discourse.itk.org/u/Cristobal_Rodero)\
**Replies:** 2\
**Last updated:** [August 29, 2023, 7:29am UTC](https://discourse.itk.org/t/i-am-trying-to-copy-all-the-metadata-header-information-from-one-image-to-another/6120 "2023-08-29T07:29:24Z")

</div>

I have a segmentation (original\_image) that when I overlap it with the MRI image it comes from it overlaps as expected (comparing it in 3D Slicer, for instance). I perform some operations on Seg3D (or any other software …

---

## [Split deformation vector field into two deformation vector fields and apply to image in order](https://discourse.itk.org/t/split-deformation-vector-field-into-two-deformation-vector-fields-and-apply-to-image-in-order/6148)

<div class="topic-metadata">

**Author:** [@Xinyue](https://discourse.itk.org/u/Xinyue)\
**Replies:** 9\
**Last updated:** [August 16, 2023, 2:54pm UTC](https://discourse.itk.org/t/split-deformation-vector-field-into-two-deformation-vector-fields-and-apply-to-image-in-order/6148 "2023-08-16T14:54:54Z")

</div>

Hi, I am trying to split the dvf into two dvfs and apply in order. However the result of deforming with one dvf is not the same as deforming with the split two dvfs. I am wondering why is happen and how to fix it. he…

---

## [How to make SmoothingRecursiveGaussianImageFilter supports RequestedRegion](https://discourse.itk.org/t/how-to-make-smoothingrecursivegaussianimagefilter-supports-requestedregion/6139)

<div class="topic-metadata">

**Author:** [@MaxMa](https://discourse.itk.org/u/MaxMa)\
**Replies:** 0\
**Last updated:** [August 11, 2023, 12:22pm UTC](https://discourse.itk.org/t/how-to-make-smoothingrecursivegaussianimagefilter-supports-requestedregion/6139 "2023-08-11T12:22:44Z")

</div>

Hi, In a nutshell, I’m trying to make SmoothingRecursiveGaussianImageFilter not overwriting the user RequestedRegion. The current behavior of the filter is that it modifies the output’s requested region to be the large…

---

## [Inhomogeneity correction using N4 and Python](https://discourse.itk.org/t/inhomogeneity-correction-using-n4-and-python/6123)

<div class="topic-metadata">

**Author:** [@Cambridgeshire](https://discourse.itk.org/u/Cambridgeshire)\
**Replies:** 1\
**Last updated:** [August 1, 2023, 1:02pm UTC](https://discourse.itk.org/t/inhomogeneity-correction-using-n4-and-python/6123 "2023-08-01T13:02:18Z")

</div>

Hey dear supporters, I would like to perform inhomogeneity correction of head and pelvis NIfTI MRI images using Python. My code looks like this: Image = sitk.ReadImage(path) image = sitk.Cast(Image, sitk.sitkFloat32) …

---

## [ransform parameters' gradient method of normalised cross-correlation](https://discourse.itk.org/t/ransform-parameters-gradient-method-of-normalised-cross-correlation/6063)

<div class="topic-metadata">

**Author:** [@baolin](https://discourse.itk.org/u/baolin)\
**Replies:** 0\
**Last updated:** [July 12, 2023, 1:04pm UTC](https://discourse.itk.org/t/ransform-parameters-gradient-method-of-normalised-cross-correlation/6063 "2023-07-12T13:04:08Z")

</div>

I found calculation transform parameters’ gradient method of normalised cross-correlation in itkNormalizedCorrelationImageToImageMetric.hxx I don’t know why we calculate derivatives like this. I need you help to give m…

---

## [Unable to perform simple image registration](https://discourse.itk.org/t/unable-to-perform-simple-image-registration/6053)

<div class="topic-metadata">

**Author:** [@sarthakpati](https://discourse.itk.org/u/sarthakpati)\
**Replies:** 1\
**Last updated:** [July 11, 2023, 2:48pm UTC](https://discourse.itk.org/t/unable-to-perform-simple-image-registration/6053 "2023-07-11T14:48:12Z")

</div>

Hi, Duplicate of Unable to perform simple image registration · Issue #1956 · SimpleITK/SimpleITK · GitHub, as I was directed to ask the question here. I am using SimpleITK-SimpleElastix since SimpleITK-2.2.1 seem to gi…

---

## [itk::fem updating displacements](https://discourse.itk.org/t/itk-fem-updating-displacements/404)

<div class="topic-metadata">

**Author:** [@nasil122002](https://discourse.itk.org/u/nasil122002)\
**Replies:** 0\
**Last updated:** [November 9, 2017, 7:55pm UTC](https://discourse.itk.org/t/itk-fem-updating-displacements/404 "2017-11-09T19:55:56Z")

</div>

Dear ITK users, I have another question. In order to visualize the deformation, I want to replace the old node coordinates with the new one after generating the solution, like in UpdateDisplacements() function in itkFe…

---

## [Random access to image data](https://discourse.itk.org/t/random-access-to-image-data/6034)

<div class="topic-metadata">

**Author:** [@cookpa](https://discourse.itk.org/u/cookpa)\
**Replies:** 2\
**Last updated:** [July 5, 2023, 4:53pm UTC](https://discourse.itk.org/t/random-access-to-image-data/6034 "2023-07-05T16:53:49Z")

</div>

Hi all, Is there support in ITK for random access to image data? Specifically, I’m trying to figure out if it’s possible to read in a single input volume from a 4D time series, without reading the entire 4D array from …

---

## [Powell optimizer cannot work properly](https://discourse.itk.org/t/powell-optimizer-cannot-work-properly/6014)

<div class="topic-metadata">

**Author:** [@suzume](https://discourse.itk.org/u/suzume)\
**Replies:** 0\
**Last updated:** [June 24, 2023, 8:48am UTC](https://discourse.itk.org/t/powell-optimizer-cannot-work-properly/6014 "2023-06-24T08:48:18Z")

</div>

Hi, I want to use the PowellOptimizer as the optimizer in registration. However, when I use PowellOptimizer, the registration cannot start and it stuck at the beginning as shown below: It always staying the “Starting…

---

## [Can't get right DRR](https://discourse.itk.org/t/cant-get-right-drr/6007)

<div class="topic-metadata">

**Author:** [@suzume](https://discourse.itk.org/u/suzume)\
**Replies:** 4\
**Last updated:** [June 22, 2023, 3:38pm UTC](https://discourse.itk.org/t/cant-get-right-drr/6007 "2023-06-22T15:38:15Z")

</div>

Hi, I was using GetDRRSiddonJacobsRayTracing.cxx to generate DRR images. However I can’t generate the right DRR images as the images generated by the author. The parameters are set as the author proposed, which are -rp …

---

## [Fully automated algorithm to detect MRI noise/artifact?](https://discourse.itk.org/t/fully-automated-algorithm-to-detect-mri-noise-artifact/5973)

<div class="topic-metadata">

**Author:** [@SteveRobbins](https://discourse.itk.org/u/SteveRobbins)\
**Replies:** 2\
**Last updated:** [May 31, 2023, 3:09pm UTC](https://discourse.itk.org/t/fully-automated-algorithm-to-detect-mri-noise-artifact/5973 "2023-05-31T15:09:43Z")

</div>

I want to detect a “noisy” or “artifact-impaired” MRI image – basically a way to classify the image as noisy or not. For clarity, a “good” image looks like the first one, whereas a “bad” image might look like one of the…

[Previous page](https://discourse.itk.org/c/algorithms/7.md?page=2)

[Next page](https://discourse.itk.org/c/algorithms/7.md?page=4)
