# Algorithms

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

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

**Page:** 3

---

## [In Affine Transform, Get/SetTranslation Same As Get/SetOffset?](https://discourse.itk.org/t/in-affine-transform-get-settranslation-same-as-get-setoffset/6744)

<div class="topic-metadata">

**Author:** [@constantine](https://discourse.itk.org/u/constantine)\
**Replies:** 1\
**Last updated:** [July 3, 2024, 12:12pm UTC](https://discourse.itk.org/t/in-affine-transform-get-settranslation-same-as-get-setoffset/6744 "2024-07-03T12:12:31Z")

</div>

Greetings, everyone. Looking at an instance of AffineTransform innards shows this: AffineTransform (000002503E609850) RTTI typeinfo: class itk::AffineTransform\<double,3\> Reference Count: 1 Modified Time: 967 …

---

## [Flat fielding causing the image tile to become white](https://discourse.itk.org/t/flat-fielding-causing-the-image-tile-to-become-white/6736)

<div class="topic-metadata">

**Author:** [@sleepingcat4](https://discourse.itk.org/u/sleepingcat4)\
**Replies:** 2\
**Last updated:** [July 1, 2024, 6:11pm UTC](https://discourse.itk.org/t/flat-fielding-causing-the-image-tile-to-become-white/6736 "2024-07-01T18:11:36Z")

</div>

I have an image montage problem and I have been using flat fielding to fix the individual image tile before applying simple itk’s montage feature to receive the final resampled image. Btw I’m using simpleitk for the fla…

---

## [Segmentation of same intensity bones using ITK](https://discourse.itk.org/t/segmentation-of-same-intensity-bones-using-itk/6738)

<div class="topic-metadata">

**Author:** [@KSJ](https://discourse.itk.org/u/KSJ)\
**Replies:** 2\
**Last updated:** [July 1, 2024, 1:49pm UTC](https://discourse.itk.org/t/segmentation-of-same-intensity-bones-using-itk/6738 "2024-07-01T13:49:15Z")

</div>

Hello everyone, I have a CT dataset of lower part of human body in DICOM images. I need to separate the femur and tibia bone separately from the dataset. For that obviously i cannot use thresholding because the femur a…

---

## [Change of tumor location during registration with different templates](https://discourse.itk.org/t/change-of-tumor-location-during-registration-with-different-templates/6726)

<div class="topic-metadata">

**Author:** [@Sunita\_Patel](https://discourse.itk.org/u/Sunita_Patel)\
**Replies:** 1\
**Last updated:** [June 28, 2024, 6:40am UTC](https://discourse.itk.org/t/change-of-tumor-location-during-registration-with-different-templates/6726 "2024-06-28T06:40:52Z")

</div>

Dear ITK forum Members, All our registrations are performed using Simple ITK. T1 weighted image is registered with SRI24 atlas (240,240,155) as a template (1st image) and with MNI152 (197,233,189) atlas (2nd image). 2n…

---

## [Resampled image does not match the points returned by transformpoint](https://discourse.itk.org/t/resampled-image-does-not-match-the-points-returned-by-transformpoint/3332)

<div class="topic-metadata">

**Author:** [@prms](https://discourse.itk.org/u/prms)\
**Replies:** 8\
**Last updated:** [June 21, 2024, 3:01pm UTC](https://discourse.itk.org/t/resampled-image-does-not-match-the-points-returned-by-transformpoint/3332 "2024-06-21T15:01:03Z")

</div>

I am applying a transform matrix to resample an MR image by following this notebook. I am able to resample the image. However, when I apply the matrix on the point to get the transformed point and compare the initial an…

---

## [3D Registration of Anatomical and functional MRI of Brain Images](https://discourse.itk.org/t/3d-registration-of-anatomical-and-functional-mri-of-brain-images/6612)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 25\
**Last updated:** [June 13, 2024, 5:13am UTC](https://discourse.itk.org/t/3d-registration-of-anatomical-and-functional-mri-of-brain-images/6612 "2024-06-13T05:13:32Z")

</div>

Hello, I have anatomical MR and functional MR images of a patient with tumor in the brain. I want to transform the low resolution functional MR image in such a way that it matches in shape with the anatomical MR image. …

---

## [ITK to VTK Filter not working.](https://discourse.itk.org/t/itk-to-vtk-filter-not-working/6676)

<div class="topic-metadata">

**Author:** [@Satyaj\_Bhargava](https://discourse.itk.org/u/Satyaj_Bhargava)\
**Replies:** 0\
**Last updated:** [June 5, 2024, 7:40pm UTC](https://discourse.itk.org/t/itk-to-vtk-filter-not-working/6676 "2024-06-05T19:40:28Z")

</div>

My code here is trying to read in an image as an itk image, turn it into a vtk image, flip it across the y axis, and show it. However, the display only shows black. (pixel values of 0). Why could this be? Here is the cod…

---

## [NrrdImageIO and NRRD version 5](https://discourse.itk.org/t/nrrdimageio-and-nrrd-version-5/6666)

<div class="topic-metadata">

**Author:** [@hapap](https://discourse.itk.org/u/hapap)\
**Replies:** 5\
**Last updated:** [June 4, 2024, 4:16am UTC](https://discourse.itk.org/t/nrrdimageio-and-nrrd-version-5/6666 "2024-06-04T04:16:38Z")

</div>

Hi! Briefly: is there a way to force ITK to write NRRD version 5 files? The longer story goes like this. I’m writing nrrd/nhrd files with using DWIImageType = itk::VectorImage\<short, 3\>; DWIImageType::Pointer dwi = D…

---

## [Non axis aligned orientation in real world data?](https://discourse.itk.org/t/non-axis-aligned-orientation-in-real-world-data/6639)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.itk.org/u/Jakub_Mitura)\
**Replies:** 6\
**Last updated:** [May 21, 2024, 7:26pm UTC](https://discourse.itk.org/t/non-axis-aligned-orientation-in-real-world-data/6639 "2024-05-21T19:26:01Z")

</div>

Hello from your experience is it happening that direction cosine matrix is not axis aligned for studies like CT PET MRI . I mean when orientation is not RAS or LPS … can not be summarized in 3 letter code because it is o…

---

## [rotation of both image and landmarks issue](https://discourse.itk.org/t/rotation-of-both-image-and-landmarks-issue/6620)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.itk.org/u/Jakub_Mitura)\
**Replies:** 10\
**Last updated:** [May 9, 2024, 6:13pm UTC](https://discourse.itk.org/t/rotation-of-both-image-and-landmarks-issue/6620 "2024-05-09T18:13:47Z")

</div>

Hello I try to rotate an image and landmarks , around image center. I tried resampling landmarks boh by resample physical point and manually using rotation matrix (I would prefer to stic with second solution as I need to…

---

## [Registration Algorithm or Evolution Optimizer Not Deterministic](https://discourse.itk.org/t/registration-algorithm-or-evolution-optimizer-not-deterministic/6597)

<div class="topic-metadata">

**Author:** [@Michael\_M](https://discourse.itk.org/u/Michael_M)\
**Replies:** 7\
**Last updated:** [May 3, 2024, 1:18pm UTC](https://discourse.itk.org/t/registration-algorithm-or-evolution-optimizer-not-deterministic/6597 "2024-05-03T13:18:03Z")

</div>

Hi, I am following the example registration11 found here: ITK: Examples/RegistrationITKv3/ImageRegistration11.cxx Everything works, except the results are not deterministic. When I run it multiple times, I am getting …

---

## [Problem with registration](https://discourse.itk.org/t/problem-with-registration/6600)

<div class="topic-metadata">

**Author:** [@Sunita\_Patel](https://discourse.itk.org/u/Sunita_Patel)\
**Replies:** 3\
**Last updated:** [April 29, 2024, 3:54pm UTC](https://discourse.itk.org/t/problem-with-registration/6600 "2024-04-29T15:54:53Z")

</div>

Dear ITK Team, Q.1) We are doing registration and visualize using gui.RegistrationPointDataAquisition(), it is showing the fixed and moving images. When we click on any point in the images it shows that point correctly …

---

## [ITK ERROR: CUDA ERROR: out of memory](https://discourse.itk.org/t/itk-error-cuda-error-out-of-memory/6583)

<div class="topic-metadata">

**Author:** [@zhangm](https://discourse.itk.org/u/zhangm)\
**Replies:** 4\
**Last updated:** [April 19, 2024, 12:51am UTC](https://discourse.itk.org/t/itk-error-cuda-error-out-of-memory/6583 "2024-04-19T00:51:35Z")

</div>

My data size is 5.03G with type uint16. When use FDK to reconstrunction the data type will cast into float, so my data size is 10.04G. And my output size set to 1.31G. According to this setting to reconstructing data by …

---

## [How to preprocess diffusion MRI?](https://discourse.itk.org/t/how-to-preprocess-diffusion-mri/6581)

<div class="topic-metadata">

**Author:** [@Sunita\_Patel](https://discourse.itk.org/u/Sunita_Patel)\
**Replies:** 2\
**Last updated:** [April 18, 2024, 10:19am UTC](https://discourse.itk.org/t/how-to-preprocess-diffusion-mri/6581 "2024-04-18T10:19:19Z")

</div>

Dear SITK-users How to preprocess diffusion MRI DICOM images? So far we have been using publicly available processed DWI nifti file and the given .bvec and .bval files. Now, we would like to do preprocessing from DICOM …

---

## [Copy headers / metadata between segmentations of different resolutions](https://discourse.itk.org/t/copy-headers-metadata-between-segmentations-of-different-resolutions/6558)

<div class="topic-metadata">

**Author:** [@Cristobal\_Rodero](https://discourse.itk.org/u/Cristobal_Rodero)\
**Replies:** 1\
**Last updated:** [April 9, 2024, 7:28pm UTC](https://discourse.itk.org/t/copy-headers-metadata-between-segmentations-of-different-resolutions/6558 "2024-04-09T19:28:37Z")

</div>

I have a coarse segmentation that I smooth, and the smoothing techniques overwrites the header. I want to retrieve the original one but I have had no success so far. The headers are \_, coarse\_header = nrrd.re…

---

## [How to do registration and resampling of T1W 3D image and the tumor mask with MNI152 template?](https://discourse.itk.org/t/how-to-do-registration-and-resampling-of-t1w-3d-image-and-the-tumor-mask-with-mni152-template/6549)

<div class="topic-metadata">

**Author:** [@Sunita\_Patel](https://discourse.itk.org/u/Sunita_Patel)\
**Replies:** 7\
**Last updated:** [April 5, 2024, 6:34pm UTC](https://discourse.itk.org/t/how-to-do-registration-and-resampling-of-t1w-3d-image-and-the-tumor-mask-with-mni152-template/6549 "2024-04-05T18:34:34Z")

</div>

Dear forum members, We have T1W 3D image and its tumor mask of shape 240 x 240 x 155. Now we want to register both image and mask to MNI152 template. MNI152 (mni\_icbm152\_t1\_nlin\_asym\_09a) shape is 197 x 233 x 189. We ar…

---

## [MultiScaleHessianBasedMeasureImageFilter GetScalesOutput() member function doesn't work in python?](https://discourse.itk.org/t/multiscalehessianbasedmeasureimagefilter-getscalesoutput-member-function-doesnt-work-in-python/6518)

<div class="topic-metadata">

**Author:** [@Chuck\_Hatt](https://discourse.itk.org/u/Chuck_Hatt)\
**Replies:** 2\
**Last updated:** [March 15, 2024, 3:17pm UTC](https://discourse.itk.org/t/multiscalehessianbasedmeasureimagefilter-getscalesoutput-member-function-doesnt-work-in-python/6518 "2024-03-15T15:17:32Z")

</div>

Getting an error when I try write to file or get the numpy array associated with the GetScalesOutput() function for MultiScaleHessianBasedMeasureImageFilter in python. # Load itk\_image from file ImageTyp…

---

## [Computing Hessian Eigenvalues in Python: How to interpret output of SymmetricEigenAnalysisImageFilter](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517)

<div class="topic-metadata">

**Author:** [@Chuck\_Hatt](https://discourse.itk.org/u/Chuck_Hatt)\
**Replies:** 6\
**Last updated:** [March 15, 2024, 2:06pm UTC](https://discourse.itk.org/t/computing-hessian-eigenvalues-in-python-how-to-interpret-output-of-symmetriceigenanalysisimagefilter/6517 "2024-03-15T14:06:28Z")

</div>

Why would the output of SymmetricEigenAnalysisImageFilter have 6 channels, and at each pixel there are more than 3 non-zero values (there should only be three eigenvalues)? This is my code for computing the hessian eige…

---

## [Plot TRE per iteration for 2D registration](https://discourse.itk.org/t/plot-tre-per-iteration-for-2d-registration/6505)

<div class="topic-metadata">

**Author:** [@Vojtech\_Benda](https://discourse.itk.org/u/Vojtech_Benda)\
**Replies:** 4\
**Last updated:** [March 15, 2024, 12:14pm UTC](https://discourse.itk.org/t/plot-tre-per-iteration-for-2d-registration/6505 "2024-03-15T12:14:35Z")

</div>

Hello, I’m trying to plot target registration error (TRE) values at each iteration as shown in this notebook in the Registration cell. The input images are 3D and 2D, where the 3D image is sliced into 2D. They are transf…

---

## [ADMM Reconstruction](https://discourse.itk.org/t/admm-reconstruction/6490)

<div class="topic-metadata">

**Author:** [@zhangm](https://discourse.itk.org/u/zhangm)\
**Replies:** 13\
**Last updated:** [March 8, 2024, 12:46am UTC](https://discourse.itk.org/t/admm-reconstruction/6490 "2024-03-08T00:46:01Z")

</div>

I successfully ran the FirstCudaReconstruction.py file on my project. But sometimes the scanning angle may only be 90 °, and the reconstruction effect using FDK is not good. I checked the rtk and found that ADMM reconstr…

---

## [Transfer from CPUImage to GPUImage](https://discourse.itk.org/t/transfer-from-cpuimage-to-gpuimage/6492)

<div class="topic-metadata">

**Author:** [@zhangm](https://discourse.itk.org/u/zhangm)\
**Replies:** 3\
**Last updated:** [March 5, 2024, 2:12pm UTC](https://discourse.itk.org/t/transfer-from-cpuimage-to-gpuimage/6492 "2024-03-05T14:12:54Z")

</div>

I need transfer from CPUImage to GPUImage in python. And I find this discourse by use itk.cuda\_image\_to\_image\_filter() to complete the conversion. But the error prompt seems that the fuction only support input type as G…

---

## [Slow itkContourExtractor2DImageFilter](https://discourse.itk.org/t/slow-itkcontourextractor2dimagefilter/6486)

<div class="topic-metadata">

**Author:** [@finetjul](https://discourse.itk.org/u/finetjul)\
**Replies:** 0\
**Last updated:** [March 1, 2024, 3:58pm UTC](https://discourse.itk.org/t/slow-itkcontourextractor2dimagefilter/6486 "2024-03-01T15:58:57Z")

</div>

Hi, itkContourExtractor2DImageFilter is slow for our need. Is there a way to configure it to speed it up (e.g. we could provide a seed to the algorithm for what contour to extract) ? Is there an alternative algorithm th…

---

## [MHA File Format Question about Transform Matrix](https://discourse.itk.org/t/mha-file-format-question-about-transform-matrix/6481)

<div class="topic-metadata">

**Author:** [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Replies:** 1\
**Last updated:** [February 29, 2024, 4:59pm UTC](https://discourse.itk.org/t/mha-file-format-question-about-transform-matrix/6481 "2024-02-29T16:59:36Z")

</div>

Looking at the header for the .MHA file format there is a Transform Matrix encoded in there. We use the ITK Image reader classes to get at this information. metaImageIO-\>SetFileName(filePath); metaImageIO-\>ReadI…

---

## [Metal Artifacts detection](https://discourse.itk.org/t/metal-artifacts-detection/6467)

<div class="topic-metadata">

**Author:** [@pratibha](https://discourse.itk.org/u/pratibha)\
**Replies:** 2\
**Last updated:** [February 26, 2024, 3:45pm UTC](https://discourse.itk.org/t/metal-artifacts-detection/6467 "2024-02-26T15:45:05Z")

</div>

Hello, I just need to detect metal artifacts not reconstruct. Could you recommend any papers or resources where I could get an idea of this? In addition to metal artifacts, I have other artifacts on my data, such as ali…

---

## [Reading and writing of 5D images - a dimension disappears](https://discourse.itk.org/t/reading-and-writing-of-5d-images-a-dimension-disappears/6210)

<div class="topic-metadata">

**Author:** [@cpinter](https://discourse.itk.org/u/cpinter)\
**Replies:** 28\
**Last updated:** [February 15, 2024, 9:21pm UTC](https://discourse.itk.org/t/reading-and-writing-of-5d-images-a-dimension-disappears/6210 "2024-02-15T21:21:17Z")

</div>

Hi all, We’re trying to enable 3D Slicer to read and write vector image sequences (displacement field or velocity field: 3D spatial + component + time = 5 dimensions) into a single file. The format of choice is NRRD, an…

---

## [Convert itk::PointSet to an triangular itk::Mesh](https://discourse.itk.org/t/convert-itk-pointset-to-an-triangular-itk-mesh/6440)

<div class="topic-metadata">

**Author:** [@HnHd](https://discourse.itk.org/u/HnHd)\
**Replies:** 1\
**Last updated:** [February 15, 2024, 7:25pm UTC](https://discourse.itk.org/t/convert-itk-pointset-to-an-triangular-itk-mesh/6440 "2024-02-15T19:25:02Z")

</div>

Hello everyone, I have a 3D itk::PointSet that I need to save as an .stl file. My plan is to convert the PointSet into a mesh and then save it as an .stl file. However, I’m currently facing a challenge in defining the c…

---

## [Registratrion mpMRI prostate](https://discourse.itk.org/t/registratrion-mpmri-prostate/6442)

<div class="topic-metadata">

**Author:** [@Nathalie\_M](https://discourse.itk.org/u/Nathalie_M)\
**Replies:** 1\
**Last updated:** [February 15, 2024, 2:13pm UTC](https://discourse.itk.org/t/registratrion-mpmri-prostate/6442 "2024-02-15T14:13:34Z")

</div>

Hi, I would like to register a T2w image (640x640x23) with a DWI (and ADC) MR image (116x228x25) of the prostate. The latter has a different size as it has been acquired using zoom. Origin of both images are (0,0,0). I…

---

## [Segmenting Non-Vascular Tubular Structures in MRI](https://discourse.itk.org/t/segmenting-non-vascular-tubular-structures-in-mri/6427)

<div class="topic-metadata">

**Author:** [@Miri\_Trope](https://discourse.itk.org/u/Miri_Trope)\
**Replies:** 3\
**Last updated:** [February 6, 2024, 7:48am UTC](https://discourse.itk.org/t/segmenting-non-vascular-tubular-structures-in-mri/6427 "2024-02-06T07:48:30Z")

</div>

Hello everyone, I’m interested in hearing your suggestions on how to segment a structure similar to the one in the attached image. This structure is part of a tubular shape captured from an axial view in an MRI image. It…

---

## [\[itk-python\] Create an image with GPU](https://discourse.itk.org/t/itk-python-create-an-image-with-gpu/6414)

<div class="topic-metadata">

**Author:** [@zhangm](https://discourse.itk.org/u/zhangm)\
**Replies:** 13\
**Last updated:** [January 29, 2024, 10:04am UTC](https://discourse.itk.org/t/itk-python-create-an-image-with-gpu/6414 "2024-01-29T10:04:53Z")

</div>

I used pip to install itk5.4.0, and running some demo about RTK. There was normal when I running FirstReconstruction.py, but there was an error when running FirstCudaReconstruction.py. Both using itk.GPUImage and itk.RTK…

---

## [DRR grayvalue Incorrect](https://discourse.itk.org/t/drr-grayvalue-incorrect/6415)

<div class="topic-metadata">

**Author:** [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Replies:** 3\
**Last updated:** [January 29, 2024, 1:24am UTC](https://discourse.itk.org/t/drr-grayvalue-incorrect/6415 "2024-01-29T01:24:40Z")

</div>

I used rtk:: CudaForwardProjectionImageFilter to generate DRR, and I shifted the volume to the left. The grayscale value on the right side of the generated DRR is closer to the part that passes through the volume, but …

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

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