# Beginner Questions

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

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

**Page:** 8

---

## [Error in plotting multi-slice images in SimpleITK (Jupyter Notebook)](https://discourse.itk.org/t/error-in-plotting-multi-slice-images-in-simpleitk-jupyter-notebook/6279)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 1\
**Last updated:** [November 4, 2023, 3:59pm UTC](https://discourse.itk.org/t/error-in-plotting-multi-slice-images-in-simpleitk-jupyter-notebook/6279 "2023-11-04T15:59:09Z")

</div>

I newly configured SimpleITK in my laptop. While test-running a few example codes, the following error is showing. This is happening only in case of images with multiple slices and the interactive images. I checked a…

---

## [How to read .img file in SimpleITK?](https://discourse.itk.org/t/how-to-read-img-file-in-simpleitk/6265)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 2\
**Last updated:** [October 27, 2023, 8:38pm UTC](https://discourse.itk.org/t/how-to-read-img-file-in-simpleitk/6265 "2023-10-27T20:38:14Z")

</div>

I have downloaded 4D CT data from DIRLAB image database. The images are in .img format. I tried to read these images using sitk.ReadImage method. sitk.ReadImage(image\_file\_name, sitk.sitkFloat32). I am getting the …

---

## [Are there any instances about the registration of 3D medical image by landmark?](https://discourse.itk.org/t/are-there-any-instances-about-the-registration-of-3d-medical-image-by-landmark/6256)

<div class="topic-metadata">

**Author:** [@SeanHan](https://discourse.itk.org/u/SeanHan)\
**Replies:** 7\
**Last updated:** [October 23, 2023, 2:32pm UTC](https://discourse.itk.org/t/are-there-any-instances-about-the-registration-of-3d-medical-image-by-landmark/6256 "2023-10-23T14:32:11Z")

</div>

When I set LandmarkBasedTransformInitializer instead of CenteredTransformInitializer, it seems a wrong result. Any suggestions?

---

## [Non-rigid registration using BSpline transform throwing error](https://discourse.itk.org/t/non-rigid-registration-using-bspline-transform-throwing-error/6248)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 3\
**Last updated:** [October 13, 2023, 4:47pm UTC](https://discourse.itk.org/t/non-rigid-registration-using-bspline-transform-throwing-error/6248 "2023-10-13T16:47:41Z")

</div>

I am trying to register the POPI model using BSpline Transform (Code given in SimpleITK Tutorial - 06\_advanced\_registration.ipynb). However instead of TRE used in the Tutorial, I am trying to compute other accuracy metri…

---

## [TransformToDisplacementField Affine outputting similar but different transformation](https://discourse.itk.org/t/transformtodisplacementfield-affine-outputting-similar-but-different-transformation/6245)

<div class="topic-metadata">

**Author:** [@CrownMella](https://discourse.itk.org/u/CrownMella)\
**Replies:** 6\
**Last updated:** [October 5, 2023, 7:27pm UTC](https://discourse.itk.org/t/transformtodisplacementfield-affine-outputting-similar-but-different-transformation/6245 "2023-10-05T19:27:50Z")

</div>

Hi all, I’m trying to convert an affine transformation into a displacement field using the code below: sitk.WriteTransform(aft1, 'aft1.txt') df = sitk.TransformToDisplacementFieldFilter() df.SetReferenceImage(moving\_im…

---

## [Incorrect registered image](https://discourse.itk.org/t/incorrect-registered-image/6243)

<div class="topic-metadata">

**Author:** [@pratibha](https://discourse.itk.org/u/pratibha)\
**Replies:** 3\
**Last updated:** [October 5, 2023, 1:07pm UTC](https://discourse.itk.org/t/incorrect-registered-image/6243 "2023-10-05T13:07:17Z")

</div>

I have moving image of size 256x256x11 and fixed image of 512x512x512 which is the template image. I just want to register the moving to fixed space. I am getting improper registered image. The sample of the output is gi…

---

## [Got the runtime error, Did not get requested region!](https://discourse.itk.org/t/got-the-runtime-error-did-not-get-requested-region/6226)

<div class="topic-metadata">

**Author:** [@pratibha](https://discourse.itk.org/u/pratibha)\
**Replies:** 2\
**Last updated:** [September 25, 2023, 4:10pm UTC](https://discourse.itk.org/t/got-the-runtime-error-did-not-get-requested-region/6226 "2023-09-25T16:10:00Z")

</div>

Hello, I am new to itk-elastix and the registration process. I am doing the rigid registration, the data type for both moving and fixed is float and I have used the already defined parameter file for registration. The pa…

---

## [What is the structure of HDF5 / h5 file](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200)

<div class="topic-metadata">

**Author:** [@m.ded](https://discourse.itk.org/u/m.ded)\
**Replies:** 4\
**Last updated:** [September 22, 2023, 8:43pm UTC](https://discourse.itk.org/t/what-is-the-structure-of-hdf5-h5-file/6200 "2023-09-22T20:43:48Z")

</div>

I use ANTs GitHub - ANTsX/ANTs: Advanced Normalization Tools (ANTs) to to create deformation fields in HDF5 format. ANTs h5 transform files come from the ITK underlying IO system. I would like to understand the struct…

---

## [ITKModuleExternal.cmake is not published with sudo make install](https://discourse.itk.org/t/itkmoduleexternal-cmake-is-not-published-with-sudo-make-install/6208)

<div class="topic-metadata">

**Author:** [@yziquel](https://discourse.itk.org/u/yziquel)\
**Replies:** 2\
**Last updated:** [September 22, 2023, 8:27pm UTC](https://discourse.itk.org/t/itkmoduleexternal-cmake-is-not-published-with-sudo-make-install/6208 "2023-09-22T20:27:06Z")

</div>

Hi. I’ve got an issue that is reported in the following github issues: Roughly put: I am trying to build ITK and itk-wasm from source, living on the git repo head. The ITKModuleExternal.cmake file is supposed to com…

---

## [How to remove CT bed from 3D CT image?](https://discourse.itk.org/t/how-to-remove-ct-bed-from-3d-ct-image/6219)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 6\
**Last updated:** [September 22, 2023, 3:52pm UTC](https://discourse.itk.org/t/how-to-remove-ct-bed-from-3d-ct-image/6219 "2023-09-22T15:52:01Z")

</div>

I have 3D CT image of the head (DICOM image). It looks like the following. I want to remove the imaging machine from the image. Is there any function in SimpleITK, which does this? I saw a previous query similar to …

---

## [Arrays of individual connected components](https://discourse.itk.org/t/arrays-of-individual-connected-components/6065)

<div class="topic-metadata">

**Author:** [@Sean\_Hatton](https://discourse.itk.org/u/Sean_Hatton)\
**Replies:** 13\
**Last updated:** [September 22, 2023, 3:06pm UTC](https://discourse.itk.org/t/arrays-of-individual-connected-components/6065 "2023-09-22T15:06:16Z")

</div>

Using connected components, I am iterating through a 3D image with several blobs. I need the array/mesh of each components, how can I do this without writing too much to disk? I can get individual stats, I need the indiv…

---

## [How to read resting state fMRI image using SimpleITK?](https://discourse.itk.org/t/how-to-read-resting-state-fmri-image-using-simpleitk/6209)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 0\
**Last updated:** [September 15, 2023, 7:47am UTC](https://discourse.itk.org/t/how-to-read-resting-state-fmri-image-using-simpleitk/6209 "2023-09-15T07:47:09Z")

</div>

I have a fMRI image of size 64,64,39,192. It is in nii.gz format. What is the process to read this image in SimpleITK? sitk.ReadImage is showing the following error. TypeError: Invalid shape (39, 64, 64) for image data

---

## [How to convert .nii image to dicom?](https://discourse.itk.org/t/how-to-convert-nii-image-to-dicom/6197)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 15\
**Last updated:** [September 14, 2023, 5:16pm UTC](https://discourse.itk.org/t/how-to-convert-nii-image-to-dicom/6197 "2023-09-14T17:16:31Z")

</div>

I have downloaded a brain image dataset, where images are in .nii format. Please tell me how to convert these images to .dicom format, without any loss of image information.

---

## [how to label MRI images for classification task?](https://discourse.itk.org/t/how-to-label-mri-images-for-classification-task/6203)

<div class="topic-metadata">

**Author:** [@Uljibuh](https://discourse.itk.org/u/Uljibuh)\
**Replies:** 2\
**Last updated:** [September 14, 2023, 2:10pm UTC](https://discourse.itk.org/t/how-to-label-mri-images-for-classification-task/6203 "2023-09-14T14:10:57Z")

</div>

Hi all, I am working on a prostate cancer classification task using both ADC and DWI images for each patient in nii format. the task is to tell whether the patient has the cancer or not, ie, positive or negative. and…

---

## [SimpleITK incorrectly identifies DICOM pixel type](https://discourse.itk.org/t/simpleitk-incorrectly-identifies-dicom-pixel-type/6185)

<div class="topic-metadata">

**Author:** [@mherron](https://discourse.itk.org/u/mherron)\
**Replies:** 6\
**Last updated:** [September 12, 2023, 8:45pm UTC](https://discourse.itk.org/t/simpleitk-incorrectly-identifies-dicom-pixel-type/6185 "2023-09-12T20:45:38Z")

</div>

I’m a developer on a software package that has started using SimpleITK to read in various image types. We have an explicit list of pixel types that we support, and if, after reading an image using SimpleITK, we find that…

---

## [Fail to install SimpleElastix due to multiple definition](https://discourse.itk.org/t/fail-to-install-simpleelastix-due-to-multiple-definition/6194)

<div class="topic-metadata">

**Author:** [@Siji-chl](https://discourse.itk.org/u/Siji-chl)\
**Replies:** 1\
**Last updated:** [September 12, 2023, 2:47pm UTC](https://discourse.itk.org/t/fail-to-install-simpleelastix-due-to-multiple-definition/6194 "2023-09-12T14:47:34Z")

</div>

I follow the instruction from the official website $ git clone https://github.com/SuperElastix/SimpleElastix $ mkdir build $ cd build $ cmake ../SimpleElastix/SuperBuild $ make -j4 the make -j4 instructions did not wor…

---

## [How to change VascularNetwork.tre file from TubeTK into 0-1 mask?](https://discourse.itk.org/t/how-to-change-vascularnetwork-tre-file-from-tubetk-into-0-1-mask/6188)

<div class="topic-metadata">

**Author:** [@rzjiang0603](https://discourse.itk.org/u/rzjiang0603)\
**Replies:** 3\
**Last updated:** [September 11, 2023, 6:26pm UTC](https://discourse.itk.org/t/how-to-change-vascularnetwork-tre-file-from-tubetk-into-0-1-mask/6188 "2023-09-11T18:26:30Z")

</div>

I am trying to use the TubeTK dataset here https://public.kitware.com/Wiki/TubeTK/Data to do some intracranial vasculature segmentation task. Thus i need to use the VascularNetwork.tre file as the ground truth. The prob…

---

## [Resample to same Spacing and Size and Align to same Origin](https://discourse.itk.org/t/resample-to-same-spacing-and-size-and-align-to-same-origin/1378)

<div class="topic-metadata">

**Author:** [@ral\_san](https://discourse.itk.org/u/ral_san)\
**Replies:** 27\
**Last updated:** [September 8, 2023, 3:42pm UTC](https://discourse.itk.org/t/resample-to-same-spacing-and-size-and-align-to-same-origin/1378 "2023-09-08T15:42:04Z")

</div>

I have a set of 4 DICOM CT Volumes which I am reading with SimpleITK ImageSeriesReader. Two of the images represent the CT of patient before and after the surgery. The other two images are binary segmentation masks segme…

---

## [Add empty slice at the end of the CT image](https://discourse.itk.org/t/add-empty-slice-at-the-end-of-the-ct-image/6182)

<div class="topic-metadata">

**Author:** [@agatadefr](https://discourse.itk.org/u/agatadefr)\
**Replies:** 3\
**Last updated:** [September 7, 2023, 12:30pm UTC](https://discourse.itk.org/t/add-empty-slice-at-the-end-of-the-ct-image/6182 "2023-09-07T12:30:17Z")

</div>

Hello, I have a simple question. i need to resize CT scan saved in nifty file. I need to add one black slice at the end of the 3D image (in Z direction). I would appreciate for any help/suggestion. How can I do that i…

---

## [Setting up SimpleITK with anaconda](https://discourse.itk.org/t/setting-up-simpleitk-with-anaconda/6175)

<div class="topic-metadata">

**Author:** [@devo99](https://discourse.itk.org/u/devo99)\
**Replies:** 1\
**Last updated:** [September 4, 2023, 3:19pm UTC](https://discourse.itk.org/t/setting-up-simpleitk-with-anaconda/6175 "2023-09-04T15:19:07Z")

</div>

Hello there, I have been frustrated with getting SimpleITK working with jupyter past week. I have been following the instructions on this article : SimpleITK Tutorial . I have installed everything that is necessary. Ho…

---

## [ITKIOGDCM error with long dicom datasets](https://discourse.itk.org/t/itkiogdcm-error-with-long-dicom-datasets/6173)

<div class="topic-metadata">

**Author:** [@arvequina](https://discourse.itk.org/u/arvequina)\
**Replies:** 0\
**Last updated:** [September 1, 2023, 9:21am UTC](https://discourse.itk.org/t/itkiogdcm-error-with-long-dicom-datasets/6173 "2023-09-01T09:21:20Z")

</div>

Hi! First thank you to all the contributors in here as it is always super useful. Probably this one is more indicated for the GDCM guru @mathieu.malaterre :sweat\_smile: I ran into a problem using GDCM to read dicom file…

---

## [Issue with Visualizing predictions and Groundtruths after numpy to sitk conversion](https://discourse.itk.org/t/issue-with-visualizing-predictions-and-groundtruths-after-numpy-to-sitk-conversion/6167)

<div class="topic-metadata">

**Author:** [@rosanajurdi](https://discourse.itk.org/u/rosanajurdi)\
**Replies:** 2\
**Last updated:** [August 29, 2023, 2:39pm UTC](https://discourse.itk.org/t/issue-with-visualizing-predictions-and-groundtruths-after-numpy-to-sitk-conversion/6167 "2023-08-29T14:39:43Z")

</div>

Hello, I am running into an error whenever I try to visualize the predictions vs ground-truths with sitk . I have a probability map correspinding to the out put of the model, and a binary groundtruth (resamppled) and a…

---

## [Composite Transform with second Transform on resampled Image](https://discourse.itk.org/t/composite-transform-with-second-transform-on-resampled-image/6163)

<div class="topic-metadata">

**Author:** [@kenrickmoke](https://discourse.itk.org/u/kenrickmoke)\
**Replies:** 3\
**Last updated:** [August 29, 2023, 8:10am UTC](https://discourse.itk.org/t/composite-transform-with-second-transform-on-resampled-image/6163 "2023-08-29T08:10:13Z")

</div>

Hello Community, my question is regarding a cleaner way to combine multiple transforms where the latter transforms are optimized over the resampled image. So what I want to do smth like this: resampled = T1(fixed,movi…

---

## [Measure diameter of curved 3d tube](https://discourse.itk.org/t/measure-diameter-of-curved-3d-tube/6162)

<div class="topic-metadata">

**Author:** [@cams2b](https://discourse.itk.org/u/cams2b)\
**Replies:** 1\
**Last updated:** [August 24, 2023, 4:58pm UTC](https://discourse.itk.org/t/measure-diameter-of-curved-3d-tube/6162 "2023-08-24T16:58:26Z")

</div>

Hello everyone, I am working with a 3d curved tubular structure. I have extracted the centerline at various points and now I am trying to calculate the diameter of the tube at those points. At the curved regions, I am t…

---

## [Setting directional cosines](https://discourse.itk.org/t/setting-directional-cosines/6156)

<div class="topic-metadata">

**Author:** [@Krishna\_Nanda](https://discourse.itk.org/u/Krishna_Nanda)\
**Replies:** 2\
**Last updated:** [August 22, 2023, 5:20pm UTC](https://discourse.itk.org/t/setting-directional-cosines/6156 "2023-08-22T17:20:05Z")

</div>

Hello, I am a little unclear on how the directional cosines are set to create a new Simple ITK image. I understand that they should be in row major order. Is this correct: If we take a 2D example, the unit vector along …

---

## [How to do a standard FDK using itk-rtk in python.](https://discourse.itk.org/t/how-to-do-a-standard-fdk-using-itk-rtk-in-python/6141)

<div class="topic-metadata">

**Author:** [@Victor\_Hu](https://discourse.itk.org/u/Victor_Hu)\
**Replies:** 4\
**Last updated:** [August 19, 2023, 5:54am UTC](https://discourse.itk.org/t/how-to-do-a-standard-fdk-using-itk-rtk-in-python/6141 "2023-08-19T05:54:44Z")

</div>

I’m new to ITK and RTK. I’m so sad since there are not enough docs of RTK (in python). What I want to do is do a simple FDK reconstruction using a number of tif images with some geometry parameters. There are 360 tif fil…

---

## [Filter is doubling allocated memory (JAVA)](https://discourse.itk.org/t/filter-is-doubling-allocated-memory-java/6144)

<div class="topic-metadata">

**Author:** [@Salu\_Ramos](https://discourse.itk.org/u/Salu_Ramos)\
**Replies:** 16\
**Last updated:** [August 18, 2023, 7:50pm UTC](https://discourse.itk.org/t/filter-is-doubling-allocated-memory-java/6144 "2023-08-18T19:50:16Z")

</div>

my tests are being done with a series that has approximately 118MB. memory consumption of my software just by startup: after loading the series: this.reader.setFileNames(this.dicomFilesNames); this.series = reader…

---

## [Is it possible to convert to Hounsfield Units in Sitk?](https://discourse.itk.org/t/is-it-possible-to-convert-to-hounsfield-units-in-sitk/5061)

<div class="topic-metadata">

**Author:** [@DushiFdo](https://discourse.itk.org/u/DushiFdo)\
**Replies:** 5\
**Last updated:** [August 14, 2023, 12:56pm UTC](https://discourse.itk.org/t/is-it-possible-to-convert-to-hounsfield-units-in-sitk/5061 "2023-08-14T12:56:09Z")

</div>

Hi, Is there a function in SITK to convert the pixel values in dicom CT images to Hounsfield Units (HU) ? This is what I currently do: def transform\_to\_hu(slices): images = np.stack(\[file.pixel\_array for file in …

---

## [Cuberille Mesh](https://discourse.itk.org/t/cuberille-mesh/6130)

<div class="topic-metadata">

**Author:** [@CrownMella](https://discourse.itk.org/u/CrownMella)\
**Replies:** 13\
**Last updated:** [August 10, 2023, 6:41pm UTC](https://discourse.itk.org/t/cuberille-mesh/6130 "2023-08-10T18:41:51Z")

</div>

Hi, Is there a way to convert the mesh from cuberille image to mesh filter back to an image? I saw something like itk.TriangleMeshToBinaryImageFilter but my python brain doesnt understand how instance = itk.TriangleMes…

---

## [Are numpy arrays supported in the object-oriented API?](https://discourse.itk.org/t/are-numpy-arrays-supported-in-the-object-oriented-api/6137)

<div class="topic-metadata">

**Author:** [@AwesomeLemon](https://discourse.itk.org/u/AwesomeLemon)\
**Replies:** 4\
**Last updated:** [August 10, 2023, 5:21pm UTC](https://discourse.itk.org/t/are-numpy-arrays-supported-in-the-object-oriented-api/6137 "2023-08-10T17:21:49Z")

</div>

Input in the form of numpy arrays works with the procedural API but doesn’t work with the object-oriented API (I get “itk.ElastixRegistrationMethod is not wrapped for input type None”). Is that a known limitation or am …

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

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