# Beginner Questions

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

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

**Page:** 26

---

## [Adding Patient position tag in each slice while writing a dicom series](https://discourse.itk.org/t/adding-patient-position-tag-in-each-slice-while-writing-a-dicom-series/3467)

<div class="topic-metadata">

**Author:** [@Hasna](https://discourse.itk.org/u/Hasna)\
**Replies:** 6\
**Last updated:** [September 18, 2020, 3:21pm UTC](https://discourse.itk.org/t/adding-patient-position-tag-in-each-slice-while-writing-a-dicom-series/3467 "2020-09-18T15:21:14Z")

</div>

Hi, I am trying generate a dicom series from volume data. How can should i give the patient position tag ,orientation tag and pixel spacing tag for each slice? Should I add them in a loop? I could not find any example…

---

## [Change Pixel values of Images where expression](https://discourse.itk.org/t/change-pixel-values-of-images-where-expression/3465)

<div class="topic-metadata">

**Author:** [@reox](https://discourse.itk.org/u/reox)\
**Replies:** 4\
**Last updated:** [September 17, 2020, 12:43pm UTC](https://discourse.itk.org/t/change-pixel-values-of-images-where-expression/3465 "2020-09-17T12:43:13Z")

</div>

For example, I want to set all pixel values of an image to 1 where the current pixel value is \>1. In numpy, this could be done in the following way: x\[x \> 1\] = 1 However, for Images that does not work: # x -\> SimpleI…

---

## [link error. ld: library not found for -lITKVideoIO](https://discourse.itk.org/t/link-error-ld-library-not-found-for-litkvideoio/3461)

<div class="topic-metadata">

**Author:** [@kaiyan\_liu](https://discourse.itk.org/u/kaiyan_liu)\
**Replies:** 1\
**Last updated:** [September 14, 2020, 4:37pm UTC](https://discourse.itk.org/t/link-error-ld-library-not-found-for-litkvideoio/3461 "2020-09-14T16:37:00Z")

</div>

I’m new here for ITK. And I have tried to install ITK-5.2.0 My environment version is as follows : OS:macOS 10.15.6. CMake 3.17.3 Make 3.81 clang 6.0.0 I try to compile and install ITK as the guidebook (ItkSoftwareGuid…

---

## [How to write a DicomVolume from a DicomSeries without losing Header Infos.](https://discourse.itk.org/t/how-to-write-a-dicomvolume-from-a-dicomseries-without-losing-header-infos/3443)

<div class="topic-metadata">

**Author:** [@Amnesie](https://discourse.itk.org/u/Amnesie)\
**Replies:** 16\
**Last updated:** [September 12, 2020, 6:14am UTC](https://discourse.itk.org/t/how-to-write-a-dicomvolume-from-a-dicomseries-without-losing-header-infos/3443 "2020-09-12T06:14:46Z")

</div>

Hi everyone, I have read the DicomSeriesReadImageWrite2 example . It did work but i noticed the Dicom-header Infos are “losted”. All of slices have the same Dicom-header Infos and pixel spacing will be default 1. I ti…

---

## [read dicom series image by http](https://discourse.itk.org/t/read-dicom-series-image-by-http/3453)

<div class="topic-metadata">

**Author:** [@laoniu2020](https://discourse.itk.org/u/laoniu2020)\
**Replies:** 0\
**Last updated:** [September 9, 2020, 8:41am UTC](https://discourse.itk.org/t/read-dicom-series-image-by-http/3453 "2020-09-09T08:41:54Z")

</div>

env: vtk.js itk.js I have dicom images on the server. And I need to request images by http for vtk pipline. I cannot find the vtk method to archieve this goal. So I want to do this by itk and then convert to vtk image. …

---

## [region of interest](https://discourse.itk.org/t/region-of-interest/3451)

<div class="topic-metadata">

**Author:** [@mumu](https://discourse.itk.org/u/mumu)\
**Replies:** 1\
**Last updated:** [September 9, 2020, 2:57pm UTC](https://discourse.itk.org/t/region-of-interest/3451 "2020-09-09T14:57:05Z")

</div>

In the ImageReadRegionOfInterestWrite.cxx example, where start\[0\]=atoi(argv\[3\]);start\[1\]=atoi(argv\[4\]);size\[0\]=atoi(\[argv\[5\]\]);size \[1\]=atoi(\[argv\[6\]\]) What should I fill in?

---

## [GPU filter (anisotropic diffusion) pipeline - memory allocation issue (itk-4.7.0)](https://discourse.itk.org/t/gpu-filter-anisotropic-diffusion-pipeline-memory-allocation-issue-itk-4-7-0/3439)

<div class="topic-metadata">

**Author:** [@phil](https://discourse.itk.org/u/phil)\
**Replies:** 1\
**Last updated:** [September 7, 2020, 1:53pm UTC](https://discourse.itk.org/t/gpu-filter-anisotropic-diffusion-pipeline-memory-allocation-issue-itk-4-7-0/3439 "2020-09-07T13:53:08Z")

</div>

Dear all, I’m using not the newest version of ITK (4.7.0) because I’ve some older code framework where an upgrade to a more recent ITK version is only planned beginning of next year. Still, I hope you can help me with …

---

## [Xray visualization problem (monochrome2)](https://discourse.itk.org/t/xray-visualization-problem-monochrome2/3440)

<div class="topic-metadata">

**Author:** [@Gokce\_Guven](https://discourse.itk.org/u/Gokce_Guven)\
**Replies:** 1\
**Last updated:** [September 6, 2020, 9:56pm UTC](https://discourse.itk.org/t/xray-visualization-problem-monochrome2/3440 "2020-09-06T21:56:16Z")

</div>

Hi, I tried to resample an xray image which has a monochrome2 type photometric interpretation (data type: uint16). I couldn’t create an image. By using pydicom, I managed to visualize with pixel array functionality. xr…

---

## [Mismatch of image view and its actual dimensions](https://discourse.itk.org/t/mismatch-of-image-view-and-its-actual-dimensions/3433)

<div class="topic-metadata">

**Author:** [@a10227](https://discourse.itk.org/u/a10227)\
**Replies:** 2\
**Last updated:** [September 4, 2020, 1:13pm UTC](https://discourse.itk.org/t/mismatch-of-image-view-and-its-actual-dimensions/3433 "2020-09-04T13:13:25Z")

</div>

I noticed a mismatch between the image dimensions and its view in ITKSnap (in other viewers the view is the same as in ITKSnap). The dimension of the image is 512 \* 233. On the left side is the image view in ITKSnap, on …

---

## [Using DCMTK](https://discourse.itk.org/t/using-dcmtk/3416)

<div class="topic-metadata">

**Author:** [@grsabourin](https://discourse.itk.org/u/grsabourin)\
**Replies:** 2\
**Last updated:** [August 28, 2020, 6:11pm UTC](https://discourse.itk.org/t/using-dcmtk/3416 "2020-08-28T18:11:19Z")

</div>

Hi, I’m trying to compile a simple application to be able to read images from DCMTK. For now this application contains no code instead of a main #include “itkImage.h” #include “itkDCMTKImageIO.h” int main ( ) { ret…

---

## [add alpha channel to an image in simpleitk](https://discourse.itk.org/t/add-alpha-channel-to-an-image-in-simpleitk/2665)

<div class="topic-metadata">

**Author:** [@kayarre](https://discourse.itk.org/u/kayarre)\
**Replies:** 1\
**Last updated:** [January 31, 2020, 2:09pm UTC](https://discourse.itk.org/t/add-alpha-channel-to-an-image-in-simpleitk/2665 "2020-01-31T14:09:13Z")

</div>

I have a group of rgb images and want to add an alpha channel, but am not sure how to do that or where to look? is the easiest option to create an empty rgba file with similar attributes as the rgb file and copy the rgb…

---

## [Build error: undefined reference](https://discourse.itk.org/t/build-error-undefined-reference/3406)

<div class="topic-metadata">

**Author:** [@yuhuimoon](https://discourse.itk.org/u/yuhuimoon)\
**Replies:** 2\
**Last updated:** [August 26, 2020, 3:07pm UTC](https://discourse.itk.org/t/build-error-undefined-reference/3406 "2020-08-26T15:07:13Z")

</div>

I have configured the ITK5.1.0 with cmake-gui and generated the makefile successfully. I use Qt5.12.4. CMAKE\_BUILD\_TYPE I select is Debug. The VTK library I link is 9.0.1 with Debug. I check the option Module\_ITKVtkGlue,…

---

## [The Similarity Measure](https://discourse.itk.org/t/the-similarity-measure/3399)

<div class="topic-metadata">

**Author:** [@TJH123456](https://discourse.itk.org/u/TJH123456)\
**Replies:** 10\
**Last updated:** [August 24, 2020, 4:18pm UTC](https://discourse.itk.org/t/the-similarity-measure/3399 "2020-08-24T16:18:30Z")

</div>

Hello I have a question. In the similarity measure, there is a “jointhistogrammutualinformation”. I want to know whether this is to calculate the mutual information value, rather than calculate the derived value of mutu…

---

## [Doubts about evaluating metric](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400)

<div class="topic-metadata">

**Author:** [@TJH123456](https://discourse.itk.org/u/TJH123456)\
**Replies:** 4\
**Last updated:** [August 19, 2020, 2:24pm UTC](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400 "2020-08-19T14:24:29Z")

</div>

Hello I have a very confused question. When calculating the similarity of two identical images, the value obtained should be 1 or greater than 1 (because I don’t know whether the value is normalized or not), but a very …

---

## [itkToVtkImageFilter: Why is the resulting image upside down?](https://discourse.itk.org/t/itktovtkimagefilter-why-is-the-resulting-image-upside-down/3373)

<div class="topic-metadata">

**Author:** [@msrepo](https://discourse.itk.org/u/msrepo)\
**Replies:** 5\
**Last updated:** [August 14, 2020, 11:22am UTC](https://discourse.itk.org/t/itktovtkimagefilter-why-is-the-resulting-image-upside-down/3373 "2020-08-14T11:22:31Z")

</div>

Hi all, I ran this code which uses itktovtkglue to render an image. I do not understand why the resulting image in the window is upside down(flipped)? Using a QuickView viewer gives the option to revert back but what cou…

---

## [sitkBSpline vs sitkBSplineResampler](https://discourse.itk.org/t/sitkbspline-vs-sitkbsplineresampler/3390)

<div class="topic-metadata">

**Author:** [@reox](https://discourse.itk.org/u/reox)\
**Replies:** 5\
**Last updated:** [August 14, 2020, 5:23am UTC](https://discourse.itk.org/t/sitkbspline-vs-sitkbsplineresampler/3390 "2020-08-14T05:23:03Z")

</div>

I noticed that when resampling an image using sitkBSpline, the background would not always be zero. Here is an example: import SimpleITK as sitk import numpy as np x = np.zeros((20,20)) x\[5:15,5:15\] = 1 img = sitk.GetI…

---

## [Median Filter for 3d data](https://discourse.itk.org/t/median-filter-for-3d-data/3376)

<div class="topic-metadata">

**Author:** [@Hasna](https://discourse.itk.org/u/Hasna)\
**Replies:** 8\
**Last updated:** [August 12, 2020, 11:45am UTC](https://discourse.itk.org/t/median-filter-for-3d-data/3376 "2020-08-12T11:45:13Z")

</div>

Hi all, Is there median filter which works with 3D data in itk?

---

## [How to determine the order of the translation, rotation, and scaling in affine transform.](https://discourse.itk.org/t/how-to-determine-the-order-of-the-translation-rotation-and-scaling-in-affine-transform/3380)

<div class="topic-metadata">

**Author:** [@yongjun\_wang](https://discourse.itk.org/u/yongjun_wang)\
**Replies:** 2\
**Last updated:** [August 12, 2020, 5:20am UTC](https://discourse.itk.org/t/how-to-determine-the-order-of-the-translation-rotation-and-scaling-in-affine-transform/3380 "2020-08-12T05:20:46Z")

</div>

If it includes translation, rotation, and scaling at the same time, how to determine the order of the three transformations? Thinks!

---

## [Extract Overlapping Patches from a 3D Medical image and reconstruct the patches back to an Image](https://discourse.itk.org/t/extract-overlapping-patches-from-a-3d-medical-image-and-reconstruct-the-patches-back-to-an-image/3368)

<div class="topic-metadata">

**Author:** [@DL\_Begin](https://discourse.itk.org/u/DL_Begin)\
**Replies:** 3\
**Last updated:** [August 7, 2020, 6:33pm UTC](https://discourse.itk.org/t/extract-overlapping-patches-from-a-3d-medical-image-and-reconstruct-the-patches-back-to-an-image/3368 "2020-08-07T18:33:30Z")

</div>

Hello, I have a 3D CT image size of shape 284,143,143 and I want to extract 3D patches of size 64x64x64. Is there a way I can extract the patches from this volumetric image and reconstruct patches back. I have been usi…

---

## [Question about ImageType::Pointer](https://discourse.itk.org/t/question-about-imagetype-pointer/3364)

<div class="topic-metadata">

**Author:** [@totoro3y](https://discourse.itk.org/u/totoro3y)\
**Replies:** 4\
**Last updated:** [August 6, 2020, 9:33am UTC](https://discourse.itk.org/t/question-about-imagetype-pointer/3364 "2020-08-06T09:33:28Z")

</div>

I am using the c++ library of ITK and I am trying to fulfill my first script of reading images. I ref https://itk.org/ITKExamples/src/IO/ImageBase/ReadAnImage/Documentation.html?highlight=read%20image for my codes. And I…

---

## [registration is too slow and changing sample rate seems not working](https://discourse.itk.org/t/registration-is-too-slow-and-changing-sample-rate-seems-not-working/3356)

<div class="topic-metadata">

**Author:** [@aweib](https://discourse.itk.org/u/aweib)\
**Replies:** 2\
**Last updated:** [August 4, 2020, 1:55am UTC](https://discourse.itk.org/t/registration-is-too-slow-and-changing-sample-rate-seems-not-working/3356 "2020-08-04T01:55:37Z")

</div>

Hello everyone, I’m using ITK for 3D brain image registration, but the registration is too slow. I try to change the sample rate but it seems not working, reducing sample rate does not affect the registration speed. It …

---

## [Stack images in bottom to top manner](https://discourse.itk.org/t/stack-images-in-bottom-to-top-manner/3352)

<div class="topic-metadata">

**Author:** [@Hasna\_R](https://discourse.itk.org/u/Hasna_R)\
**Replies:** 5\
**Last updated:** [August 3, 2020, 4:19pm UTC](https://discourse.itk.org/t/stack-images-in-bottom-to-top-manner/3352 "2020-08-03T16:19:21Z")

</div>

Hi, I have 500 y slices of size 500 X 1000. I want to generate a volume of size 500,500,1000 \[1000 images with size 500X500\]. When I used paste filter ,i was not able to paste these slices in y direction. But I was abl…

---

## [Registration and StreamingImageFilter](https://discourse.itk.org/t/registration-and-streamingimagefilter/3347)

<div class="topic-metadata">

**Author:** [@marvin67](https://discourse.itk.org/u/marvin67)\
**Replies:** 2\
**Last updated:** [August 3, 2020, 10:16am UTC](https://discourse.itk.org/t/registration-and-streamingimagefilter/3347 "2020-08-03T10:16:08Z")

</div>

Hello, I need to register multi GB 3D images and my workstation is running out of memory all the time. In the documentation I have found the class StreamingImageFilter that can be used to process large images piece by pi…

---

## [Non-rigid registration in simpleITK: please help](https://discourse.itk.org/t/non-rigid-registration-in-simpleitk-please-help/3344)

<div class="topic-metadata">

**Author:** [@nvladimus](https://discourse.itk.org/u/nvladimus)\
**Replies:** 10\
**Last updated:** [July 30, 2020, 9:33pm UTC](https://discourse.itk.org/t/non-rigid-registration-in-simpleitk-please-help/3344 "2020-07-30T21:33:23Z")

</div>

Hi, everyone, I am trying to register (non-rigidly) two volumes of microscopy images, a head of C.elegans worm imaged with lightsheet microscope from two different directions. I managed to register them rigidly, but any…

---

## [resample the registered moving image](https://discourse.itk.org/t/resample-the-registered-moving-image/3323)

<div class="topic-metadata">

**Author:** [@TJH123456](https://discourse.itk.org/u/TJH123456)\
**Replies:** 8\
**Last updated:** [July 28, 2020, 9:01am UTC](https://discourse.itk.org/t/resample-the-registered-moving-image/3323 "2020-07-28T09:01:46Z")

</div>

Hello I want to resample the registered moving image, set the angle to and the translation amount remains unchanged, but I’m not sure if I’m right. Should I set the conversion parameter to (0,0,0,0,0) or (0,0,0, x, y, z…

---

## [setparameters](https://discourse.itk.org/t/setparameters/3331)

<div class="topic-metadata">

**Author:** [@TJH123456](https://discourse.itk.org/u/TJH123456)\
**Replies:** 2\
**Last updated:** [July 28, 2020, 7:50am UTC](https://discourse.itk.org/t/setparameters/3331 "2020-07-28T07:50:47Z")

</div>

Hello If I set the setparameters function in the simpleitk package to (1, 0, 0, 0, 0, 0), how many degrees does the image rotate? thank you.

---

## [Don't lose data with rotation?](https://discourse.itk.org/t/dont-lose-data-with-rotation/3325)

<div class="topic-metadata">

**Author:** [@radiplab](https://discourse.itk.org/u/radiplab)\
**Replies:** 2\
**Last updated:** [July 24, 2020, 7:21pm UTC](https://discourse.itk.org/t/dont-lose-data-with-rotation/3325 "2020-07-24T19:21:13Z")

</div>

Hello. I’m rotating CTs with a Euler3DTransform. Currently any data that rotates out of the image array is lost. I’ve compensated for this by adding blank columns/rows/slices before rotating, and then taking away blank d…

---

## [Question about CompositeTransform](https://discourse.itk.org/t/question-about-compositetransform/3326)

<div class="topic-metadata">

**Author:** [@ktsumura](https://discourse.itk.org/u/ktsumura)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 9:25pm UTC](https://discourse.itk.org/t/question-about-compositetransform/3326 "2020-07-23T21:25:02Z")

</div>

Hi, I have a question on CompositeTransform. The description of CompositeTransform says " This class concatenates transforms in reverse queue order by means of composition". I am wondering why the reverse queue is us…

---

## [Registration to get rid of slices containing part of the body not found in other scan](https://discourse.itk.org/t/registration-to-get-rid-of-slices-containing-part-of-the-body-not-found-in-other-scan/3313)

<div class="topic-metadata">

**Author:** [@ibro45](https://discourse.itk.org/u/ibro45)\
**Replies:** 3\
**Last updated:** [July 22, 2020, 1:59pm UTC](https://discourse.itk.org/t/registration-to-get-rid-of-slices-containing-part-of-the-body-not-found-in-other-scan/3313 "2020-07-22T13:59:56Z")

</div>

\[SimpleITK, Python, Registration\] I have a dataset of CT and CBCT scans; CBCTs don’t have a limited FOV, but they do contain a smaller portion of body compared to CT, i.e. they have less slices than CT scans. What I wa…

---

## [Save a displacement field as a nifti image with SimpleITK in Python](https://discourse.itk.org/t/save-a-displacement-field-as-a-nifti-image-with-simpleitk-in-python/3320)

<div class="topic-metadata">

**Author:** [@CYY](https://discourse.itk.org/u/CYY)\
**Replies:** 3\
**Last updated:** [July 22, 2020, 1:45pm UTC](https://discourse.itk.org/t/save-a-displacement-field-as-a-nifti-image-with-simpleitk-in-python/3320 "2020-07-22T13:45:33Z")

</div>

Hello everyone, I am a beginner of SimpleITK in python. I’ve saw that SimpleITK could save a displacement field as an image but I didn’t find how to do it. So are there anyone can help me please? Thank you very much.

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

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