# Algorithms

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

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

**Page:** 7

---

## [2d/3d registration](https://discourse.itk.org/t/2d-3d-registration/5539)

<div class="topic-metadata">

**Author:** [@zx-lhb](https://discourse.itk.org/u/zx-lhb)\
**Replies:** 0\
**Last updated:** [December 1, 2022, 9:10am UTC](https://discourse.itk.org/t/2d-3d-registration/5539 "2022-12-01T09:10:11Z")

</div>

I have tried to run the 2d/3d registration example tourial in my own CT dataset by defalut parameters setting. and it worked fine, got 6 transformation parameters and output result images. But I don’t actually know what …

---

## [2D3D registration](https://discourse.itk.org/t/2d3d-registration/5533)

<div class="topic-metadata">

**Author:** [@suzume](https://discourse.itk.org/u/suzume)\
**Replies:** 1\
**Last updated:** [November 30, 2022, 3:01pm UTC](https://discourse.itk.org/t/2d3d-registration/5533 "2022-11-30T15:01:38Z")

</div>

Hi, I want to register the 3D CT image with the 2D image. The IntensityBased2D3DRegistration.cxx needs a pair of 2D orthographic images. And I only have one 2D image. Can I treat this 2D image as a 3D image and register …

---

## [There are deviations between generated DRR image and corresponding EPID image](https://discourse.itk.org/t/there-are-deviations-between-generated-drr-image-and-corresponding-epid-image/5522)

<div class="topic-metadata">

**Author:** [@suzume](https://discourse.itk.org/u/suzume)\
**Replies:** 5\
**Last updated:** [November 25, 2022, 2:42pm UTC](https://discourse.itk.org/t/there-are-deviations-between-generated-drr-image-and-corresponding-epid-image/5522 "2022-11-25T14:42:02Z")

</div>

I want to generate the DRR image from the CT and register it with the corresponding EPID image. However, there are always deviations between the generated DRR image and its corresponding EPID image. The EPID is obtained …

---

## [GetDRRSiddonJacobsRayTracing](https://discourse.itk.org/t/getdrrsiddonjacobsraytracing/5512)

<div class="topic-metadata">

**Author:** [@YuanYang\_Deng](https://discourse.itk.org/u/YuanYang_Deng)\
**Replies:** 3\
**Last updated:** [November 22, 2022, 12:23am UTC](https://discourse.itk.org/t/getdrrsiddonjacobsraytracing/5512 "2022-11-22T00:23:34Z")

</div>

I want to convert 3D CT images into X-ray images using DRR technology. But I don’t know how to use and run this algorithm. Did anyone run it successfully? Can you talk about how you work? https://github.com/InsightSoftw…

---

## [Gantry rotation when generate DRR](https://discourse.itk.org/t/gantry-rotation-when-generate-drr/5500)

<div class="topic-metadata">

**Author:** [@suzume](https://discourse.itk.org/u/suzume)\
**Replies:** 4\
**Last updated:** [November 21, 2022, 6:12pm UTC](https://discourse.itk.org/t/gantry-rotation-when-generate-drr/5500 "2022-11-21T18:12:34Z")

</div>

I want to rotate the gantry and couch when generating the DRR image. An Euler transformation is used to rotate the input volume to simulate the couch rotation. What else can I use to rotate the gantry? Can I use Euler tr…

---

## [Remove Noisy Objects](https://discourse.itk.org/t/remove-noisy-objects/5492)

<div class="topic-metadata">

**Author:** [@cristinamontserrat](https://discourse.itk.org/u/cristinamontserrat)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 3:12pm UTC](https://discourse.itk.org/t/remove-noisy-objects/5492 "2022-11-16T15:12:28Z")

</div>

Hi! I am trying to remove labels from Label Map, which belong to noisy objects. For doing that, I have created the following code: ITKImgLabelType2D::Pointer RemoveNoisyObjects( const ITKImgLabelType2D::Pointer& imgIn,…

---

## [How can I apply a 2D mask in a 3D image? - SliceBySliceImageFilter](https://discourse.itk.org/t/how-can-i-apply-a-2d-mask-in-a-3d-image-slicebysliceimagefilter/5418)

<div class="topic-metadata">

**Author:** [@cristinamontserrat](https://discourse.itk.org/u/cristinamontserrat)\
**Replies:** 11\
**Last updated:** [November 7, 2022, 8:56am UTC](https://discourse.itk.org/t/how-can-i-apply-a-2d-mask-in-a-3d-image-slicebysliceimagefilter/5418 "2022-11-07T08:56:24Z")

</div>

Hi! I am trying to mask a 3D image with a 2D mask with the itkSliceBySliceImageFilter. Here is my code: // We create the filter mask using MaskFilterType = itk::MaskImageFilter\<ITKImgLabelType2D, ITKImgLabelType2D, I…

---

## [measure lesion size](https://discourse.itk.org/t/measure-lesion-size/5469)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura1](https://discourse.itk.org/u/Jakub_Mitura1)\
**Replies:** 2\
**Last updated:** [November 6, 2022, 6:11am UTC](https://discourse.itk.org/t/measure-lesion-size/5469 "2022-11-06T06:11:04Z")

</div>

Hello I have a lesion in the 3d boolean array - 1 is presence 0 is absence - I would like to get the size of it in 3 axes - main longest axis and the other 2. Problem is that the long axis of the lesion generally do not…

---

## [Label Shape Opening Slice by Slice not working very welll](https://discourse.itk.org/t/label-shape-opening-slice-by-slice-not-working-very-welll/5454)

<div class="topic-metadata">

**Author:** [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Replies:** 0\
**Last updated:** [October 27, 2022, 8:12pm UTC](https://discourse.itk.org/t/label-shape-opening-slice-by-slice-not-working-very-welll/5454 "2022-10-27T20:12:56Z")

</div>

Can’t apply shape open slice by slice. I get a null image, even though most of the connected components have less than 1000 pixels… for(int slice\_to\_process = 0; slice\_to\_process \< final\_slice\_ribs ; slice\_to\_process++)…

---

## [Rotated an Image but can't get an object count](https://discourse.itk.org/t/rotated-an-image-but-cant-get-an-object-count/5453)

<div class="topic-metadata">

**Author:** [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 6:57pm UTC](https://discourse.itk.org/t/rotated-an-image-but-cant-get-an-object-count/5453 "2022-10-27T18:57:25Z")

</div>

I rotated an image with euler3d transform and resampler and it works fine. But then I ask to get an object count and get 0 objects which is not true based on the saved image. using ResampleFilterType\_2 = itk::ResampleIm…

---

## [DICOM Enhanced CT with GDCM\_IO](https://discourse.itk.org/t/dicom-enhanced-ct-with-gdcm-io/5402)

<div class="topic-metadata">

**Author:** [@rfrank](https://discourse.itk.org/u/rfrank)\
**Replies:** 7\
**Last updated:** [October 21, 2022, 3:48pm UTC](https://discourse.itk.org/t/dicom-enhanced-ct-with-gdcm-io/5402 "2022-10-21T15:48:40Z")

</div>

Hi I’m working on an existing code base that uses ITK/Gdcm ITK 4.12 I have a Toshiba ct multi frame. ITK is returning direction cosines 1 0 0 0 1 0 0 0 -1 And I need to swap the z axis and reset the direction cosine…

---

## [How accelerate many times affinetransform, fft and ifft process?](https://discourse.itk.org/t/how-accelerate-many-times-affinetransform-fft-and-ifft-process/5425)

<div class="topic-metadata">

**Author:** [@ydl](https://discourse.itk.org/u/ydl)\
**Replies:** 3\
**Last updated:** [October 19, 2022, 2:22pm UTC](https://discourse.itk.org/t/how-accelerate-many-times-affinetransform-fft-and-ifft-process/5425 "2022-10-19T14:22:08Z")

</div>

I have many mri(ixi-t2 dataset with.nii.gz format), for each image, what I now do is, create n copies of this image(n is select from(30, 150), for each copy, do random affinetransform, then fft to k-space, for this n k-s…

---

## [Euler3DTransform class and Transforms class](https://discourse.itk.org/t/euler3dtransform-class-and-transforms-class/5332)

<div class="topic-metadata">

**Author:** [@natwille1](https://discourse.itk.org/u/natwille1)\
**Replies:** 6\
**Last updated:** [October 19, 2022, 1:21pm UTC](https://discourse.itk.org/t/euler3dtransform-class-and-transforms-class/5332 "2022-10-19T13:21:00Z")

</div>

I executed a ImageRegistrationMethod function call, and set the initial transform according to: initial\_transform = sitk.CenteredTransformInitializer( fixed\_image, moving\_image, sitk.Euler3DTransform(), …

---

## [Registration: at image border + noisy images](https://discourse.itk.org/t/registration-at-image-border-noisy-images/5419)

<div class="topic-metadata">

**Author:** [@dyoll](https://discourse.itk.org/u/dyoll)\
**Replies:** 5\
**Last updated:** [October 18, 2022, 7:40pm UTC](https://discourse.itk.org/t/registration-at-image-border-noisy-images/5419 "2022-10-18T19:40:09Z")

</div>

I am trying to register a vertebrae atlas to a dataset of T1 images. Using a jupyter notebook GUI we have created relatively good initial transforms to align the template masks to the dataset. I was hoping to be able to…

---

## [Why should a Composite Filter disconnect its input?](https://discourse.itk.org/t/why-should-a-composite-filter-disconnect-its-input/5410)

<div class="topic-metadata">

**Author:** [@SteveRobbins](https://discourse.itk.org/u/SteveRobbins)\
**Replies:** 3\
**Last updated:** [October 14, 2022, 8:55pm UTC](https://discourse.itk.org/t/why-should-a-composite-filter-disconnect-its-input/5410 "2022-10-14T20:55:04Z")

</div>

Hello, Working in C++ ITK 5.2.1, I have been writing a few filter classes, following the guidance of Chapter 8 (“How To Write A Composite Filter”) of the ITK guide book. I think I have a reasonable grasp of the materia…

---

## [3D ellipse hough transform](https://discourse.itk.org/t/3d-ellipse-hough-transform/2861)

<div class="topic-metadata">

**Author:** [@basal](https://discourse.itk.org/u/basal)\
**Replies:** 1\
**Last updated:** [October 12, 2022, 10:36am UTC](https://discourse.itk.org/t/3d-ellipse-hough-transform/2861 "2022-10-12T10:36:06Z")

</div>

Hi all, I want to extend 2D hough transform to 3D and also use ellipse function instead of circles in ITK based on c++ to detect ellipse shapes in my image. I changed some lines of the 2D Hough transform code for ellipse…

---

## [Segmentation to text file](https://discourse.itk.org/t/segmentation-to-text-file/5377)

<div class="topic-metadata">

**Author:** [@Sean\_Hatton](https://discourse.itk.org/u/Sean_Hatton)\
**Replies:** 1\
**Last updated:** [September 29, 2022, 7:02pm UTC](https://discourse.itk.org/t/segmentation-to-text-file/5377 "2022-09-29T19:02:42Z")

</div>

Hi all, I would like to export my segmentations to a text file (i.e. list of contour pixels) to create IMOD model files (with point2model). Two questions: I expect I would push the segmentation through the LabelContou…

---

## [Difference between RANDOM, REGULAR and NONE sampling](https://discourse.itk.org/t/difference-between-random-regular-and-none-sampling/5365)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 3\
**Last updated:** [September 27, 2022, 6:57pm UTC](https://discourse.itk.org/t/difference-between-random-regular-and-none-sampling/5365 "2022-09-27T18:57:06Z")

</div>

I have run the same registration code snippet, with the same data and same sampling strategy, multiple times. I get different result each time. With RANDOM sampling, this is understandable, but why should REGULAR and NON…

---

## [Advice on on-line processing of time series](https://discourse.itk.org/t/advice-on-on-line-processing-of-time-series/5330)

<div class="topic-metadata">

**Author:** [@SteveRobbins](https://discourse.itk.org/u/SteveRobbins)\
**Replies:** 8\
**Last updated:** [September 26, 2022, 7:36pm UTC](https://discourse.itk.org/t/advice-on-on-line-processing-of-time-series/5330 "2022-09-26T19:36:21Z")

</div>

I’m writing code that accepts a time series of 3D images and want to process it on-line; i.e. as they come in. I’m not seeing this topic discussed so maybe it’s too esoteric or maybe I haven’t found the right keywords. …

---

## [GPUDemon running puzzles.](https://discourse.itk.org/t/gpudemon-running-puzzles/5353)

<div class="topic-metadata">

**Author:** [@Hongying\_Feng](https://discourse.itk.org/u/Hongying_Feng)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 7:49am UTC](https://discourse.itk.org/t/gpudemon-running-puzzles/5353 "2022-09-22T07:49:00Z")

</div>

Hi, I am trying to use the GPUDemonRegistrationFilter to speed up the Registration. Here is how I implement it. First, I used the following iteration observer. class CommandIterationUpdate : public itk::Command { pu…

---

## [3D Affine:Rotate on two different axes one after the other](https://discourse.itk.org/t/3d-affine-rotate-on-two-different-axes-one-after-the-other/5315)

<div class="topic-metadata">

**Author:** [@wic94016](https://discourse.itk.org/u/wic94016)\
**Replies:** 7\
**Last updated:** [September 21, 2022, 12:11pm UTC](https://discourse.itk.org/t/3d-affine-rotate-on-two-different-axes-one-after-the-other/5315 "2022-09-21T12:11:09Z")

</div>

Hey guys,I have a serious question about my python code. What I want to do is ,if I have a 3D array like this and I want it to be 90 degrees around the -X axis first,then 10 degrees around the y axis. But it seems t…

---

## [Can we use k-d Tree Based k-Means Clustering in a 3D vector?](https://discourse.itk.org/t/can-we-use-k-d-tree-based-k-means-clustering-in-a-3d-vector/5339)

<div class="topic-metadata">

**Author:** [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Replies:** 0\
**Last updated:** [September 16, 2022, 9:28pm UTC](https://discourse.itk.org/t/can-we-use-k-d-tree-based-k-means-clustering-in-a-3d-vector/5339 "2022-09-16T21:28:12Z")

</div>

I am segmenting the spinal canal in CT images and I need to classify the spinal canal pixels positions in groups. ( “Automatic Segmentation of the Body and the Spinal Canal in CT Images Based on A Priori Information”). …

---

## [Anonymize / De-identify dicom datasets](https://discourse.itk.org/t/anonymize-de-identify-dicom-datasets/2316)

<div class="topic-metadata">

**Author:** [@Jigabytes](https://discourse.itk.org/u/Jigabytes)\
**Replies:** 6\
**Last updated:** [September 12, 2022, 7:40am UTC](https://discourse.itk.org/t/anonymize-de-identify-dicom-datasets/2316 "2022-09-12T07:40:50Z")

</div>

Hi All, I would like to use de-identified medical dicom datasets for my segmentation process. Any recommendations in this space? Are there standard library available for achieving it? Thanks, Jiten

---

## [LabelMapToLabelImageFilter\`s output is an image with white color](https://discourse.itk.org/t/labelmaptolabelimagefilter-s-output-is-an-image-with-white-color/5316)

<div class="topic-metadata">

**Author:** [@Bugmaker](https://discourse.itk.org/u/Bugmaker)\
**Replies:** 1\
**Last updated:** [September 7, 2022, 7:01am UTC](https://discourse.itk.org/t/labelmaptolabelimagefilter-s-output-is-an-image-with-white-color/5316 "2022-09-07T07:01:01Z")

</div>

I want to use the ConnectedComponentImageFilter to delete the false positive area, and pass the result through other filters (LabelImageToShapeLabelMapFilter,LabelMap,LabelMapToLabelImageFilter namely) to convert into im…

---

## [Simple ITK TransformVector Returning Error](https://discourse.itk.org/t/simple-itk-transformvector-returning-error/5306)

<div class="topic-metadata">

**Author:** [@natwille1](https://discourse.itk.org/u/natwille1)\
**Replies:** 2\
**Last updated:** [August 29, 2022, 7:35pm UTC](https://discourse.itk.org/t/simple-itk-transformvector-returning-error/5306 "2022-08-29T19:35:38Z")

</div>

Hi, I am trying to apply a 3D euler transform to a vector at a particular point: basis = np.array(\[\[1.0, 0.0, 0.0\], \[0.0, 1.0, 0.0\], \[0.0, 0.0, 1.0\]\]) origin = np.array(\[0.0, 0.0, 0.0\]).reshape(-1, 3) out = transform.Tr…

---

## [Blob Detection](https://discourse.itk.org/t/blob-detection/5299)

<div class="topic-metadata">

**Author:** [@Mahdiye\_Imanpanah](https://discourse.itk.org/u/Mahdiye_Imanpanah)\
**Replies:** 1\
**Last updated:** [August 29, 2022, 12:46pm UTC](https://discourse.itk.org/t/blob-detection/5299 "2022-08-29T12:46:45Z")

</div>

Hi everybody I want to develop a method to detect shapes in the images(for example blobs). I’ve found Hough-Transform to reach this goal, but I can’t find it in SimpleItk. Does SimpleItk support Hough-Transform? If i…

---

## [Ordering of 4D DICOM images while writing](https://discourse.itk.org/t/ordering-of-4d-dicom-images-while-writing/5277)

<div class="topic-metadata">

**Author:** [@Keyn34](https://discourse.itk.org/u/Keyn34)\
**Replies:** 5\
**Last updated:** [August 19, 2022, 11:31am UTC](https://discourse.itk.org/t/ordering-of-4d-dicom-images-while-writing/5277 "2022-08-19T11:31:07Z")

</div>

Hello everyone! I am currently trying to write a 4D series of DICOM images (with Python and SimpleITK). Can anyone tell me which tag identifies the location of a volume in the fourth/time dimension (if there even is one…

---

## [How to perform change of basis from a non-orthogonal 3D array to an orthogonal 3D array ?](https://discourse.itk.org/t/how-to-perform-change-of-basis-from-a-non-orthogonal-3d-array-to-an-orthogonal-3d-array/5266)

<div class="topic-metadata">

**Author:** [@pranoy-ray](https://discourse.itk.org/u/pranoy-ray)\
**Replies:** 6\
**Last updated:** [August 17, 2022, 8:07pm UTC](https://discourse.itk.org/t/how-to-perform-change-of-basis-from-a-non-orthogonal-3d-array-to-an-orthogonal-3d-array/5266 "2022-08-17T20:07:15Z")

</div>

I am trying to understand how to code the resampling of the voxels from a non-orthogonal basis as shown in the image below (taken from SimpleITK’s homepage) to an orthogonal grid. My input is say a 3D grayscale image…

---

## [domain issues with bspline and inverse bspline](https://discourse.itk.org/t/domain-issues-with-bspline-and-inverse-bspline/5253)

<div class="topic-metadata">

**Author:** [@Ilay\_Kamai](https://discourse.itk.org/u/Ilay_Kamai)\
**Replies:** 5\
**Last updated:** [August 15, 2022, 2:10pm UTC](https://discourse.itk.org/t/domain-issues-with-bspline-and-inverse-bspline/5253 "2022-08-15T14:10:20Z")

</div>

Hi, I have the following issue - I’m registering two images with different physical domains using bspline. afterwards, im transforming some points from images. since the points needs to be at the same frame of reference…

---

## [transform point with inverse bspline](https://discourse.itk.org/t/transform-point-with-inverse-bspline/5248)

<div class="topic-metadata">

**Author:** [@Ilay\_Kamai](https://discourse.itk.org/u/Ilay_Kamai)\
**Replies:** 2\
**Last updated:** [August 9, 2022, 8:00am UTC](https://discourse.itk.org/t/transform-point-with-inverse-bspline/5248 "2022-08-09T08:00:18Z")

</div>

Hi, i’m trying to transform 3D points using inverse displacement field of Bspline transformation. after calculating the transformation i’m creating the inverse as suggested here : Inverse of BSpline transform this is …

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

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