# Beginner Questions

**URL:** https://discourse.itk.org/c/beginner-questions/9.md?no_subcategories=false&page=5

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

**Page:** 6

---

## [ITK functions need more documentation](https://discourse.itk.org/t/itk-functions-need-more-documentation/5817)

<div class="topic-metadata">

**Author:** [@imranmuet](https://discourse.itk.org/u/imranmuet)\
**Replies:** 3\
**Last updated:** [April 3, 2024, 12:41pm UTC](https://discourse.itk.org/t/itk-functions-need-more-documentation/5817 "2024-04-03T12:41:57Z")

</div>

Dear All: I am new in this field and implementing a registration code. But when I search Simple ITK documentation, I find it unfriendly for complete beginners. For example, when I search online to understand the code \`s…

---

## [Local RLEImage compiling errors with ITK5.4](https://discourse.itk.org/t/local-rleimage-compiling-errors-with-itk5-4/6533)

<div class="topic-metadata">

**Author:** [@jilei-hao](https://discourse.itk.org/u/jilei-hao)\
**Replies:** 9\
**Last updated:** [March 29, 2024, 1:35pm UTC](https://discourse.itk.org/t/local-rleimage-compiling-errors-with-itk5-4/6533 "2024-03-29T13:35:03Z")

</div>

Hi @dzenanz, I’m compiling ITK-SNAP with ITK 5.4-rc.2 and start getting following errors from this line. Similar errors also occur when using ImageFileWriter and ImageAlgorithm etc. with RLEImage. The project is still …

---

## [How do you access the "Modality" metadata from the MHA header?](https://discourse.itk.org/t/how-do-you-access-the-modality-metadata-from-the-mha-header/6547)

<div class="topic-metadata">

**Author:** [@nicoco](https://discourse.itk.org/u/nicoco)\
**Replies:** 1\
**Last updated:** [March 28, 2024, 6:46pm UTC](https://discourse.itk.org/t/how-do-you-access-the-modality-metadata-from-the-mha-header/6547 "2024-03-28T18:46:35Z")

</div>

Some MHAs contain a “Modality” tag, which seems to be treated differently than other keys. How do we access it? Some sort of MWE: \> cat /tmp/test.mha ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMS…

---

## [Trying to understand fundamentals (how registration works with two objects in one image)](https://discourse.itk.org/t/trying-to-understand-fundamentals-how-registration-works-with-two-objects-in-one-image/6031)

<div class="topic-metadata">

**Author:** [@CrownMella](https://discourse.itk.org/u/CrownMella)\
**Replies:** 9\
**Last updated:** [March 21, 2024, 2:16pm UTC](https://discourse.itk.org/t/trying-to-understand-fundamentals-how-registration-works-with-two-objects-in-one-image/6031 "2024-03-21T14:16:42Z")

</div>

Hi, I’ve only recently started working with image registration and I just don’t get the step by step process of how it works. Let’s say I have two grayscale images: 1st image, a circle (1) and a square (2) on left side …

---

## [Differences after applying forward & inverse transform](https://discourse.itk.org/t/differences-after-applying-forward-inverse-transform/6536)

<div class="topic-metadata">

**Author:** [@Mckay42](https://discourse.itk.org/u/Mckay42)\
**Replies:** 2\
**Last updated:** [March 21, 2024, 5:54am UTC](https://discourse.itk.org/t/differences-after-applying-forward-inverse-transform/6536 "2024-03-21T05:54:18Z")

</div>

Hi all, I started using sitk a while ago and hope to use it for registration tasks in my project. While playing around with it, I tried to apply a simple Euler3D transform to my image and revert it with the the inverse…

---

## [Setting an Initial Transform for Elastix](https://discourse.itk.org/t/setting-an-initial-transform-for-elastix/6532)

<div class="topic-metadata">

**Author:** [@lschuring](https://discourse.itk.org/u/lschuring)\
**Replies:** 1\
**Last updated:** [March 19, 2024, 8:33pm UTC](https://discourse.itk.org/t/setting-an-initial-transform-for-elastix/6532 "2024-03-19T20:33:51Z")

</div>

Hi ITK community! I am setting up a pipeline in python to register MRI image stacks which tend to have poor initial alignment. I would like to provide an elastix image filter (sitk.ElastixImageFilter()) an initial trans…

---

## [Different include file paths between build-from-source and installed](https://discourse.itk.org/t/different-include-file-paths-between-build-from-source-and-installed/6531)

<div class="topic-metadata">

**Author:** [@jilei-hao](https://discourse.itk.org/u/jilei-hao)\
**Replies:** 1\
**Last updated:** [March 19, 2024, 3:50pm UTC](https://discourse.itk.org/t/different-include-file-paths-between-build-from-source-and-installed/6531 "2024-03-19T15:50:21Z")

</div>

Hi, I’m working on upgrading our projects references to itk5.4. When I changed itk reference from a build-from-source directory to an installed directory, some of the #include no longer work. Here are two examples: // …

---

## [Convert a displacement filed nifty image to SITK transform type](https://discourse.itk.org/t/convert-a-displacement-filed-nifty-image-to-sitk-transform-type/4210)

<div class="topic-metadata">

**Author:** [@VHK](https://discourse.itk.org/u/VHK)\
**Replies:** 4\
**Last updated:** [March 19, 2024, 12:53pm UTC](https://discourse.itk.org/t/convert-a-displacement-filed-nifty-image-to-sitk-transform-type/4210 "2024-03-19T12:53:40Z")

</div>

Hello everyone, I have a displacement field Nifti format (field.nii.gz). How can I convert it to sitk.transform type (field.tfm) so that I can use it as transformation in SITK? I really appreciate any help you can prov…

---

## [Issue with the RTK output generated using a head phantom](https://discourse.itk.org/t/issue-with-the-rtk-output-generated-using-a-head-phantom/6520)

<div class="topic-metadata">

**Author:** [@Navami\_123](https://discourse.itk.org/u/Navami_123)\
**Replies:** 9\
**Last updated:** [March 19, 2024, 12:15pm UTC](https://discourse.itk.org/t/issue-with-the-rtk-output-generated-using-a-head-phantom/6520 "2024-03-19T12:15:36Z")

</div>

Hi, I am trying to reconstruct a CBCT raw data using RTK. I was able to execute the code and generate output, but unfortunately I am facing issues with the output generated. I don’t know if the issue is due to the geome…

---

## [ITK Pixel Depth Range Values](https://discourse.itk.org/t/itk-pixel-depth-range-values/6524)

<div class="topic-metadata">

**Author:** [@kdavet\_sas](https://discourse.itk.org/u/kdavet_sas)\
**Replies:** 1\
**Last updated:** [March 18, 2024, 3:54pm UTC](https://discourse.itk.org/t/itk-pixel-depth-range-values/6524 "2024-03-18T15:54:10Z")

</div>

Hello, I am curious what the pixel depth range values are for ITK images. I found this page that outlines the different file formats and pixel values, but it does not supply the corresponding ranges. For example, these a…

---

## [How to register a pair of images and their corresponding masks?](https://discourse.itk.org/t/how-to-register-a-pair-of-images-and-their-corresponding-masks/6511)

<div class="topic-metadata">

**Author:** [@vectorzwt](https://discourse.itk.org/u/vectorzwt)\
**Replies:** 6\
**Last updated:** [March 14, 2024, 7:15am UTC](https://discourse.itk.org/t/how-to-register-a-pair-of-images-and-their-corresponding-masks/6511 "2024-03-14T07:15:08Z")

</div>

Hello everyone.I’m new to simpleitk, and I want to register two images (pre and post surgery) and their corresponding masks. And my code is shown: def rigid\_pre\_post(fixed\_image\_path, moving\_image\_path, fixed\_mask\_path,…

---

## [How is origin calculated during resampling?](https://discourse.itk.org/t/how-is-origin-calculated-during-resampling/6515)

<div class="topic-metadata">

**Author:** [@Xiang\_Zhenyu](https://discourse.itk.org/u/Xiang_Zhenyu)\
**Replies:** 0\
**Last updated:** [March 14, 2024, 6:45am UTC](https://discourse.itk.org/t/how-is-origin-calculated-during-resampling/6515 "2024-03-14T06:45:23Z")

</div>

I want to resample the image to the specified data, but how to calculate the origin so that the image can be displayed normally. Example： origin:(-90.36074829101562, -172.32485961914062, 121.83561706542969) Spacing:(1…

---

## [Which image is resampled during registration?](https://discourse.itk.org/t/which-image-is-resampled-during-registration/6512)

<div class="topic-metadata">

**Author:** [@dstansby](https://discourse.itk.org/u/dstansby)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 6:20pm UTC](https://discourse.itk.org/t/which-image-is-resampled-during-registration/6512 "2024-03-13T18:20:03Z")

</div>

I’m trying to understand how image registration works in SimpleITK, and am unsure which image (fixed or moving) gets interpolated on to the other image during the registration process. As an example, if I’m trying to reg…

---

## [Direction loosing negative sign](https://discourse.itk.org/t/direction-loosing-negative-sign/6371)

<div class="topic-metadata">

**Author:** [@Franciska](https://discourse.itk.org/u/Franciska)\
**Replies:** 5\
**Last updated:** [March 13, 2024, 11:53am UTC](https://discourse.itk.org/t/direction-loosing-negative-sign/6371 "2024-03-13T11:53:45Z")

</div>

I have a nifti file, which if I read with nibabel, and print the affine matrix it looks like this: \[\[-0.28 0. 0. 0. \] \[ 0. -0.28 0. 0. \] \[ 0. 0. 0.28 0. …

---

## [Error loading DICOM file](https://discourse.itk.org/t/error-loading-dicom-file/6489)

<div class="topic-metadata">

**Author:** [@Kewil\_Bhima](https://discourse.itk.org/u/Kewil_Bhima)\
**Replies:** 3\
**Last updated:** [March 4, 2024, 8:15pm UTC](https://discourse.itk.org/t/error-loading-dicom-file/6489 "2024-03-04T20:15:38Z")

</div>

I have recently downloaded ITK-Snap and I am having issues loading an image. I get an error saying “vector too long” when trying to load a DICOM file from a MRI scan. I have no issue opening this same image in other soft…

---

## [How to get image mask in simpleitk?](https://discourse.itk.org/t/how-to-get-image-mask-in-simpleitk/6470)

<div class="topic-metadata">

**Author:** [@dstansby](https://discourse.itk.org/u/dstansby)\
**Replies:** 4\
**Last updated:** [February 29, 2024, 9:29pm UTC](https://discourse.itk.org/t/how-to-get-image-mask-in-simpleitk/6470 "2024-02-29T21:29:59Z")

</div>

I’m trying to set and get a mask on an image using simpleitk in Python. I’m setting the mask like this: image: sitk.Image mask: npt.NDArray masked\_image = sitk.Mask(image, sitk.GetImageFromArray(mask)) I can’t work out…

---

## [Fusion between segmentation and reference image](https://discourse.itk.org/t/fusion-between-segmentation-and-reference-image/6469)

<div class="topic-metadata">

**Author:** [@Nuno\_Loucao1](https://discourse.itk.org/u/Nuno_Loucao1)\
**Replies:** 1\
**Last updated:** [February 26, 2024, 4:09pm UTC](https://discourse.itk.org/t/fusion-between-segmentation-and-reference-image/6469 "2024-02-26T16:09:19Z")

</div>

Hi! I’m performing an analysis on a 4D breast MRI scan. I’m trying to fuse the segmentation results on a reference image dataset (3D), but without results. So i have the lesion segmented, then i multiply it by, p.ex.,…

---

## [Issue in ITK-RTK reconstruction with Shepp-Logan phantom](https://discourse.itk.org/t/issue-in-itk-rtk-reconstruction-with-shepp-logan-phantom/6464)

<div class="topic-metadata">

**Author:** [@Navami\_123](https://discourse.itk.org/u/Navami_123)\
**Replies:** 2\
**Last updated:** [February 24, 2024, 8:24am UTC](https://discourse.itk.org/t/issue-in-itk-rtk-reconstruction-with-shepp-logan-phantom/6464 "2024-02-24T08:24:04Z")

</div>

Hi, I was trying to do a comparative study between TIGRE and RTK for which I have extracted the Shepp-Logan Raw projection data from TIGRE and I am trying to reconstruct it in RTK. Initially I tried to read the raw data…

---

## [Set Image Direction from numpy array](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844)

<div class="topic-metadata">

**Author:** [@nicoco](https://discourse.itk.org/u/nicoco)\
**Replies:** 25\
**Last updated:** [February 22, 2024, 1:18am UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844 "2024-02-22T01:18:35Z")

</div>

Hello, I’m struggling to use a numpy array in order to set the direction of an ITK Image using python bindings. My attempts: In \[8\]: image = itk.Image.New() In \[9\]: np\_dir = np.eye(2) In \[10\]: image.SetDirection(itk…

---

## [Measuring Aorta Diameter from centerline using ITK](https://discourse.itk.org/t/measuring-aorta-diameter-from-centerline-using-itk/6447)

<div class="topic-metadata">

**Author:** [@idinsmore1](https://discourse.itk.org/u/idinsmore1)\
**Replies:** 7\
**Last updated:** [February 21, 2024, 1:16am UTC](https://discourse.itk.org/t/measuring-aorta-diameter-from-centerline-using-itk/6447 "2024-02-21T01:16:44Z")

</div>

Hello! I’ve been trying to implement a python method for automatically measuring the aortic diameter from CT segmentations. I was previously trying to do this all in numpy/scipy, but I think I need the efficiency and th…

---

## [How can we achieve good results in affine registration for 3D CT images of the heart obtained from different people?](https://discourse.itk.org/t/how-can-we-achieve-good-results-in-affine-registration-for-3d-ct-images-of-the-heart-obtained-from-different-people/6458)

<div class="topic-metadata">

**Author:** [@Shima](https://discourse.itk.org/u/Shima)\
**Replies:** 0\
**Last updated:** [February 20, 2024, 3:05pm UTC](https://discourse.itk.org/t/how-can-we-achieve-good-results-in-affine-registration-for-3d-ct-images-of-the-heart-obtained-from-different-people/6458 "2024-02-20T15:05:20Z")

</div>

Hi, I want to perform affine registration on 3D heart CT images obtained from different individuals. Firstly, I resampled all images to a uniform size of 111 and then cropped them to ensure the heart is centered and this…

---

## [itkwidgets CLI ConnectionRefusedError](https://discourse.itk.org/t/itkwidgets-cli-connectionrefusederror/6450)

<div class="topic-metadata">

**Author:** [@constantine](https://discourse.itk.org/u/constantine)\
**Replies:** 2\
**Last updated:** [February 19, 2024, 11:07pm UTC](https://discourse.itk.org/t/itkwidgets-cli-connectionrefusederror/6450 "2024-02-19T23:07:05Z")

</div>

Greetings ITK community, I’m starting to tinker with itkwidgets (among other things) and trying the CLI like this: itkwidgets -i Lat\_Bisection.nrrd --verbose -b with the following results: /home/xys321/miniconda3/env…

---

## [How to use the GetScalesOutput() method in MultiscaleHessianBasedMeasureImageFilter](https://discourse.itk.org/t/how-to-use-the-getscalesoutput-method-in-multiscalehessianbasedmeasureimagefilter/6433)

<div class="topic-metadata">

**Author:** [@Tomo](https://discourse.itk.org/u/Tomo)\
**Replies:** 4\
**Last updated:** [February 13, 2024, 3:40am UTC](https://discourse.itk.org/t/how-to-use-the-getscalesoutput-method-in-multiscalehessianbasedmeasureimagefilter/6433 "2024-02-13T03:40:34Z")

</div>

Hello, I am interested in applying a vesselness filter process to MRA images, referencing “Antiga, L. (2007). Generalizing vesselness with respect to dimensionality and shape. The Insight Journal.” I have written a scri…

---

## [ITK Python Image of itk.D Vectors For Composite Transform](https://discourse.itk.org/t/itk-python-image-of-itk-d-vectors-for-composite-transform/5122)

<div class="topic-metadata">

**Author:** [@josebouza](https://discourse.itk.org/u/josebouza)\
**Replies:** 7\
**Last updated:** [February 2, 2024, 6:59pm UTC](https://discourse.itk.org/t/itk-python-image-of-itk-d-vectors-for-composite-transform/5122 "2024-02-02T18:59:34Z")

</div>

Hello, I am trying to convert a numpy array to an image of type itk.Image\[itk.Vector\[itk.D,3\],3\] in python ITK. The issue is that most ITK filters do not support this type. I would rather avoid having to compile my own …

---

## [How to penalise non-rigid distortion when using groupwise registration](https://discourse.itk.org/t/how-to-penalise-non-rigid-distortion-when-using-groupwise-registration/6412)

<div class="topic-metadata">

**Author:** [@pedro](https://discourse.itk.org/u/pedro)\
**Replies:** 3\
**Last updated:** [January 31, 2024, 3:20pm UTC](https://discourse.itk.org/t/how-to-penalise-non-rigid-distortion-when-using-groupwise-registration/6412 "2024-01-31T15:20:04Z")

</div>

Hi, I need to register some cardiac MR data (10 grayscale 2D images with 256x96 pixels), and I am trying to avoid having to select a reference image by using a groupwise registration method. The current problem I am fac…

---

## [module 'SimpleITK' has no attribute 'GetDefaultParameterMap'](https://discourse.itk.org/t/module-simpleitk-has-no-attribute-getdefaultparametermap/6422)

<div class="topic-metadata">

**Author:** [@jdoungchawee](https://discourse.itk.org/u/jdoungchawee)\
**Replies:** 1\
**Last updated:** [January 31, 2024, 1:49pm UTC](https://discourse.itk.org/t/module-simpleitk-has-no-attribute-getdefaultparametermap/6422 "2024-01-31T13:49:20Z")

</div>

I tried to do image registration which worked well before but after a while, I will get this error with the same code that worked before. Please anyone know what is the problem and how to fix it? Example of code: def r…

---

## [Failed to allocate memory Error](https://discourse.itk.org/t/failed-to-allocate-memory-error/1930)

<div class="topic-metadata">

**Author:** [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Replies:** 4\
**Last updated:** [January 30, 2024, 2:30pm UTC](https://discourse.itk.org/t/failed-to-allocate-memory-error/1930 "2024-01-30T14:30:12Z")

</div>

I was trying to execute the DeformableRegistration15.cxx on two brain CT images. Pixel Type is short. I get this error when i execute it. Please help me with thins.

---

## [Upsampling with SimpleITK](https://discourse.itk.org/t/upsampling-with-simpleitk/6383)

<div class="topic-metadata">

**Author:** [@clarkbab](https://discourse.itk.org/u/clarkbab)\
**Replies:** 3\
**Last updated:** [January 29, 2024, 1:46pm UTC](https://discourse.itk.org/t/upsampling-with-simpleitk/6383 "2024-01-29T13:46:17Z")

</div>

Hi there, I’m running into an issue when upsampling an image with SimpleITK. I’ve created a simple grid to test my upsampling code, and my SimpleITK implementation seems to introduce some shift. Any ideas what I’m doing…

---

## [Convert3D - is it possible to rotate an image?](https://discourse.itk.org/t/convert3d-is-it-possible-to-rotate-an-image/6418)

<div class="topic-metadata">

**Author:** [@chlee](https://discourse.itk.org/u/chlee)\
**Replies:** 1\
**Last updated:** [January 29, 2024, 1:42pm UTC](https://discourse.itk.org/t/convert3d-is-it-possible-to-rotate-an-image/6418 "2024-01-29T13:42:59Z")

</div>

Dear ITK community, I am frequently using Convert3D (c3d) which works most of my image processing tasks (and easy to construct a pipeline for parallel processing). One thing I am wondering is whether it has a functional…

---

## [Perspective transformation for binary images](https://discourse.itk.org/t/perspective-transformation-for-binary-images/2014)

<div class="topic-metadata">

**Author:** [@dgdgn](https://discourse.itk.org/u/dgdgn)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 4:50pm UTC](https://discourse.itk.org/t/perspective-transformation-for-binary-images/2014 "2024-01-25T16:50:57Z")

</div>

I am trying to register two binary images. The fixed image is a planar shape, and the moving image comes from a camera image of the same shape but additionally has a perspective distortion due to the camera angle. Here i…

[Previous page](https://discourse.itk.org/c/beginner-questions/9.md?no_subcategories=false&page=4)

[Next page](https://discourse.itk.org/c/beginner-questions/9.md?no_subcategories=false&page=6)
