# Beginner Questions

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

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

**Page:** 42

---

## [Can anyone tell me how to read and write a .hdr and .img file using ITK?](https://discourse.itk.org/t/can-anyone-tell-me-how-to-read-and-write-a-hdr-and-img-file-using-itk/741)

<div class="topic-metadata">

**Author:** [@Yuda\_Bi](https://discourse.itk.org/u/Yuda_Bi)\
**Replies:** 1\
**Last updated:** [March 7, 2018, 5:18pm UTC](https://discourse.itk.org/t/can-anyone-tell-me-how-to-read-and-write-a-hdr-and-img-file-using-itk/741 "2018-03-07T17:18:31Z")

</div>

Dear All, I have encountered a difficulty about a project using ITK to read and write image such as this: image.hdr image.img I don’t know how to read this image, can anyone tell me which class or method need to use …

---

## [Mesh in Python](https://discourse.itk.org/t/mesh-in-python/739)

<div class="topic-metadata">

**Author:** [@Urban\_Simoncic](https://discourse.itk.org/u/Urban_Simoncic)\
**Replies:** 1\
**Last updated:** [March 6, 2018, 4:35pm UTC](https://discourse.itk.org/t/mesh-in-python/739 "2018-03-06T16:35:06Z")

</div>

I want to work with itk.Mesh in python, so I tried to instantiate mesh type: MeshType = itk.Mesh\[itk.F, 3\] However, I got the error: KeyError: ‘itkTemplate : No template (, 3) for the itk::Mesh class’ I use my build …

---

## [Object orientation detection](https://discourse.itk.org/t/object-orientation-detection/733)

<div class="topic-metadata">

**Author:** [@majid](https://discourse.itk.org/u/majid)\
**Replies:** 1\
**Last updated:** [March 5, 2018, 4:34pm UTC](https://discourse.itk.org/t/object-orientation-detection/733 "2018-03-05T16:34:06Z")

</div>

Dear All, I have a 3D object which is located in an arbitrary position and orientation in the space. My goal is to roughly find the orientation of the object. To achieve that, I think I need a descriptor of the object …

---

## [Problems converting binary array to ITK image](https://discourse.itk.org/t/problems-converting-binary-array-to-itk-image/676)

<div class="topic-metadata">

**Author:** [@Elli](https://discourse.itk.org/u/Elli)\
**Replies:** 5\
**Last updated:** [February 26, 2018, 6:17pm UTC](https://discourse.itk.org/t/problems-converting-binary-array-to-itk-image/676 "2018-02-26T18:17:03Z")

</div>

Dear all, I would like to read in a binary array and convert part of this array into an ITK image. I would like to use the ITK image later on as a mask. However, my code is not working yet, there has to be a mistake so…

---

## [DICOM attribute from Keyword](https://discourse.itk.org/t/dicom-attribute-from-keyword/706)

<div class="topic-metadata">

**Author:** [@Fijoy\_Vadakkumpadan](https://discourse.itk.org/u/Fijoy_Vadakkumpadan)\
**Replies:** 3\
**Last updated:** [February 26, 2018, 4:56pm UTC](https://discourse.itk.org/t/dicom-attribute-from-keyword/706 "2018-02-26T16:56:58Z")

</div>

Hello, Is it possible to look up a DICOM attribute using its DICOM keyword in ITK? Also, is it possible to determine the value representation of an attribute using its tag or keyword? For example, I’d like to lookup th…

---

## [Convert NVL Matrix to NumPy array](https://discourse.itk.org/t/convert-nvl-matrix-to-numpy-array/711)

<div class="topic-metadata">

**Author:** [@glemaitre](https://discourse.itk.org/u/glemaitre)\
**Replies:** 1\
**Last updated:** [February 26, 2018, 5:10am UTC](https://discourse.itk.org/t/convert-nvl-matrix-to-numpy-array/711 "2018-02-26T05:10:09Z")

</div>

Just found out that I should not post to the mailing list anymore. So here is my question. I am using the python wrapper of itk to manipulate. I checked the quick start guide ( http://itkpythonpackage.readthedocs.io/e…

---

## [fill a region (square, ellipse) of an image with specific value in SimpleITK](https://discourse.itk.org/t/fill-a-region-square-ellipse-of-an-image-with-specific-value-in-simpleitk/688)

<div class="topic-metadata">

**Author:** [@grothausmann.roman](https://discourse.itk.org/u/grothausmann.roman)\
**Replies:** 11\
**Last updated:** [February 23, 2018, 1:26pm UTC](https://discourse.itk.org/t/fill-a-region-square-ellipse-of-an-image-with-specific-value-in-simpleitk/688 "2018-02-23T13:26:56Z")

</div>

Hello, Is there an elegant way in sitk to fill a region e.g. square/ellipse given index and size of an image with a specific value using python? Many thanks for any help or hints Roman

---

## [ITK beginner](https://discourse.itk.org/t/itk-beginner/642)

<div class="topic-metadata">

**Author:** [@Scleri](https://discourse.itk.org/u/Scleri)\
**Replies:** 5\
**Last updated:** [February 3, 2018, 5:58pm UTC](https://discourse.itk.org/t/itk-beginner/642 "2018-02-03T17:58:52Z")

</div>

Hi, I installed ITK and CMAKE. I have to make a c++ project in Eclipse and I need to include some ITK libraries such as "itkImage.h" etc. I create a new c++ project in Eclipse, then I include the libraries I need but …

---

## [GetDifferenceFunction() declaration](https://discourse.itk.org/t/getdifferencefunction-declaration/684)

<div class="topic-metadata">

**Author:** [@Bartosz](https://discourse.itk.org/u/Bartosz)\
**Replies:** 2\
**Last updated:** [February 20, 2018, 9:16am UTC](https://discourse.itk.org/t/getdifferencefunction-declaration/684 "2018-02-20T09:16:11Z")

</div>

Hello, Where can I find the definition of function: SetDifferenceFunction() and\` GetDifferenceFunction() they appear in: …/ITK/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx at line 39 …

---

## [Label Map Overlay Problem](https://discourse.itk.org/t/label-map-overlay-problem/628)

<div class="topic-metadata">

**Author:** [@jbcksfrt](https://discourse.itk.org/u/jbcksfrt)\
**Replies:** 7\
**Last updated:** [February 12, 2018, 3:43pm UTC](https://discourse.itk.org/t/label-map-overlay-problem/628 "2018-02-12T15:43:05Z")

</div>

I am having some difficulty overlaying boolean masks onto Nifti images. The code below is basically what is shown here (which does work for me when I use the images on the page). The differences that I can see are that …

---

## [itk.GetArrayFromImage fail after source region size change.](https://discourse.itk.org/t/itk-getarrayfromimage-fail-after-source-region-size-change/667)

<div class="topic-metadata">

**Author:** [@benjaminhon](https://discourse.itk.org/u/benjaminhon)\
**Replies:** 7\
**Last updated:** [February 11, 2018, 8:32pm UTC](https://discourse.itk.org/t/itk-getarrayfromimage-fail-after-source-region-size-change/667 "2018-02-11T20:32:18Z")

</div>

I got an error after doing the following, it seems that after changing the source, itk.GetArrayFromImage no longer works, however .GetOutput() still works. reader = itk.ImageSeriesReader\[ItkTypes.IF3\].New() reader.SetFi…

---

## [Supported DICOM metadata types](https://discourse.itk.org/t/supported-dicom-metadata-types/665)

<div class="topic-metadata">

**Author:** [@Fijoy\_Vadakkumpadan](https://discourse.itk.org/u/Fijoy_Vadakkumpadan)\
**Replies:** 3\
**Last updated:** [February 10, 2018, 4:37pm UTC](https://discourse.itk.org/t/supported-dicom-metadata-types/665 "2018-02-10T16:37:59Z")

</div>

Hello, Are DICOM metadata values of all types supported in ITK? I’d retrieve metadata value of any type from a DICOM image, given an arbitrary DICOM tag. All examples I see in documentation are for string metadata, so …

---

## [UNC formatted image](https://discourse.itk.org/t/unc-formatted-image/657)

<div class="topic-metadata">

**Author:** [@arman.eshaghi](https://discourse.itk.org/u/arman.eshaghi)\
**Replies:** 4\
**Last updated:** [February 9, 2018, 5:27pm UTC](https://discourse.itk.org/t/unc-formatted-image/657 "2018-02-09T17:27:12Z")

</div>

What is the best way of reading UNC formatted images (.unc) and the associated header from disk?

---

## [How to \_really\_ disconnect pipeline?](https://discourse.itk.org/t/how-to-really-disconnect-pipeline/551)

<div class="topic-metadata">

**Author:** [@kaspermarstal](https://discourse.itk.org/u/kaspermarstal)\
**Replies:** 8\
**Last updated:** [February 5, 2018, 12:10pm UTC](https://discourse.itk.org/t/how-to-really-disconnect-pipeline/551 "2018-02-05T12:10:27Z")

</div>

Hello, I am generating images in a loop and adding to multi-input filter. In pseudo-code for(;;) { filterA = A::New() /\* Do something with filterA, e.g. set a filename and read an image() \*/ filterB = B::New() …

---

## [ITKBasicFilter not found](https://discourse.itk.org/t/itkbasicfilter-not-found/646)

<div class="topic-metadata">

**Author:** [@Scleri](https://discourse.itk.org/u/Scleri)\
**Replies:** 0\
**Last updated:** [February 3, 2018, 5:57pm UTC](https://discourse.itk.org/t/itkbasicfilter-not-found/646 "2018-02-03T17:57:56Z")

</div>

Hi, I followed the instruction and I managed to configure an existing project with CMake, then I opened Eclipse, import project General-\>Existing project into Workspace-\>select the path of the folder that contain the …

---

## [defautl pixel value for out of bounds during registration](https://discourse.itk.org/t/defautl-pixel-value-for-out-of-bounds-during-registration/605)

<div class="topic-metadata">

**Author:** [@asertyuio](https://discourse.itk.org/u/asertyuio)\
**Replies:** 2\
**Last updated:** [January 20, 2018, 4:51pm UTC](https://discourse.itk.org/t/defautl-pixel-value-for-out-of-bounds-during-registration/605 "2018-01-20T16:51:45Z")

</div>

Dear all, I’m wondering if there is a way of forcing a default pixel value in the registration metric for out of bounds pixels. I don’t know if I’m clear. Basically I have images for which I know that out of bound value…

---

## [SimpleITK - Manipulating pixel of the buffer image](https://discourse.itk.org/t/simpleitk-manipulating-pixel-of-the-buffer-image/606)

<div class="topic-metadata">

**Author:** [@Pratama\_Istiadi](https://discourse.itk.org/u/Pratama_Istiadi)\
**Replies:** 0\
**Last updated:** [January 19, 2018, 3:34pm UTC](https://discourse.itk.org/t/simpleitk-manipulating-pixel-of-the-buffer-image/606 "2018-01-19T15:34:17Z")

</div>

I am currently using C# with SimpleITK libraries for manipulating 3d images. I have been able to read my .mhd meta image and perform thresholding, erotion, dilation, etc. The input image is 3D image (or stacked 2D images…

---

## [Build my first ITK registration example](https://discourse.itk.org/t/build-my-first-itk-registration-example/597)

<div class="topic-metadata">

**Author:** [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Replies:** 1\
**Last updated:** [January 17, 2018, 3:39pm UTC](https://discourse.itk.org/t/build-my-first-itk-registration-example/597 "2018-01-17T15:39:25Z")

</div>

Question (via private message): As I am new to ITK software, I want to know how image registration is done in ITK as I want to do overlapping of 2 images. So please kindly tell me the procedure or steps to do the respec…

---

## [ITK include directories for VS2017](https://discourse.itk.org/t/itk-include-directories-for-vs2017/589)

<div class="topic-metadata">

**Author:** [@ankita](https://discourse.itk.org/u/ankita)\
**Replies:** 3\
**Last updated:** [January 15, 2018, 6:01pm UTC](https://discourse.itk.org/t/itk-include-directories-for-vs2017/589 "2018-01-15T18:01:08Z")

</div>

---

## [How to create LabelToRGBFunctor](https://discourse.itk.org/t/how-to-create-labeltorgbfunctor/563)

<div class="topic-metadata">

**Author:** [@benjaminhon](https://discourse.itk.org/u/benjaminhon)\
**Replies:** 9\
**Last updated:** [January 15, 2018, 2:08am UTC](https://discourse.itk.org/t/how-to-create-labeltorgbfunctor/563 "2018-01-15T02:08:59Z")

</div>

for the C++ implementation of LabelMapToRGBImageFilter It says to use a functor to the colormap, im simpleITK, they convert a colormap into a functor: However, in the python version how to I create a type of itk::Fu…

---

## [How to slice diagonally (SITK/Python)](https://discourse.itk.org/t/how-to-slice-diagonally-sitk-python/572)

<div class="topic-metadata">

**Author:** [@Jsphine](https://discourse.itk.org/u/Jsphine)\
**Replies:** 3\
**Last updated:** [January 5, 2018, 6:15pm UTC](https://discourse.itk.org/t/how-to-slice-diagonally-sitk-python/572 "2018-01-05T18:15:40Z")

</div>

Greetings, I just started using ITK (simpleITK/Python) and I would like to slice CT images according to some diagonal axes. I managed to visualize slices according to the x-, y-, and z- axis separately, but I don’t get…

---

## [Get Label Number of each pixel](https://discourse.itk.org/t/get-label-number-of-each-pixel/575)

<div class="topic-metadata">

**Author:** [@arwtyxouymz](https://discourse.itk.org/u/arwtyxouymz)\
**Replies:** 3\
**Last updated:** [January 9, 2018, 5:21am UTC](https://discourse.itk.org/t/get-label-number-of-each-pixel/575 "2018-01-09T05:21:06Z")

</div>

Hi, all I’m using itkConnectedComponentImageFilter for labeling image and itkLabelToRGBImageFilter for convert from binary image to rgb image based on labeling. I want to get labels of each pixels, but i don’t know how…

---

## [Lambda parameter in LevenbergMarquardtOptimizer](https://discourse.itk.org/t/lambda-parameter-in-levenbergmarquardtoptimizer/577)

<div class="topic-metadata">

**Author:** [@Anna](https://discourse.itk.org/u/Anna)\
**Replies:** 0\
**Last updated:** [January 8, 2018, 11:28am UTC](https://discourse.itk.org/t/lambda-parameter-in-levenbergmarquardtoptimizer/577 "2018-01-08T11:28:01Z")

</div>

Hi, I’m quite new in ITK and I’m getting in trouble with the optimizer parameters. I’m registering two point clouds in the 3D space, the transformation model is Bspline while the metric used is the euclidean distance be…

---

## [Different behavior between Release and Debug for treating uninitialized memory](https://discourse.itk.org/t/different-behavior-between-release-and-debug-for-treating-uninitialized-memory/559)

<div class="topic-metadata">

**Author:** [@Rock\_Lin](https://discourse.itk.org/u/Rock_Lin)\
**Replies:** 4\
**Last updated:** [January 4, 2018, 3:14am UTC](https://discourse.itk.org/t/different-behavior-between-release-and-debug-for-treating-uninitialized-memory/559 "2018-01-04T03:14:07Z")

</div>

Hi All, I am confused by different behavior between Release and Debug configuration for treating uninitialized memory within itk image. My development environment is shown as follows: OS: Windows 7 64 bit SP1 IDE: Vis…

---

## [How to clear pipeline from memory](https://discourse.itk.org/t/how-to-clear-pipeline-from-memory/406)

<div class="topic-metadata">

**Author:** [@benjaminhon](https://discourse.itk.org/u/benjaminhon)\
**Replies:** 2\
**Last updated:** [January 2, 2018, 2:41pm UTC](https://discourse.itk.org/t/how-to-clear-pipeline-from-memory/406 "2018-01-02T14:41:49Z")

</div>

Hi, I notice that I have a memory build up then eventually crashes my program after calling load about 3 times. Everything I call load it will create new pipelines and eventually ends in a VTK image viewer. there is onl…

---

## [get gray values that are mapped to color LUT](https://discourse.itk.org/t/get-gray-values-that-are-mapped-to-color-lut/558)

<div class="topic-metadata">

**Author:** [@swetha.bsharma](https://discourse.itk.org/u/swetha.bsharma)\
**Replies:** 1\
**Last updated:** [December 29, 2017, 2:52pm UTC](https://discourse.itk.org/t/get-gray-values-that-are-mapped-to-color-lut/558 "2017-12-29T14:52:03Z")

</div>

Hi All, I have an MRI dicom which I am reading ,it has values from 0-4096 which is mapped to color lut map.I want to get the gray values which are mapped to lut because I want to do some processing over the gray valu…

---

## [Compare two images of any kind](https://discourse.itk.org/t/compare-two-images-of-any-kind/543)

<div class="topic-metadata">

**Author:** [@mschwier](https://discourse.itk.org/u/mschwier)\
**Replies:** 3\
**Last updated:** [December 28, 2017, 8:46pm UTC](https://discourse.itk.org/t/compare-two-images-of-any-kind/543 "2017-12-28T20:46:39Z")

</div>

Is there an easy way to compare two images for equality that also supports Vector Images? Right now I am using the old itkTestMain.h :confused: which uses the itkTestingComparisonImageFilter and does not support Vector …

---

## [Change ConnectedComponentImageFilter Mask Shape](https://discourse.itk.org/t/change-connectedcomponentimagefilter-mask-shape/498)

<div class="topic-metadata">

**Author:** [@arwtyxouymz](https://discourse.itk.org/u/arwtyxouymz)\
**Replies:** 10\
**Last updated:** [December 22, 2017, 5:17pm UTC](https://discourse.itk.org/t/change-connectedcomponentimagefilter-mask-shape/498 "2017-12-22T17:17:41Z")

</div>

Hi, I’m a newer of itk. I use ConnectedComponentImageFilter to label my image, Default mask shape is probably 4 neighborhood, but i want to change the shape to 8 or 16 neighborhood. How should i do? Please help me!

---

## [Python wheels supported image types](https://discourse.itk.org/t/python-wheels-supported-image-types/253)

<div class="topic-metadata">

**Author:** [@mafuentes](https://discourse.itk.org/u/mafuentes)\
**Replies:** 10\
**Last updated:** [December 18, 2017, 7:40pm UTC](https://discourse.itk.org/t/python-wheels-supported-image-types/253 "2017-12-18T19:40:45Z")

</div>

I am testing the ITK python package from PyPi (thanks for that :+1::+1:) and I’m trying to read a 2D 16-bit image with the itk.imread function. There is no Unsigned Short (US) type available for that… any alternatives?

---

## [Smoothing Surface](https://discourse.itk.org/t/smoothing-surface/506)

<div class="topic-metadata">

**Author:** [@Henan](https://discourse.itk.org/u/Henan)\
**Replies:** 1\
**Last updated:** [December 13, 2017, 8:46pm UTC](https://discourse.itk.org/t/smoothing-surface/506 "2017-12-13T20:46:46Z")

</div>

Hi, I met a problem when using itkSmoothingQuadEdgeMeshFilter. I want to use this filter to smooth a mesh, and I want to have a new mesh which is outside the original one. However, the new mesh I got is inside the ori…

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

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