# Algorithms

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

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

**Page:** 12

---

## [SimpleITK cast 4D image](https://discourse.itk.org/t/simpleitk-cast-4d-image/3638)

<div class="topic-metadata">

**Author:** [@jonasteuwen](https://discourse.itk.org/u/jonasteuwen)\
**Replies:** 1\
**Last updated:** [November 19, 2020, 8:32pm UTC](https://discourse.itk.org/t/simpleitk-cast-4d-image/3638 "2020-11-19T20:32:23Z")

</div>

The question is inspired by this reply: https://discourse.itk.org/t/weighted-average-over-temporal-dimension/3636/5 Shortly: I have an external intercept parameter -1024 and a SimpleITK image (4D) with an unsigned data …

---

## [Weighted average over temporal dimension](https://discourse.itk.org/t/weighted-average-over-temporal-dimension/3636)

<div class="topic-metadata">

**Author:** [@jonasteuwen](https://discourse.itk.org/u/jonasteuwen)\
**Replies:** 5\
**Last updated:** [November 19, 2020, 8:22pm UTC](https://discourse.itk.org/t/weighted-average-over-temporal-dimension/3636 "2020-11-19T20:22:58Z")

</div>

Hello all. I have a bunch of 3D scans of the same subject over time joined in a 4D scan using (by JoinSeries) and I have a vector with the phase weights. To create a 3D approximation of this 4D object you might want to m…

---

## [Patch extraction](https://discourse.itk.org/t/patch-extraction/3630)

<div class="topic-metadata">

**Author:** [@a10227](https://discourse.itk.org/u/a10227)\
**Replies:** 2\
**Last updated:** [November 19, 2020, 11:32am UTC](https://discourse.itk.org/t/patch-extraction/3630 "2020-11-19T11:32:41Z")

</div>

Good day, Could you please tell me, how I can save extracted patched from 3D image, so their original coordinates are preserved? My goal is to select some patches, so those, being combined together, form the original im…

---

## [Can the spatial domain of the sampling point set be specified for registration?](https://discourse.itk.org/t/can-the-spatial-domain-of-the-sampling-point-set-be-specified-for-registration/3610)

<div class="topic-metadata">

**Author:** [@spencermanwell](https://discourse.itk.org/u/spencermanwell)\
**Replies:** 5\
**Last updated:** [November 13, 2020, 8:01pm UTC](https://discourse.itk.org/t/can-the-spatial-domain-of-the-sampling-point-set-be-specified-for-registration/3610 "2020-11-13T20:01:42Z")

</div>

Hi there, I am looking at registration of whole-body CT image volumes, repeat scans of the same individual over several month span. My primary concern is efficiency, secondary concern is accuracy and so I am tuning care…

---

## [Advice on a workflow for copying of a region-of-interest across different DICOM series](https://discourse.itk.org/t/advice-on-a-workflow-for-copying-of-a-region-of-interest-across-different-dicom-series/3601)

<div class="topic-metadata">

**Author:** [@ctorti](https://discourse.itk.org/u/ctorti)\
**Replies:** 5\
**Last updated:** [November 13, 2020, 10:55am UTC](https://discourse.itk.org/t/advice-on-a-workflow-for-copying-of-a-region-of-interest-across-different-dicom-series/3601 "2020-11-13T10:55:26Z")

</div>

Hello everyone, I’m working on a medical image processing workflow in Python using SimpleITK and could benefit from the experience of others. The goal: To copy a segment from a “Source” DICOM SEG to a “Target” DICOM SE…

---

## [Multistage Registration using itkRegistrationMethodV4](https://discourse.itk.org/t/multistage-registration-using-itkregistrationmethodv4/3608)

<div class="topic-metadata">

**Author:** [@machadoL](https://discourse.itk.org/u/machadoL)\
**Replies:** 0\
**Last updated:** [November 11, 2020, 7:07pm UTC](https://discourse.itk.org/t/multistage-registration-using-itkregistrationmethodv4/3608 "2020-11-11T19:07:50Z")

</div>

Hello, everyone. I am using itkRegistrationMethodV4 to perform a multistage registration: 1st stage is a 3D rigid transform, and the 2nd stage is a BsplineTransform. The problem I am stucking happens when I try to conn…

---

## [BSpline Multiresolution error while setting Transform](https://discourse.itk.org/t/bspline-multiresolution-error-while-setting-transform/3562)

<div class="topic-metadata">

**Author:** [@machadoL](https://discourse.itk.org/u/machadoL)\
**Replies:** 8\
**Last updated:** [November 11, 2020, 6:54pm UTC](https://discourse.itk.org/t/bspline-multiresolution-error-while-setting-transform/3562 "2020-11-11T18:54:29Z")

</div>

Hello, everyone. I am writing a MULTISTAGE registration pipeline. 1st Stage is a 3D rigid one; the output is added into CompositTransform object; Then I set the CompositTransform as the initial transform of the Defo…

---

## [Conversion of dicom image format to jpeg or png or bmp](https://discourse.itk.org/t/conversion-of-dicom-image-format-to-jpeg-or-png-or-bmp/3473)

<div class="topic-metadata">

**Author:** [@Jigabytes](https://discourse.itk.org/u/Jigabytes)\
**Replies:** 6\
**Last updated:** [November 10, 2020, 7:03pm UTC](https://discourse.itk.org/t/conversion-of-dicom-image-format-to-jpeg-or-png-or-bmp/3473 "2020-11-10T19:03:29Z")

</div>

Hi, I am try to get convert a dicom image into jpeg, png or bmp. I would like to know if converting the image array from dicom to jpeg or any other format results loss in image data information? Thanks,Jiten

---

## [help in applying rotation using Affinematrix](https://discourse.itk.org/t/help-in-applying-rotation-using-affinematrix/3592)

<div class="topic-metadata">

**Author:** [@prms](https://discourse.itk.org/u/prms)\
**Replies:** 1\
**Last updated:** [November 3, 2020, 3:02pm UTC](https://discourse.itk.org/t/help-in-applying-rotation-using-affinematrix/3592 "2020-11-03T15:02:17Z")

</div>

I am using this AffineMatrix to rotate the image by 90 degrees. array(\[\[ 1., 0., 0., 0.\], \[ 0., 0., -1., 0.\], \[ 0., 1., 0., 0.\], \[ 0., 0., 0., 1.\]\]) When I apply this transformation to image(left is the o…

---

## [Differentiable Bspline transformation](https://discourse.itk.org/t/differentiable-bspline-transformation/3585)

<div class="topic-metadata">

**Author:** [@prms](https://discourse.itk.org/u/prms)\
**Replies:** 7\
**Last updated:** [November 4, 2020, 3:05pm UTC](https://discourse.itk.org/t/differentiable-bspline-transformation/3585 "2020-11-04T15:05:49Z")

</div>

I’ve been trying to use B-spline transformation using Neural Networks in PyTorch. I’ve been using the model from here. However, when I use the predicted parameters in SITK, the transformation results do not match. I want…

---

## [scaling is reducing size of image](https://discourse.itk.org/t/scaling-is-reducing-size-of-image/3591)

<div class="topic-metadata">

**Author:** [@prms](https://discourse.itk.org/u/prms)\
**Replies:** 2\
**Last updated:** [November 3, 2020, 3:10pm UTC](https://discourse.itk.org/t/scaling-is-reducing-size-of-image/3591 "2020-11-03T15:10:25Z")

</div>

I am using an AffineTransform only with scaling parameters and scaling an image. When the scale factor is set to 2, after resampling the image and comparing with the original one in an external viewer, I see that the sca…

---

## [Can I use self-defined cost function for optimization in SimpleITK?](https://discourse.itk.org/t/can-i-use-self-defined-cost-function-for-optimization-in-simpleitk/3575)

<div class="topic-metadata">

**Author:** [@dada](https://discourse.itk.org/u/dada)\
**Replies:** 1\
**Last updated:** [October 26, 2020, 4:59pm UTC](https://discourse.itk.org/t/can-i-use-self-defined-cost-function-for-optimization-in-simpleitk/3575 "2020-10-26T16:59:57Z")

</div>

Hello, I am doing B-Spline registration, I use Sum of Squared Differences (SSD) as the cost and found images were deformed too much. I would like to add some regularization in the cost function to constrain image deform…

---

## [Failure Case with QuadEdgeMesh and Cuberille](https://discourse.itk.org/t/failure-case-with-quadedgemesh-and-cuberille/3565)

<div class="topic-metadata">

**Author:** [@DVigneault](https://discourse.itk.org/u/DVigneault)\
**Replies:** 0\
**Last updated:** [October 23, 2020, 12:02am UTC](https://discourse.itk.org/t/failure-case-with-quadedgemesh-and-cuberille/3565 "2020-10-23T00:02:39Z")

</div>

Hello all! I’ve run into a bug in the Cuberille remote module, and have finally gotten it down to an MCE which reproduces the issue. I’ve posted a more detailed description of the problem as a github issue, but wanted …

---

## [Resampling to Isotropic: Signal Processing Theory](https://discourse.itk.org/t/resampling-to-isotropic-signal-processing-theory/1403)

<div class="topic-metadata">

**Author:** [@Besler](https://discourse.itk.org/u/Besler)\
**Replies:** 18\
**Last updated:** [October 15, 2020, 10:27pm UTC](https://discourse.itk.org/t/resampling-to-isotropic-signal-processing-theory/1403 "2020-10-15T22:27:02Z")

</div>

Hi ITK Community! Sanity check here about Nyquist-Shannon sampling theorem and resampling images to be isotropic. I have read through the online example \[1\]. I have also read the sinc approximation paper \[2\]. Setup I h…

---

## [3D model -\> DICOM/nii conversion](https://discourse.itk.org/t/3d-model-dicom-nii-conversion/3536)

<div class="topic-metadata">

**Author:** [@a10227](https://discourse.itk.org/u/a10227)\
**Replies:** 4\
**Last updated:** [October 15, 2020, 10:14am UTC](https://discourse.itk.org/t/3d-model-dicom-nii-conversion/3536 "2020-10-15T10:14:38Z")

</div>

Good day, I have raw patient images as well as their segmentations as 3D models. I need to convert segmentations to 3D image so that this converted image will be aligned with the patient’s one. Could you please tell me…

---

## [Bi variate polynomial warping filter?](https://discourse.itk.org/t/bi-variate-polynomial-warping-filter/3512)

<div class="topic-metadata">

**Author:** [@rfrank](https://discourse.itk.org/u/rfrank)\
**Replies:** 2\
**Last updated:** [October 5, 2020, 4:05pm UTC](https://discourse.itk.org/t/bi-variate-polynomial-warping-filter/3512 "2020-10-05T16:05:51Z")

</div>

I have coefficients a b for a polynomial X = a0 + a1x + a2y +a3xy + a4x^2 + a5y^2 Y = b0 +b1x + b2y + b3xy + b4x^2 + b5y^2 I would imagine there is an ITK filter for this type of transformation but I don’t seem to f…

---

## [How to calculate Jacobian matrix of a transformation with simpleITK?](https://discourse.itk.org/t/how-to-calculate-jacobian-matrix-of-a-transformation-with-simpleitk/3486)

<div class="topic-metadata">

**Author:** [@dada](https://discourse.itk.org/u/dada)\
**Replies:** 1\
**Last updated:** [September 25, 2020, 6:00pm UTC](https://discourse.itk.org/t/how-to-calculate-jacobian-matrix-of-a-transformation-with-simpleitk/3486 "2020-09-25T18:00:10Z")

</div>

Hello, How to calculate Jacobian matrix at each pixel with simpleITK after I have estimated a B-spline transformation between fixed\_image and moving\_image? Do I need to convert the transformation into displacement fiel…

---

## [Does SimpleITK return final transformation corresponding to the best similarity metric value or it return the final transformation obtained the last iteration?](https://discourse.itk.org/t/does-simpleitk-return-final-transformation-corresponding-to-the-best-similarity-metric-value-or-it-return-the-final-transformation-obtained-the-last-iteration/3428)

<div class="topic-metadata">

**Author:** [@dada](https://discourse.itk.org/u/dada)\
**Replies:** 10\
**Last updated:** [September 25, 2020, 5:12pm UTC](https://discourse.itk.org/t/does-simpleitk-return-final-transformation-corresponding-to-the-best-similarity-metric-value-or-it-return-the-final-transformation-obtained-the-last-iteration/3428 "2020-09-25T17:12:25Z")

</div>

Hello, I am doing B-spline registration with SimpleITK, and I set MeanSquares as similarity metric. Can I ask: does SimpleITK return final transformation corresponding to the best similarity metric value or it return t…

---

## [write euler2d transform to file](https://discourse.itk.org/t/write-euler2d-transform-to-file/3458)

<div class="topic-metadata">

**Author:** [@Henco](https://discourse.itk.org/u/Henco)\
**Replies:** 1\
**Last updated:** [September 14, 2020, 4:31pm UTC](https://discourse.itk.org/t/write-euler2d-transform-to-file/3458 "2020-09-14T16:31:15Z")

</div>

Hi all, I’m trying to use ImageRegistration5.cxx to register two 2d images. I’d like to have the program write the resultant transform to file so I can use it later in Slicer. I’m using the code below, and a file is bei…

---

## [TransformPhysicalPointToIndex that remains inside the boundaries of the image](https://discourse.itk.org/t/transformphysicalpointtoindex-that-remains-inside-the-boundaries-of-the-image/3435)

<div class="topic-metadata">

**Author:** [@spyridon97](https://discourse.itk.org/u/spyridon97)\
**Replies:** 10\
**Last updated:** [September 10, 2020, 5:07pm UTC](https://discourse.itk.org/t/transformphysicalpointtoindex-that-remains-inside-the-boundaries-of-the-image/3435 "2020-09-10T17:07:53Z")

</div>

Hello everyone, I am working with ITK images and I am using TransformPhysicalPointToIndex a lot!. My physical space bounds are quite strict, so I wanna be sure that this function computes accurately indices of points t…

---

## [Simplex Mesh Deformable Model 3D wtih texture images](https://discourse.itk.org/t/simplex-mesh-deformable-model-3d-wtih-texture-images/3447)

<div class="topic-metadata">

**Author:** [@Leonardo\_Henrique](https://discourse.itk.org/u/Leonardo_Henrique)\
**Replies:** 1\
**Last updated:** [September 8, 2020, 7:12pm UTC](https://discourse.itk.org/t/simplex-mesh-deformable-model-3d-wtih-texture-images/3447 "2020-09-08T19:12:09Z")

</div>

Hi itk-developers, I’m using the itkDeformableSimplexMesh3DFilter to make a local adjustment of a simplex mesh. I was inserting a gradient image in the deform filter, however I want to insert a texture image instead of …

---

## [itkLevelSetDomainMapImageFilter](https://discourse.itk.org/t/itklevelsetdomainmapimagefilter/3436)

<div class="topic-metadata">

**Author:** [@rfrank](https://discourse.itk.org/u/rfrank)\
**Replies:** 1\
**Last updated:** [September 8, 2020, 1:12am UTC](https://discourse.itk.org/t/itklevelsetdomainmapimagefilter/3436 "2020-09-08T01:12:01Z")

</div>

I am using this filter in a 3D image. I am wondering if others have noticed the O(n^3) (or thereabouts) nature of this filter and if they have found a different way. It seems to apply labels by a search across the entir…

---

## [Is there any good tutorial or example for coronary artery segmentation using itk&vtk](https://discourse.itk.org/t/is-there-any-good-tutorial-or-example-for-coronary-artery-segmentation-using-itk-vtk/3420)

<div class="topic-metadata">

**Author:** [@kaiyan\_liu](https://discourse.itk.org/u/kaiyan_liu)\
**Replies:** 5\
**Last updated:** [September 3, 2020, 6:57pm UTC](https://discourse.itk.org/t/is-there-any-good-tutorial-or-example-for-coronary-artery-segmentation-using-itk-vtk/3420 "2020-09-03T18:57:16Z")

</div>

I have a series of CT pictures(dicom format) of patients’ heart. I would like to get coronary artery segmentation(with 3d display) from these files. I have try to use 3d slicer and VMTK to do these . these two software …

---

## [Files reading issues. Can you please help?](https://discourse.itk.org/t/files-reading-issues-can-you-please-help/3375)

<div class="topic-metadata">

**Author:** [@blizzardboi\_2020](https://discourse.itk.org/u/blizzardboi_2020)\
**Replies:** 10\
**Last updated:** [August 17, 2020, 1:00pm UTC](https://discourse.itk.org/t/files-reading-issues-can-you-please-help/3375 "2020-08-17T13:00:05Z")

</div>

C:/Users/ Desktop/train/’ PX1\_0000- T2W.nii.gz + seg.nii.gz PX1\_0001- T2W.nii.gz+ seg.nii.gz . . … PX1\_0200- T2W.nii.gz+ seg.nii path1='C:/Users/Desktop/train/' def load\_data(path): my\_dir = sorted(os.listdir(pa…

---

## [mutual information entropy](https://discourse.itk.org/t/mutual-information-entropy/3341)

<div class="topic-metadata">

**Author:** [@TJH123456](https://discourse.itk.org/u/TJH123456)\
**Replies:** 9\
**Last updated:** [August 11, 2020, 2:04pm UTC](https://discourse.itk.org/t/mutual-information-entropy/3341 "2020-08-11T14:04:12Z")

</div>

Hello I want to ask that in the metrics class of sklearn package, \[mutual\_ info\_ score\] is used to calculate Shannon’s mutual information entropy? If not, is there any way to calculate it? If so, is it accurate? Because…

---

## [My first Image Registration Tutorial](https://discourse.itk.org/t/my-first-image-registration-tutorial/3371)

<div class="topic-metadata">

**Author:** [@ibr](https://discourse.itk.org/u/ibr)\
**Replies:** 0\
**Last updated:** [August 8, 2020, 5:36pm UTC](https://discourse.itk.org/t/my-first-image-registration-tutorial/3371 "2020-08-08T17:36:41Z")

</div>

Dear all, I wrote a tutorial bout image registration trying to simplify and to explain the math behind it. A simple python implementation is used. Ths result is compared to ITK implementation. The tutorial is written a…

---

## [Registration of large images](https://discourse.itk.org/t/registration-of-large-images/3335)

<div class="topic-metadata">

**Author:** [@Bleach665](https://discourse.itk.org/u/Bleach665)\
**Replies:** 1\
**Last updated:** [July 26, 2020, 11:51pm UTC](https://discourse.itk.org/t/registration-of-large-images/3335 "2020-07-26T23:51:14Z")

</div>

Hi guys. I register relatively large images (larger than 10000x10000). Everything works fine, but the registration time is about a few hours. I think it would be good to reduce the images size, register, scale the tran…

---

## [TubeTK hepatic vessel registration workflow](https://discourse.itk.org/t/tubetk-hepatic-vessel-registration-workflow/3294)

<div class="topic-metadata">

**Author:** [@Henco](https://discourse.itk.org/u/Henco)\
**Replies:** 4\
**Last updated:** [July 23, 2020, 8:24pm UTC](https://discourse.itk.org/t/tubetk-hepatic-vessel-registration-workflow/3294 "2020-07-23T20:24:52Z")

</div>

Hello all, I recently read the Alward et al. paper on their unique way of registering blood vessels to DSAs. I’d like to implement it an ITK project and I found that group had created TubeTK. I’d like use TubeTK to regi…

---

## [Direction/Orientation matrix DICOM vs Nifti](https://discourse.itk.org/t/direction-orientation-matrix-dicom-vs-nifti/3289)

<div class="topic-metadata">

**Author:** [@rcorredorj](https://discourse.itk.org/u/rcorredorj)\
**Replies:** 5\
**Last updated:** [July 16, 2020, 3:41pm UTC](https://discourse.itk.org/t/direction-orientation-matrix-dicom-vs-nifti/3289 "2020-07-16T15:41:50Z")

</div>

Hi everyone, I’m having discrepancies between the orientation matrix read from DICOMs or from a Nifti generated from the same DICOM series. I’d like to understand what is going on. I have a DICOM series that I read in …

---

## [Registration/alignment of two images](https://discourse.itk.org/t/registration-alignment-of-two-images/3266)

<div class="topic-metadata">

**Author:** [@markbuckup](https://discourse.itk.org/u/markbuckup)\
**Replies:** 2\
**Last updated:** [July 14, 2020, 4:36pm UTC](https://discourse.itk.org/t/registration-alignment-of-two-images/3266 "2020-07-14T16:36:09Z")

</div>

Hello, I am trying to find the optimal registration process for these two images. They are of the same tissue across different stains, which means that they have different RGB qualities but are of the same basic size. T…

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

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