# Algorithms

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

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

**Page:** 16

---

## [Multiply vector with scalar value](https://discourse.itk.org/t/multiply-vector-with-scalar-value/2259)

<div class="topic-metadata">

**Author:** [@Gordian](https://discourse.itk.org/u/Gordian)\
**Replies:** 2\
**Last updated:** [September 24, 2019, 2:32pm UTC](https://discourse.itk.org/t/multiply-vector-with-scalar-value/2259 "2019-09-24T14:32:23Z")

</div>

Hello, i want to multiply either a vector with a single scalar (s \* {v\_0,...,v\_n} = {s \* v\_0,...,s \* v\_n}) or a elementwise multiplication of two vectors ({w\_0,...,w\_n} \* {v\_0,...,v\_n} = {w\_0 \* v\_0,..., w\_n \* v\_n}). Th…

---

## [OrientImageFilter changes the origin of the image](https://discourse.itk.org/t/orientimagefilter-changes-the-origin-of-the-image/2200)

<div class="topic-metadata">

**Author:** [@sarthakpati](https://discourse.itk.org/u/sarthakpati)\
**Replies:** 24\
**Last updated:** [September 5, 2019, 9:36pm UTC](https://discourse.itk.org/t/orientimagefilter-changes-the-origin-of-the-image/2200 "2019-09-05T21:36:36Z")

</div>

Hi, I am trying to change the orientation of an image using the OrientImageFilter but I am running into a very weird issue. Once I convert the original image to RAI and then convert it back to it’s original orientation …

---

## [Composite Transform Serialization](https://discourse.itk.org/t/composite-transform-serialization/2215)

<div class="topic-metadata">

**Author:** [@pip010](https://discourse.itk.org/u/pip010)\
**Replies:** 0\
**Last updated:** [September 3, 2019, 1:23pm UTC](https://discourse.itk.org/t/composite-transform-serialization/2215 "2019-09-03T13:23:08Z")

</div>

I am following the example for serialization of composite transforms : ITK: Examples/IO/TransformReadWrite.cxx However I do get an exception when reading, that is on the line with reader-\>Update() I get : \\itk\\src\\it…

---

## [ResampleImageFilter 4D Images](https://discourse.itk.org/t/resampleimagefilter-4d-images/2172)

<div class="topic-metadata">

**Author:** [@SachidanandAlle](https://discourse.itk.org/u/SachidanandAlle)\
**Replies:** 3\
**Last updated:** [August 20, 2019, 1:51pm UTC](https://discourse.itk.org/t/resampleimagefilter-4d-images/2172 "2019-08-20T13:51:40Z")

</div>

Currently I am getting error when I try to use ResampleImageFilter over 4D image In the following thread, it is mentioned that 4D support is only limited to ExtractImageFilter File “/usr/local/lib/python3.5/dist-packa…

---

## [Gibbs Prior Filter for Image Classification Smoothing](https://discourse.itk.org/t/gibbs-prior-filter-for-image-classification-smoothing/2147)

<div class="topic-metadata">

**Author:** [@Courtney\_Ambrozic](https://discourse.itk.org/u/Courtney_Ambrozic)\
**Replies:** 1\
**Last updated:** [August 13, 2019, 4:03pm UTC](https://discourse.itk.org/t/gibbs-prior-filter-for-image-classification-smoothing/2147 "2019-08-13T16:03:50Z")

</div>

Hello ITK community, I have a question about the RGBGibbsPriorFilter. Mainly, I’m having trouble understanding the underlying algorithm for this filter. Is this filter based off of the paper “Gibbs Prior Models, March…

---

## [Strange (wrong?) interpolator behavior](https://discourse.itk.org/t/strange-wrong-interpolator-behavior/2139)

<div class="topic-metadata">

**Author:** [@richardM](https://discourse.itk.org/u/richardM)\
**Replies:** 2\
**Last updated:** [August 9, 2019, 1:40pm UTC](https://discourse.itk.org/t/strange-wrong-interpolator-behavior/2139 "2019-08-09T13:40:45Z")

</div>

Hi all, I was trying various interpolators to use applying a transformation I got from a simple euclid 2d registration. The image I’m applying it to is a CT image, and I’m using a 64bit float image type. When I resamp…

---

## [ITK to RTK migration, forward projection issues/questions](https://discourse.itk.org/t/itk-to-rtk-migration-forward-projection-issues-questions/2107)

<div class="topic-metadata">

**Author:** [@blacava](https://discourse.itk.org/u/blacava)\
**Replies:** 3\
**Last updated:** [August 1, 2019, 5:13pm UTC](https://discourse.itk.org/t/itk-to-rtk-migration-forward-projection-issues-questions/2107 "2019-08-01T17:13:05Z")

</div>

Hi. I’m trying to port my ITK DRR renderer to RTK to leverage some of the GPU speedups, but the RTK API and output are considerably different from ITK and I’m not getting very far. For instance, here’s a a lateral DRR f…

---

## [SymmetricSecondRankTensor indexing (Straintensor)](https://discourse.itk.org/t/symmetricsecondranktensor-indexing-straintensor/2109)

<div class="topic-metadata">

**Author:** [@laqua-stack](https://discourse.itk.org/u/laqua-stack)\
**Replies:** 3\
**Last updated:** [July 31, 2019, 3:29pm UTC](https://discourse.itk.org/t/symmetricsecondranktensor-indexing-straintensor/2109 "2019-07-31T15:29:58Z")

</div>

Hi, I tried calculating Straintensor with ITKStrain Module http://insight-journal.org/browse/publication/984 from a 2D DisplacementField (256,256,2). The output is a SymmetricSecondRankTensor. I converted to numpy array…

---

## [Problem in drawing geometrical object with ITK v5.0.0, but ITK v4 is good](https://discourse.itk.org/t/problem-in-drawing-geometrical-object-with-itk-v5-0-0-but-itk-v4-is-good/2098)

<div class="topic-metadata">

**Author:** [@yijun](https://discourse.itk.org/u/yijun)\
**Replies:** 3\
**Last updated:** [July 27, 2019, 1:07pm UTC](https://discourse.itk.org/t/problem-in-drawing-geometrical-object-with-itk-v5-0-0-but-itk-v4-is-good/2098 "2019-07-27T13:07:00Z")

</div>

Hi, I am working on a project which uses ITK to process medical images. Recently I upgraded ITK v4.13 to ITK v5.0.0 for the project, then I found something not working properly as before. Our function loads a list of poi…

---

## [BSpline fitting parametrization](https://discourse.itk.org/t/bspline-fitting-parametrization/1452)

<div class="topic-metadata">

**Author:** [@tim-evain](https://discourse.itk.org/u/tim-evain)\
**Replies:** 8\
**Last updated:** [July 25, 2019, 11:02am UTC](https://discourse.itk.org/t/bspline-fitting-parametrization/1452 "2019-07-25T11:02:27Z")

</div>

Hello guys, I’m trying to do BSpline fitting to estimate vessel centerlines given some user points. I use the BSplineScatteredDataPointSetToImageFilter and it gives good results in most cases. But when the parametric…

---

## [Making a 3D sequence from 4D volume](https://discourse.itk.org/t/making-a-3d-sequence-from-4d-volume/2070)

<div class="topic-metadata">

**Author:** [@jrojasUNC](https://discourse.itk.org/u/jrojasUNC)\
**Replies:** 27\
**Last updated:** [July 23, 2019, 8:44pm UTC](https://discourse.itk.org/t/making-a-3d-sequence-from-4d-volume/2070 "2019-07-23T20:44:33Z")

</div>

Hi, I have loaded in a series of 2D sequences (3 dimensions) and stitched them together into a 4D image. Now I would like to save the image as a 3D sequence. I think that to do this I need an image that has 3 dimensions…

---

## [make a set of 3D images into a 4D image](https://discourse.itk.org/t/make-a-set-of-3d-images-into-a-4d-image/2065)

<div class="topic-metadata">

**Author:** [@jrojasUNC](https://discourse.itk.org/u/jrojasUNC)\
**Replies:** 3\
**Last updated:** [July 19, 2019, 9:55pm UTC](https://discourse.itk.org/t/make-a-set-of-3d-images-into-a-4d-image/2065 "2019-07-19T21:55:44Z")

</div>

Hi I am trying to stitch together a series of 100 3D (512, 128, 200) images into a single 4D (512, 128, 200, 100) image using simpleITK. I have tried using the TileImageFilter but I only get an image that is 512, 128, 20…

---

## [Is there a decent way to quantify the "goodness" of a CT to CT scan registration?](https://discourse.itk.org/t/is-there-a-decent-way-to-quantify-the-goodness-of-a-ct-to-ct-scan-registration/2066)

<div class="topic-metadata">

**Author:** [@dlrdave](https://discourse.itk.org/u/dlrdave)\
**Replies:** 1\
**Last updated:** [July 19, 2019, 9:18pm UTC](https://discourse.itk.org/t/is-there-a-decent-way-to-quantify-the-goodness-of-a-ct-to-ct-scan-registration/2066 "2019-07-19T21:18:18Z")

</div>

That is, if we compute a transform based on registering two CT scans, and have a region of interest, what’s the best quantitative measure of how good that registration is in that region? Scrolling through slices and look…

---

## [SITK::Error - The file has unsupported 3 dimensions](https://discourse.itk.org/t/sitk-error-the-file-has-unsupported-3-dimensions/2045)

<div class="topic-metadata">

**Author:** [@SELVA\_MUTHU\_KUMARAN](https://discourse.itk.org/u/SELVA_MUTHU_KUMARAN)\
**Replies:** 12\
**Last updated:** [July 15, 2019, 5:10pm UTC](https://discourse.itk.org/t/sitk-error-the-file-has-unsupported-3-dimensions/2045 "2019-07-15T17:10:15Z")

</div>

Hello Everyone, Can you please help me with the below error? I have a DICOM file which is attached. When we try to convert this into a.mhd file, we get an error as “Teh file in the series has unsupported 3D dimensions”…

---

## [Seperate 2 series with the same series UID](https://discourse.itk.org/t/seperate-2-series-with-the-same-series-uid/1964)

<div class="topic-metadata">

**Author:** [@hadasara](https://discourse.itk.org/u/hadasara)\
**Replies:** 2\
**Last updated:** [June 14, 2019, 1:51pm UTC](https://discourse.itk.org/t/seperate-2-series-with-the-same-series-uid/1964 "2019-06-14T13:51:37Z")

</div>

Hi all, Whe I upload DICOM series into ITK SNAP, ITK-SNAP succceded to seperate a single slice that was not related to a series that was saved as the same UID. A dicom viewer Radient, didn’t suceed to seperate them. D…

---

## [Level-Set based not only on potential map](https://discourse.itk.org/t/level-set-based-not-only-on-potential-map/1959)

<div class="topic-metadata">

**Author:** [@Riccardo\_Ballarini](https://discourse.itk.org/u/Riccardo_Ballarini)\
**Replies:** 3\
**Last updated:** [June 12, 2019, 6:37pm UTC](https://discourse.itk.org/t/level-set-based-not-only-on-potential-map/1959 "2019-06-12T18:37:43Z")

</div>

Hi guys, thank you in advance for reading this. As the title says, I’d like to know if in ITK there is a level-set that uses not only the potential map for the segmentation. In particular, I’m looking for a level-set th…

---

## [itkThickness3D](https://discourse.itk.org/t/itkthickness3d/1918)

<div class="topic-metadata">

**Author:** [@Marco\_Festugato](https://discourse.itk.org/u/Marco_Festugato)\
**Replies:** 3\
**Last updated:** [June 12, 2019, 3:58pm UTC](https://discourse.itk.org/t/itkthickness3d/1918 "2019-06-12T15:58:31Z")

</div>

Hello everyone, I want to use the itkThickness3D filter in order to compute the 3D skeleton of my segmented blood vessels. I can’t find any documentation yet, so I dont know if with this filter (or another one) I can cal…

---

## [Difference between InverseDeformationFieldImageFilter and InverseDisplacementFieldImageFilter](https://discourse.itk.org/t/difference-between-inversedeformationfieldimagefilter-and-inversedisplacementfieldimagefilter/583)

<div class="topic-metadata">

**Author:** [@Ray](https://discourse.itk.org/u/Ray)\
**Replies:** 2\
**Last updated:** [June 10, 2019, 6:06am UTC](https://discourse.itk.org/t/difference-between-inversedeformationfieldimagefilter-and-inversedisplacementfieldimagefilter/583 "2019-06-10T06:06:17Z")

</div>

Hello! According to the wiki pages, I can’t tell any difference between InverseDeformationFieldImageFilter (https://itk.org/Doxygen/html/classitk\_1\_1InverseDeformationFieldImageFilter.html) and InverseDisplacementFieldI…

---

## [active contour without edge](https://discourse.itk.org/t/active-contour-without-edge/1932)

<div class="topic-metadata">

**Author:** [@Jianxu\_Chen](https://discourse.itk.org/u/Jianxu_Chen)\
**Replies:** 16\
**Last updated:** [June 4, 2019, 2:07pm UTC](https://discourse.itk.org/t/active-contour-without-edge/1932 "2019-06-04T14:07:34Z")

</div>

I am trying to build a segmentation module using the following two algorithms. https://www.insight-journal.org/browse/publication/322 http://insight-journal.org/browse/publication/323 Is it possible for me to download…

---

## [Stop region grow with a stop point](https://discourse.itk.org/t/stop-region-grow-with-a-stop-point/1929)

<div class="topic-metadata">

**Author:** [@TaoH](https://discourse.itk.org/u/TaoH)\
**Replies:** 1\
**Last updated:** [May 31, 2019, 1:38pm UTC](https://discourse.itk.org/t/stop-region-grow-with-a-stop-point/1929 "2019-05-31T13:38:51Z")

</div>

Hello everyone, I want to implement region grow with a stop point. When propagation region reaches the stop point, region grow is end. So how to implement it with itk? Best and thanks, Tao Han

---

## [canny segmentation level set](https://discourse.itk.org/t/canny-segmentation-level-set/1896)

<div class="topic-metadata">

**Author:** [@Marco\_Festugato](https://discourse.itk.org/u/Marco_Festugato)\
**Replies:** 7\
**Last updated:** [May 21, 2019, 6:20am UTC](https://discourse.itk.org/t/canny-segmentation-level-set/1896 "2019-05-21T06:20:32Z")

</div>

hi guys, thank u in advance for reading this. Can I use the Canny Edge level set to refine this segmentation I obtained using a simple binary thresholding? I want to delete all those little points and keep only the big …

---

## [MRFImageFilter classification image](https://discourse.itk.org/t/mrfimagefilter-classification-image/1815)

<div class="topic-metadata">

**Author:** [@Courtney\_Ambrozic](https://discourse.itk.org/u/Courtney_Ambrozic)\
**Replies:** 3\
**Last updated:** [May 15, 2019, 9:44pm UTC](https://discourse.itk.org/t/mrfimagefilter-classification-image/1815 "2019-05-15T21:44:29Z")

</div>

Hello, I’m following up to a question I posted awhile back, but never received a response about. I hope I can simplify my question in order to get some feedback. I’m playing around with the MRFImageFilter and am confu…

---

## [Computation time does not scale with SetMetricSamplingPercentage setting in ITK V4](https://discourse.itk.org/t/computation-time-does-not-scale-with-setmetricsamplingpercentage-setting-in-itk-v4/1798)

<div class="topic-metadata">

**Author:** [@eewujian](https://discourse.itk.org/u/eewujian)\
**Replies:** 10\
**Last updated:** [May 13, 2019, 2:35pm UTC](https://discourse.itk.org/t/computation-time-does-not-scale-with-setmetricsamplingpercentage-setting-in-itk-v4/1798 "2019-05-13T14:35:07Z")

</div>

I have been away from ITK community for a few years and recently I was trying to adapt my old code to the latest release. I was running into a few problems and I don’t know if those are the known issues with the new rele…

---

## [Particle swarm optimization excet](https://discourse.itk.org/t/particle-swarm-optimization-excet/1850)

<div class="topic-metadata">

**Author:** [@c.spanakis83](https://discourse.itk.org/u/c.spanakis83)\
**Replies:** 1\
**Last updated:** [May 9, 2019, 2:17pm UTC](https://discourse.itk.org/t/particle-swarm-optimization-excet/1850 "2019-05-09T14:17:45Z")

</div>

Hello. I want to use Particle Swarm Optimization (PSO) for Affine image registration. As you see below, I initialized PSO code optimizer-\>SetInertiaCoefficient(0.8); optimizer-\>SetMaximalNumberOfIterations(1000); optimi…

---

## [How does itkGeodesicActiveContourLevelSetImageFilter manage memory?](https://discourse.itk.org/t/how-does-itkgeodesicactivecontourlevelsetimagefilter-manage-memory/1838)

<div class="topic-metadata">

**Author:** [@Riccardo\_Ballarini](https://discourse.itk.org/u/Riccardo_Ballarini)\
**Replies:** 1\
**Last updated:** [May 6, 2019, 12:42pm UTC](https://discourse.itk.org/t/how-does-itkgeodesicactivecontourlevelsetimagefilter-manage-memory/1838 "2019-05-06T12:42:34Z")

</div>

Hi, I tried to use this level set, but it doesn’t run cause to “failed to allocate memory”. I made many tried and I have a question about this filter: if I made 100 iterations, does this filter try to allocate memory fo…

---

## [Registering diffrent sized scans](https://discourse.itk.org/t/registering-diffrent-sized-scans/1831)

<div class="topic-metadata">

**Author:** [@OmerB](https://discourse.itk.org/u/OmerB)\
**Replies:** 5\
**Last updated:** [May 3, 2019, 1:35am UTC](https://discourse.itk.org/t/registering-diffrent-sized-scans/1831 "2019-05-03T01:35:03Z")

</div>

Hello All, I have been using ITK image registration to register a CT scan to an MRI. The CT scan is from top of the head to the chest, while the MRI (my fixed image) only includes the head. Although my wrapper of ITK g…

---

## [ImageMaskSpatialObject IsInside less than half a pixel away?](https://discourse.itk.org/t/imagemaskspatialobject-isinside-less-than-half-a-pixel-away/1807)

<div class="topic-metadata">

**Author:** [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)\
**Replies:** 0\
**Last updated:** [April 22, 2019, 8:45am UTC](https://discourse.itk.org/t/imagemaskspatialobject-isinside-less-than-half-a-pixel-away/1807 "2019-04-22T08:45:02Z")

</div>

Pull request #751 proposes two rather simple tests for ImageMaskSpatialObject::IsInside(point): Test IsInsideSingleZeroPixel has a black pixel (pixel value zero) on a white background (pixel value 1) Test IsInsideS…

---

## [How to apply a filter only to a specific region of a 3D volume? \[C++\]](https://discourse.itk.org/t/how-to-apply-a-filter-only-to-a-specific-region-of-a-3d-volume-c/1790)

<div class="topic-metadata">

**Author:** [@Riccardo\_Ballarini](https://discourse.itk.org/u/Riccardo_Ballarini)\
**Replies:** 12\
**Last updated:** [April 18, 2019, 4:20pm UTC](https://discourse.itk.org/t/how-to-apply-a-filter-only-to-a-specific-region-of-a-3d-volume-c/1790 "2019-04-18T16:20:16Z")

</div>

Hi, I have a 3D dicom volume, I made a region growing to obtain a binary mask of a specific part of this volume, and now i want to apply a filter and work on the volume only on the part identified by the ones of the bin…

---

## [cropping 3d volume](https://discourse.itk.org/t/cropping-3d-volume/1788)

<div class="topic-metadata">

**Author:** [@Marco\_Festugato](https://discourse.itk.org/u/Marco_Festugato)\
**Replies:** 2\
**Last updated:** [April 16, 2019, 1:55pm UTC](https://discourse.itk.org/t/cropping-3d-volume/1788 "2019-04-16T13:55:10Z")

</div>

Hello, i have segmented the liver from 199 CT slices of the same patient (DICOM images). How can i crop the volume in order to contain only the segmented liver? I also have to write the 3D cropped volume back to the 199…

---

## [Casting image](https://discourse.itk.org/t/casting-image/1782)

<div class="topic-metadata">

**Author:** [@Marco\_Festugato](https://discourse.itk.org/u/Marco_Festugato)\
**Replies:** 6\
**Last updated:** [April 13, 2019, 8:09am UTC](https://discourse.itk.org/t/casting-image/1782 "2019-04-13T08:09:24Z")

</div>

Hello, I don’t understand if when I cast an image from one type to another (for example using itk Castimage Filter) , I also change the values of the pixels. Example: if I cast an image from ‘signed short’ (range: 0 to …

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

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