# Algorithms

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

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

**Page:** 14

---

## [Hough Transform 2D Circles Image Filter GetCircles patch.](https://discourse.itk.org/t/hough-transform-2d-circles-image-filter-getcircles-patch/350)

<div class="topic-metadata">

**Author:** [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)\
**Replies:** 86\
**Last updated:** [March 21, 2020, 1:40am UTC](https://discourse.itk.org/t/hough-transform-2d-circles-image-filter-getcircles-patch/350 "2020-03-21T01:40:03Z")

</div>

I’m currently trying out itk::HoughTransform2DCirclesImageFilter::GetCircles(n), and while I get quite promising results, there still appears room for improvement of the code. Here’s my first patch for this function: "…

---

## [How to create an atlas based on PET image](https://discourse.itk.org/t/how-to-create-an-atlas-based-on-pet-image/2853)

<div class="topic-metadata">

**Author:** [@drcjaudet](https://discourse.itk.org/u/drcjaudet)\
**Replies:** 0\
**Last updated:** [March 19, 2020, 12:47pm UTC](https://discourse.itk.org/t/how-to-create-an-atlas-based-on-pet-image/2853 "2020-03-19T12:47:05Z")

</div>

Hello TTK community, Here a little bit of a technical question. The goal is to create an atlas image based on several whole body PET image (starting from 100 ot finally 10000) in an efficient way. Now i register the i…

---

## [GraphCutSegmentation in SimpleITK](https://discourse.itk.org/t/graphcutsegmentation-in-simpleitk/2844)

<div class="topic-metadata">

**Author:** [@flaviu2](https://discourse.itk.org/u/flaviu2)\
**Replies:** 0\
**Last updated:** [March 17, 2020, 7:31pm UTC](https://discourse.itk.org/t/graphcutsegmentation-in-simpleitk/2844 "2020-03-17T19:31:58Z")

</div>

Hello everyone. Is there any graph cut segmentation implemented into SimpleITK library ? As far as understood, is very suitable for bone segmentation, and because I didn’t found until now any suitable solution in SimpleI…

---

## [ImageSeries Reader reads dicom series in reverse order by default?](https://discourse.itk.org/t/imageseries-reader-reads-dicom-series-in-reverse-order-by-default/2491)

<div class="topic-metadata">

**Author:** [@Jigabytes](https://discourse.itk.org/u/Jigabytes)\
**Replies:** 12\
**Last updated:** [March 17, 2020, 3:43pm UTC](https://discourse.itk.org/t/imageseries-reader-reads-dicom-series-in-reverse-order-by-default/2491 "2020-03-17T15:43:18Z")

</div>

Hi I am trying to read CT scan dicom series using Simple ITK ImageSeriesReader() In order verify each image slice I also load the CT scan in osirix image viewer. After reading from series reader when I load sample slic…

---

## [Extract image using threshold](https://discourse.itk.org/t/extract-image-using-threshold/2757)

<div class="topic-metadata">

**Author:** [@osemmler](https://discourse.itk.org/u/osemmler)\
**Replies:** 10\
**Last updated:** [March 10, 2020, 8:45pm UTC](https://discourse.itk.org/t/extract-image-using-threshold/2757 "2020-03-10T20:45:25Z")

</div>

Hello, can you advise me the most efficient combination of filters to extract region of image based on threshold value? (ie reduce the image by margins that are below the defined threshold value)

---

## [Rotating a mapper with euler transform.](https://discourse.itk.org/t/rotating-a-mapper-with-euler-transform/2809)

<div class="topic-metadata">

**Author:** [@Jose\_Alejandro\_Garni](https://discourse.itk.org/u/Jose_Alejandro_Garni)\
**Replies:** 3\
**Last updated:** [March 10, 2020, 7:45pm UTC](https://discourse.itk.org/t/rotating-a-mapper-with-euler-transform/2809 "2020-03-10T19:45:04Z")

</div>

Hi guys! im trying to apply euler 3d transformation matrix, to a mapper (a segmentation archive) that i have in dicom format. but when i apply the resampling filter, it seems to smootj the image instead of rotating it… …

---

## [FFT mismatch ITK/matlab](https://discourse.itk.org/t/fft-mismatch-itk-matlab/2776)

<div class="topic-metadata">

**Author:** [@Jonas](https://discourse.itk.org/u/Jonas)\
**Replies:** 11\
**Last updated:** [March 6, 2020, 4:53pm UTC](https://discourse.itk.org/t/fft-mismatch-itk-matlab/2776 "2020-03-06T16:53:28Z")

</div>

Hi, I would like to know how to match the FFT implementation of matlab fftn function using ITK. I tried both itkForwardFFTImageFilter alone and the PadIlmageFilter + ForwardFFTImageFilter. taken from https://itk.org/…

---

## [How to extract a volume around a voxel in a 3D image?](https://discourse.itk.org/t/how-to-extract-a-volume-around-a-voxel-in-a-3d-image/2768)

<div class="topic-metadata">

**Author:** [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Replies:** 15\
**Last updated:** [March 4, 2020, 11:07am UTC](https://discourse.itk.org/t/how-to-extract-a-volume-around-a-voxel-in-a-3d-image/2768 "2020-03-04T11:07:09Z")

</div>

Suppose I have a 3D image of 250\*250\*250 size. I want to extract a volume of 25\*25\*25 around a particular voxel that could be defined by me. Is there any example that I could look into ??

---

## [Container iterators](https://discourse.itk.org/t/container-iterators/2774)

<div class="topic-metadata">

**Author:** [@Gordian](https://discourse.itk.org/u/Gordian)\
**Replies:** 7\
**Last updated:** [March 4, 2020, 12:35am UTC](https://discourse.itk.org/t/container-iterators/2774 "2020-03-04T00:35:45Z")

</div>

Hello, i would like to know if there is an container iterator that provide the functionality I need for the C++17 features like std::reduce() with an parallel execution policy. This might improve the performance of some…

---

## [accessing pixel value of a point](https://discourse.itk.org/t/accessing-pixel-value-of-a-point/2765)

<div class="topic-metadata">

**Author:** [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Replies:** 1\
**Last updated:** [February 26, 2020, 2:09pm UTC](https://discourse.itk.org/t/accessing-pixel-value-of-a-point/2765 "2020-02-26T14:09:08Z")

</div>

I transformed the image from the index to the physical point. Now I want to apply a certain condition to the pointset and set the corresponding pixel value to a new value. I know that we can access or set pixel value t…

---

## [Calculate volume of largest and minimum ellipse around a segmentation](https://discourse.itk.org/t/calculate-volume-of-largest-and-minimum-ellipse-around-a-segmentation/2667)

<div class="topic-metadata">

**Author:** [@ral\_san](https://discourse.itk.org/u/ral_san)\
**Replies:** 6\
**Last updated:** [February 14, 2020, 2:56pm UTC](https://discourse.itk.org/t/calculate-volume-of-largest-and-minimum-ellipse-around-a-segmentation/2667 "2020-02-14T14:56:00Z")

</div>

Is there any function in SimpleITK similar to the OpenCV function FitEllipse --\> https://docs.opencv.org/3.4.9/de/d62/tutorial\_bounding\_rotated\_ellipses.html ? What I am trying to do is to calculate the volume of the la…

---

## [How to check disconnected vertices in a triangular mesh](https://discourse.itk.org/t/how-to-check-disconnected-vertices-in-a-triangular-mesh/2710)

<div class="topic-metadata">

**Author:** [@srbn.ghosh89](https://discourse.itk.org/u/srbn.ghosh89)\
**Replies:** 6\
**Last updated:** [February 13, 2020, 11:03pm UTC](https://discourse.itk.org/t/how-to-check-disconnected-vertices-in-a-triangular-mesh/2710 "2020-02-13T23:03:13Z")

</div>

Hello Everyone, I have a triangular mesh that has 1038458 polygons, 517817 points, 1557687 edges. During the simplification process, I am getting the message that there are 1092 disconnected vertices, 516725 connected v…

---

## [itkPointSetToPointSetMetricv4 and EuclideanDistancePointSetToPointSetMetricv4 Help](https://discourse.itk.org/t/itkpointsettopointsetmetricv4-and-euclideandistancepointsettopointsetmetricv4-help/2712)

<div class="topic-metadata">

**Author:** [@ShaneKirkbride](https://discourse.itk.org/u/ShaneKirkbride)\
**Replies:** 1\
**Last updated:** [February 12, 2020, 7:12pm UTC](https://discourse.itk.org/t/itkpointsettopointsetmetricv4-and-euclideandistancepointsettopointsetmetricv4-help/2712 "2020-02-12T19:12:23Z")

</div>

I’m trying to set up a metric for the EuclideanDistancePointSetToPointSetMetricv4 class using MetricType = EuclideanDistancePointSetToPointSetMetricv4\<FixedPointSetType, MovingPointSetType\>; MetricType::Pointer metr…

---

## [Apply 3D mask to 4D image - itkSliceBySliceImageFilter](https://discourse.itk.org/t/apply-3d-mask-to-4d-image-itkslicebysliceimagefilter/2694)

<div class="topic-metadata">

**Author:** [@javierjuan](https://discourse.itk.org/u/javierjuan)\
**Replies:** 1\
**Last updated:** [February 10, 2020, 3:35pm UTC](https://discourse.itk.org/t/apply-3d-mask-to-4d-image-itkslicebysliceimagefilter/2694 "2020-02-10T15:35:14Z")

</div>

Hello, I am trying to mask a 4D image with a 3D mask with the itkSliceBySliceImageFilter. My piece of code is: using SliceBySliceImageFilterType = itk::SliceBySliceImageFilter\<ImageType, ImageType\>; typename SliceBySli…

---

## [how to draw shapes in a dicom with simpleITK ?](https://discourse.itk.org/t/how-to-draw-shapes-in-a-dicom-with-simpleitk/2654)

<div class="topic-metadata">

**Author:** [@javi12](https://discourse.itk.org/u/javi12)\
**Replies:** 4\
**Last updated:** [January 28, 2020, 6:19pm UTC](https://discourse.itk.org/t/how-to-draw-shapes-in-a-dicom-with-simpleitk/2654 "2020-01-28T18:19:27Z")

</div>

I need to create custom labels to draw shapes in a dicom.

---

## [MultiMetric returns only value of first component metric](https://discourse.itk.org/t/multimetric-returns-only-value-of-first-component-metric/2646)

<div class="topic-metadata">

**Author:** [@Martin\_Kavec](https://discourse.itk.org/u/Martin_Kavec)\
**Replies:** 0\
**Last updated:** [January 22, 2020, 4:50pm UTC](https://discourse.itk.org/t/multimetric-returns-only-value-of-first-component-metric/2646 "2020-01-22T16:50:36Z")

</div>

Hi, I am setting up a registration using ObjectToObjectMultiMetricv4. I add two component metrices of the same type (m1 and m2), set equal weights (0.5) for each of them, and add two different datasets d1 and d2. In th…

---

## [Code to access specific voxels](https://discourse.itk.org/t/code-to-access-specific-voxels/2639)

<div class="topic-metadata">

**Author:** [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Replies:** 1\
**Last updated:** [January 20, 2020, 2:49pm UTC](https://discourse.itk.org/t/code-to-access-specific-voxels/2639 "2020-01-20T14:49:47Z")

</div>

I have a 3D image and a sphere equation. I need to take out all the voxels that are outside the circle and want to apply a transformation to them. How do I differentiate those points from all the points? I’m not understa…

---

## [Problem in the calculation of the inverse of the BSpline using Simple ITK](https://discourse.itk.org/t/problem-in-the-calculation-of-the-inverse-of-the-bspline-using-simple-itk/2624)

<div class="topic-metadata">

**Author:** [@Everaldo](https://discourse.itk.org/u/Everaldo)\
**Replies:** 1\
**Last updated:** [January 15, 2020, 4:17pm UTC](https://discourse.itk.org/t/problem-in-the-calculation-of-the-inverse-of-the-bspline-using-simple-itk/2624 "2020-01-15T16:17:39Z")

</div>

I’m trying to calculate the inverse transformation of a BSpline Transformation and I’m following the instructions of this link here in the Discourse. Here is the code I’m using: #Calculating the inverse of the Bspline d…

---

## [Registration Ct and MRI with multiresolution](https://discourse.itk.org/t/registration-ct-and-mri-with-multiresolution/2585)

<div class="topic-metadata">

**Author:** [@drcjaudet](https://discourse.itk.org/u/drcjaudet)\
**Replies:** 7\
**Last updated:** [January 14, 2020, 10:38pm UTC](https://discourse.itk.org/t/registration-ct-and-mri-with-multiresolution/2585 "2020-01-14T22:38:10Z")

</div>

Hello itk community, My goals is to create a code in simple itk to perform quality contrôle of geometri distortion on MRI. The key for following the evolution of the system performances is to register every new MRI wit…

---

## [Transform a point index into its respective one after registration](https://discourse.itk.org/t/transform-a-point-index-into-its-respective-one-after-registration/2605)

<div class="topic-metadata">

**Author:** [@Everaldo](https://discourse.itk.org/u/Everaldo)\
**Replies:** 6\
**Last updated:** [January 13, 2020, 4:58pm UTC](https://discourse.itk.org/t/transform-a-point-index-into-its-respective-one-after-registration/2605 "2020-01-13T16:58:22Z")

</div>

I did a registration in two steps, Affine -\> B-Spline, and now I want to know what is the correspondent index in the new space for a given index in the original space. Here is the code I’m using: #Receiving the voxel co…

---

## [implement of Simpson’s biplane method to calculate volume](https://discourse.itk.org/t/implement-of-simpson-s-biplane-method-to-calculate-volume/2601)

<div class="topic-metadata">

**Author:** [@hubutui](https://discourse.itk.org/u/hubutui)\
**Replies:** 0\
**Last updated:** [January 10, 2020, 2:52pm UTC](https://discourse.itk.org/t/implement-of-simpson-s-biplane-method-to-calculate-volume/2601 "2020-01-10T14:52:26Z")

</div>

Hello, I’m trying to calculate left ventricle volume at end-diastole and end-systole. After googling, I fould this article describe the method for detail. However, I still have some issue to implement it. According to eq…

---

## [How to apply a 3D B-Spline Transformation in a Point?](https://discourse.itk.org/t/how-to-apply-a-3d-b-spline-transformation-in-a-point/2596)

<div class="topic-metadata">

**Author:** [@Felippe\_Trigueiro\_An](https://discourse.itk.org/u/Felippe_Trigueiro_An)\
**Replies:** 1\
**Last updated:** [January 10, 2020, 2:15pm UTC](https://discourse.itk.org/t/how-to-apply-a-3d-b-spline-transformation-in-a-point/2596 "2020-01-10T14:15:05Z")

</div>

Hi, after a 3D registration process using the B-Spline transformation I got a .tfm file containing the transformation parameters. My problem is: How to apply this transformation in just one point using Python? Thanks.

---

## [3D cross correlation considering the neighborhood pixels](https://discourse.itk.org/t/3d-cross-correlation-considering-the-neighborhood-pixels/2584)

<div class="topic-metadata">

**Author:** [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Replies:** 0\
**Last updated:** [January 6, 2020, 9:58am UTC](https://discourse.itk.org/t/3d-cross-correlation-considering-the-neighborhood-pixels/2584 "2020-01-06T09:58:22Z")

</div>

I want to correlate two 3D images considering the neighborhood pixels. I couldn’t find any example based on it. Can i use ANTScrosscorrelation metric to do so? Is there any example related to this?

---

## [KdTree Example](https://discourse.itk.org/t/kdtree-example/2567)

<div class="topic-metadata">

**Author:** [@fraca](https://discourse.itk.org/u/fraca)\
**Replies:** 2\
**Last updated:** [December 23, 2019, 4:10pm UTC](https://discourse.itk.org/t/kdtree-example/2567 "2019-12-23T16:10:16Z")

</div>

I’m trying to run this example but i have some issues with an error right here. Can you help me? The error is related to the push\_back int index = 0; for (unsigned int i = 0; i \< 2; i++) { MembershipFunctionType::P…

---

## [Filters equivalent to ConfidenceConnected Filter](https://discourse.itk.org/t/filters-equivalent-to-confidenceconnected-filter/2515)

<div class="topic-metadata">

**Author:** [@Jigabytes](https://discourse.itk.org/u/Jigabytes)\
**Replies:** 7\
**Last updated:** [December 22, 2019, 4:22am UTC](https://discourse.itk.org/t/filters-equivalent-to-confidenceconnected-filter/2515 "2019-12-22T04:22:32Z")

</div>

Hi All, I am working to detect my target in CT scan using simple ITK and python. I am forming list of seeds and passing it to confidence connected filter but what I observed is there are cases when as soon as I add one i…

---

## [SetMembershipFunctions](https://discourse.itk.org/t/setmembershipfunctions/2556)

<div class="topic-metadata">

**Author:** [@fraca](https://discourse.itk.org/u/fraca)\
**Replies:** 0\
**Last updated:** [December 20, 2019, 9:10am UTC](https://discourse.itk.org/t/setmembershipfunctions/2556 "2019-12-20T09:10:01Z")

</div>

I’m trying to use this function but i have some issues because i don’t know how to convert my array for this function. Can you help me? std::vector \< unsigned int \> classLabels; classLabels.resize(numberOfClasses); …

---

## [Brain mask for human brain registration](https://discourse.itk.org/t/brain-mask-for-human-brain-registration/2534)

<div class="topic-metadata">

**Author:** [@fangc](https://discourse.itk.org/u/fangc)\
**Replies:** 3\
**Last updated:** [December 19, 2019, 8:46pm UTC](https://discourse.itk.org/t/brain-mask-for-human-brain-registration/2534 "2019-12-19T20:46:06Z")

</div>

Hello, I am currently working on a project of within subject registration of T1 and T2 images on human brains, and I want to add a brain mask to the registration. Does ITK have a class for automated brain extraction? An…

---

## [Simplex Mesh Deformable Model doesn't change](https://discourse.itk.org/t/simplex-mesh-deformable-model-doesnt-change/386)

<div class="topic-metadata">

**Author:** [@breno](https://discourse.itk.org/u/breno)\
**Replies:** 10\
**Last updated:** [December 15, 2019, 4:55pm UTC](https://discourse.itk.org/t/simplex-mesh-deformable-model-doesnt-change/386 "2019-12-15T16:55:09Z")

</div>

Dear itk-developers, I’m trying to use the itkDeformableSimplexMesh3D filter to make a local adjustment of a simplex mesh. The mesh that I want to deform using this filter is already initialized close to the target stru…

---

## [Check if a 2D ROI bounding box is within another 2D ROI bounding box dimensions](https://discourse.itk.org/t/check-if-a-2d-roi-bounding-box-is-within-another-2d-roi-bounding-box-dimensions/2457)

<div class="topic-metadata">

**Author:** [@Jigabytes](https://discourse.itk.org/u/Jigabytes)\
**Replies:** 10\
**Last updated:** [December 9, 2019, 4:59am UTC](https://discourse.itk.org/t/check-if-a-2d-roi-bounding-box-is-within-another-2d-roi-bounding-box-dimensions/2457 "2019-12-09T04:59:06Z")

</div>

Hi All, I have a use case where I need to check if ROI A’s 2D bounding box falls within ROI B’s 2D bounding box dimensions. Since each 2D bounding box dimensions are in format (startx, starty, x size, ysize) is there dir…

---

## [Floodfill Python ITK](https://discourse.itk.org/t/floodfill-python-itk/2453)

<div class="topic-metadata">

**Author:** [@fraca](https://discourse.itk.org/u/fraca)\
**Replies:** 9\
**Last updated:** [December 6, 2019, 3:27pm UTC](https://discourse.itk.org/t/floodfill-python-itk/2453 "2019-12-06T15:27:05Z")

</div>

There’s a function in python to floodfill an image that has been previously segmented?

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

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