# Beginner Questions

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

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

**Page:** 12

---

## [How to separate layers from a NRRD file?](https://discourse.itk.org/t/how-to-separate-layers-from-a-nrrd-file/5661)

<div class="topic-metadata">

**Author:** [@Sterben\_01](https://discourse.itk.org/u/Sterben_01)\
**Replies:** 2\
**Last updated:** [February 1, 2023, 12:18am UTC](https://discourse.itk.org/t/how-to-separate-layers-from-a-nrrd-file/5661 "2023-02-01T00:18:21Z")

</div>

Hi! I am a beginner of ITK/VTK. Currently, I have an NRRD file, and it has three layers. If I want to separate it and write it to three files, which class should I use? I know how to read and write, but I don’t know how…

---

## [Wrong header when reading a NIFTI file](https://discourse.itk.org/t/wrong-header-when-reading-a-nifti-file/5520)

<div class="topic-metadata">

**Author:** [@niruta](https://discourse.itk.org/u/niruta)\
**Replies:** 12\
**Last updated:** [January 25, 2023, 7:35am UTC](https://discourse.itk.org/t/wrong-header-when-reading-a-nifti-file/5520 "2023-01-25T07:35:26Z")

</div>

Hi, I am a beginner in SimpleITK. I used SimpleITK to load a nifti image and view its header information. The pixdim\[0\] header is changed from -1 to 0. I used ITKsnap, nifti-tool and nibabel to see the header informatio…

---

## [False Positive value](https://discourse.itk.org/t/false-positive-value/5640)

<div class="topic-metadata">

**Author:** [@Moha\_data](https://discourse.itk.org/u/Moha_data)\
**Replies:** 2\
**Last updated:** [January 24, 2023, 4:41pm UTC](https://discourse.itk.org/t/false-positive-value/5640 "2023-01-24T16:41:52Z")

</div>

I have a binary image (background = 0) and to see how False positive works, I applied the dilation to the image (as a test image) and calculated the False Positive. The left image is the reference and the right one is…

---

## [05 Basic Registration tutorial error](https://discourse.itk.org/t/05-basic-registration-tutorial-error/5649)

<div class="topic-metadata">

**Author:** [@Priscilla](https://discourse.itk.org/u/Priscilla)\
**Replies:** 4\
**Last updated:** [January 24, 2023, 3:44pm UTC](https://discourse.itk.org/t/05-basic-registration-tutorial-error/5649 "2023-01-24T15:44:38Z")

</div>

Hello, I’m following the SimpeITK MICCAI tutorial (2020), and I can’t reproduce the results in the Initialisation section of the notebook 05\_basic\_registration, because I get the following error: AttributeError: module…

---

## [Multimodal Registration of Dicom file in physical space (mm space)](https://discourse.itk.org/t/multimodal-registration-of-dicom-file-in-physical-space-mm-space/5639)

<div class="topic-metadata">

**Author:** [@gaurav\_patel](https://discourse.itk.org/u/gaurav_patel)\
**Replies:** 2\
**Last updated:** [January 23, 2023, 5:13am UTC](https://discourse.itk.org/t/multimodal-registration-of-dicom-file-in-physical-space-mm-space/5639 "2023-01-23T05:13:28Z")

</div>

I am new to simpleITK. My task is to register MR volume with CT volume. The CT volume is entire body while MR volume is abdomen only. Moreover MR volume is rotated i.e. direction cosines are not (1,0,0,1) from dicom IOP …

---

## [Need guidance to address the regression error ?](https://discourse.itk.org/t/need-guidance-to-address-the-regression-error/5569)

<div class="topic-metadata">

**Author:** [@parth721](https://discourse.itk.org/u/parth721)\
**Replies:** 14\
**Last updated:** [January 20, 2023, 2:48pm UTC](https://discourse.itk.org/t/need-guidance-to-address-the-regression-error/5569 "2023-01-20T14:48:41Z")

</div>

As a beginner I take up an issue, where I need to perform regression testing. In order to understand the code, I had read the ItkSoftwareGuide pdf, google about it, watch lectures on youtube about regression testing, as…

---

## [Can I look at label intensity histograms with SimpleITK?](https://discourse.itk.org/t/can-i-look-at-label-intensity-histograms-with-simpleitk/5634)

<div class="topic-metadata">

**Author:** [@Toby-Jackson](https://discourse.itk.org/u/Toby-Jackson)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 2:16pm UTC](https://discourse.itk.org/t/can-i-look-at-label-intensity-histograms-with-simpleitk/5634 "2023-01-20T14:16:36Z")

</div>

I have a label map and and corresponding image and would like to look at the intensity histograms for each or each label, I know that there is an intensity histogram being calculated behind the scenes, for example in sit…

---

## [Resampling along the z-axis of binary segmentation stack](https://discourse.itk.org/t/resampling-along-the-z-axis-of-binary-segmentation-stack/4286)

<div class="topic-metadata">

**Author:** [@caniko](https://discourse.itk.org/u/caniko)\
**Replies:** 8\
**Last updated:** [January 18, 2023, 3:15pm UTC](https://discourse.itk.org/t/resampling-along-the-z-axis-of-binary-segmentation-stack/4286 "2023-01-18T15:15:20Z")

</div>

I have a binary image stack or space of binarized voxels (either black or white voxels). Since my data is from electron microscopy the spacing of the pixels are (1, 1, Z) where (x, y, z), and Z is an arbitrary value def…

---

## [Placing a ball in a CT volume](https://discourse.itk.org/t/placing-a-ball-in-a-ct-volume/5632)

<div class="topic-metadata">

**Author:** [@User0](https://discourse.itk.org/u/User0)\
**Replies:** 4\
**Last updated:** [January 18, 2023, 8:09am UTC](https://discourse.itk.org/t/placing-a-ball-in-a-ct-volume/5632 "2023-01-18T08:09:42Z")

</div>

I’m trying to place a 25mm reference ball within a CT. I think I have a function that can create a ball in a volume that has the same shape and spacing as the CT. However, I tried adding, pasting and masking but the ball…

---

## [Gradient magnitude (0) in registration.](https://discourse.itk.org/t/gradient-magnitude-0-in-registration/2266)

<div class="topic-metadata">

**Author:** [@spic](https://discourse.itk.org/u/spic)\
**Replies:** 7\
**Last updated:** [January 17, 2023, 8:24am UTC](https://discourse.itk.org/t/gradient-magnitude-0-in-registration/2266 "2023-01-17T08:24:38Z")

</div>

I am trying to register 2 3D volumes. I know that there is significant (rigid) shift between the two images, but registration keep stopping after first iteration. The gradient value is zero at the first iteration! The me…

---

## [Resampling two volumes with different number of slices.](https://discourse.itk.org/t/resampling-two-volumes-with-different-number-of-slices/5051)

<div class="topic-metadata">

**Author:** [@DushiFdo](https://discourse.itk.org/u/DushiFdo)\
**Replies:** 10\
**Last updated:** [January 11, 2023, 4:45pm UTC](https://discourse.itk.org/t/resampling-two-volumes-with-different-number-of-slices/5051 "2023-01-11T16:45:29Z")

</div>

I have two CT volumetric scans for the same patient (for arterial and venous) with different number of slices. e.g. arterial scan has ~146 dicom images whereas venous scan has ~156 dicom images. I want to resample one p…

---

## [SimpleITK write Image to Dicom](https://discourse.itk.org/t/simpleitk-write-image-to-dicom/5594)

<div class="topic-metadata">

**Author:** [@jeffppp](https://discourse.itk.org/u/jeffppp)\
**Replies:** 4\
**Last updated:** [January 9, 2023, 2:18am UTC](https://discourse.itk.org/t/simpleitk-write-image-to-dicom/5594 "2023-01-09T02:18:04Z")

</div>

I had read a series Dicom in Image class and resample the pixel to 1x1x1. I want to write the resampled Image to Dicom. But I only found the example in python. In C#, how should I split the 3D image to 2D image like imag…

---

## [Issue with writing](https://discourse.itk.org/t/issue-with-writing/5607)

<div class="topic-metadata">

**Author:** [@EneaP](https://discourse.itk.org/u/EneaP)\
**Replies:** 1\
**Last updated:** [January 4, 2023, 2:39pm UTC](https://discourse.itk.org/t/issue-with-writing/5607 "2023-01-04T14:39:49Z")

</div>

I’ve tryied tu use SimpleITK library for filling hole in a 3D image but when I’m trying to write the image on disk, the code gives me this type of error. Can someone help me to solve this problem or know how what does it…

---

## [Save Segmentation as DICOM file with Simple ITK and Python](https://discourse.itk.org/t/save-segmentation-as-dicom-file-with-simple-itk-and-python/5593)

<div class="topic-metadata">

**Author:** [@riba](https://discourse.itk.org/u/riba)\
**Replies:** 3\
**Last updated:** [December 28, 2022, 2:02pm UTC](https://discourse.itk.org/t/save-segmentation-as-dicom-file-with-simple-itk-and-python/5593 "2022-12-28T14:02:47Z")

</div>

I want to write the image an numpy array (with zeros and ones only) which is the result of the segmentation of a CT image. How can I save it using sitk? I don’t know how to set some of the metadata as: high bit, bits al…

---

## [How to capture multiple transformations while using timeit](https://discourse.itk.org/t/how-to-capture-multiple-transformations-while-using-timeit/5589)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 1\
**Last updated:** [December 22, 2022, 2:33pm UTC](https://discourse.itk.org/t/how-to-capture-multiple-transformations-while-using-timeit/5589 "2022-12-22T14:33:50Z")

</div>

Hello, I am running intensity based image registration using SimpleITK. I am using timeit command, with 7 repetitions, to find out the mean time required by the registration process. I also want to find out the mean fi…

---

## [Merge different labels in a unique image](https://discourse.itk.org/t/merge-different-labels-in-a-unique-image/5580)

<div class="topic-metadata">

**Author:** [@EneaP](https://discourse.itk.org/u/EneaP)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 1:20pm UTC](https://discourse.itk.org/t/merge-different-labels-in-a-unique-image/5580 "2022-12-21T13:20:46Z")

</div>

Hi, I have 7 different labels in each 7 different binary images. All of these images are 3D images provided by CT scan, they have a number of slices and 512x512 number of pixels for each slices. I want to merge these sev…

---

## [How to transfer an image buffer to matlab image matrix](https://discourse.itk.org/t/how-to-transfer-an-image-buffer-to-matlab-image-matrix/5568)

<div class="topic-metadata">

**Author:** [@allen](https://discourse.itk.org/u/allen)\
**Replies:** 4\
**Last updated:** [December 18, 2022, 4:23pm UTC](https://discourse.itk.org/t/how-to-transfer-an-image-buffer-to-matlab-image-matrix/5568 "2022-12-18T16:23:15Z")

</div>

hello, i want to retrieve image data from itk image, and load it in matlab. transfer the data pixel by pixel is too slow, and there are no direct function like mxArray::new\_from\_buffer can do it, so i have an idea that …

---

## [From pydicom data format to simpleITK](https://discourse.itk.org/t/from-pydicom-data-format-to-simpleitk/5543)

<div class="topic-metadata">

**Author:** [@Naja](https://discourse.itk.org/u/Naja)\
**Replies:** 1\
**Last updated:** [December 2, 2022, 3:05pm UTC](https://discourse.itk.org/t/from-pydicom-data-format-to-simpleitk/5543 "2022-12-02T15:05:00Z")

</div>

Is there a way for me to load a list of pydicom images straight into simpleITK in python without having to save them locally first? I’m working on a auto-segmentation project where I receive two pydicom lists ( one PET …

---

## [Need help in resolving the error in "readImageDICOMFileSeries"](https://discourse.itk.org/t/need-help-in-resolving-the-error-in-readimagedicomfileseries/5561)

<div class="topic-metadata">

**Author:** [@shantanudeo](https://discourse.itk.org/u/shantanudeo)\
**Replies:** 0\
**Last updated:** [December 9, 2022, 11:05am UTC](https://discourse.itk.org/t/need-help-in-resolving-the-error-in-readimagedicomfileseries/5561 "2022-12-09T11:05:34Z")

</div>

Firstly, I am new to ITK-wasm and even JS. I am trying out an example to read DICOM image using ITK.js. I have followed “itk-read-dicom” on Glitch (https://glitch.com/edit/#!/itk-read-dicom?path=src%2Findex.js%3A27%3A3…

---

## [Writing DICOM Spacing Between Slices](https://discourse.itk.org/t/writing-dicom-spacing-between-slices/4552)

<div class="topic-metadata">

**Author:** [@wwwalewww](https://discourse.itk.org/u/wwwalewww)\
**Replies:** 5\
**Last updated:** [December 8, 2022, 2:15pm UTC](https://discourse.itk.org/t/writing-dicom-spacing-between-slices/4552 "2022-12-08T14:15:46Z")

</div>

Hello, I’m trying to write a DICOM series after some image processing, and to do that I’m following the code in the example. Since I upsampled the volume, the spacing between slices has changed and I added it to the ta…

---

## [Confocal images alignment issues](https://discourse.itk.org/t/confocal-images-alignment-issues/5550)

<div class="topic-metadata">

**Author:** [@Spiran](https://discourse.itk.org/u/Spiran)\
**Replies:** 3\
**Last updated:** [December 6, 2022, 5:02pm UTC](https://discourse.itk.org/t/confocal-images-alignment-issues/5550 "2022-12-06T17:02:46Z")

</div>

Hello, I am facing a problem with ITK alignment . More specifically, when I upload my images the outpout score before alignment is usually 0,05 to 0,1 after the registration the highest score that I got is 0.7 (after cr…

---

## [How to set pre-defined points in the fixed image in gui?](https://discourse.itk.org/t/how-to-set-pre-defined-points-in-the-fixed-image-in-gui/5519)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 5\
**Last updated:** [December 2, 2022, 6:53am UTC](https://discourse.itk.org/t/how-to-set-pre-defined-points-in-the-fixed-image-in-gui/5519 "2022-12-02T06:53:32Z")

</div>

Hello, I have a list of pre-defined co-ordinates written in a text file. I want to mark these co-ordinates in the fixed image in the gui. After the marked fixed image is obtained, the corresponding co-ordinates in t…

---

## [2D to 3D Registration](https://discourse.itk.org/t/2d-to-3d-registration/2112)

<div class="topic-metadata">

**Author:** [@svabhishek29](https://discourse.itk.org/u/svabhishek29)\
**Replies:** 21\
**Last updated:** [December 1, 2022, 5:16am UTC](https://discourse.itk.org/t/2d-to-3d-registration/2112 "2022-12-01T05:16:48Z")

</div>

hi, i was looking an example for registration of 2D images with 3D images, i can’t find any examples on this topic. can someone please direct me to an example or a library that can do this Thanks

---

## [Transformation of Image volumes of different MRI imaging techniques](https://discourse.itk.org/t/transformation-of-image-volumes-of-different-mri-imaging-techniques/5527)

<div class="topic-metadata">

**Author:** [@c.spanakis83](https://discourse.itk.org/u/c.spanakis83)\
**Replies:** 6\
**Last updated:** [November 30, 2022, 12:01am UTC](https://discourse.itk.org/t/transformation-of-image-volumes-of-different-mri-imaging-techniques/5527 "2022-11-30T00:01:12Z")

</div>

Hello. I want to apply an image registration on two brain MR T1images (say MRT1 A and MRT1 B after the names of the patients A and B). Additionally, A and B have their diffusion MRI brain image which are fully aligned wi…

---

## [WriteImage output not consistent](https://discourse.itk.org/t/writeimage-output-not-consistent/5526)

<div class="topic-metadata">

**Author:** [@Toby-Jackson](https://discourse.itk.org/u/Toby-Jackson)\
**Replies:** 4\
**Last updated:** [November 28, 2022, 12:54pm UTC](https://discourse.itk.org/t/writeimage-output-not-consistent/5526 "2022-11-28T12:54:46Z")

</div>

I’ve written a script that iterates over some images, and analyses those images with different parameter sets, saving the output to file. When running the code the output saved to file is inconsistent, and sometimes look…

---

## [Viewer: Show 3D numpy array with colours specified by array](https://discourse.itk.org/t/viewer-show-3d-numpy-array-with-colours-specified-by-array/5439)

<div class="topic-metadata">

**Author:** [@Kevin\_Sweeney](https://discourse.itk.org/u/Kevin_Sweeney)\
**Replies:** 5\
**Last updated:** [November 24, 2022, 2:52am UTC](https://discourse.itk.org/t/viewer-show-3d-numpy-array-with-colours-specified-by-array/5439 "2022-11-24T02:52:07Z")

</div>

I have a 3D numpy array (shape = (224, 224, 3)) which defines the RGB values at each pixel (uint8). How can I use ikwidgets.view() method to show this array using the RBG colours instead of a colourmap? Code: view(arr…

---

## [Connected components in python](https://discourse.itk.org/t/connected-components-in-python/1658)

<div class="topic-metadata">

**Author:** [@Krishna\_Nanda](https://discourse.itk.org/u/Krishna_Nanda)\
**Replies:** 12\
**Last updated:** [November 23, 2022, 4:49pm UTC](https://discourse.itk.org/t/connected-components-in-python/1658 "2022-11-23T16:49:58Z")

</div>

Hello all, I am very new to SimpleITK. I am trying to get all the connected components from a 3D binary image (including the pixel locations of the various components) with multiple masks. The 3D binary image is of “Ima…

---

## [How to create a binary mask from coordinates (indexes or physical)](https://discourse.itk.org/t/how-to-create-a-binary-mask-from-coordinates-indexes-or-physical/4611)

<div class="topic-metadata">

**Author:** [@Ervis](https://discourse.itk.org/u/Ervis)\
**Replies:** 5\
**Last updated:** [November 23, 2022, 4:22pm UTC](https://discourse.itk.org/t/how-to-create-a-binary-mask-from-coordinates-indexes-or-physical/4611 "2022-11-23T16:22:21Z")

</div>

Hi I am new to ITK , I am using SimpleITK in C#. I have planar closed contour , a set of coordinates. What I need to do is create a binary mask with the same dimensions spacing and origin as the original ITK Image. I …

---

## [Trouble viewing PET image (mha file) in SimpleITK](https://discourse.itk.org/t/trouble-viewing-pet-image-mha-file-in-simpleitk/5507)

<div class="topic-metadata">

**Author:** [@debapriya](https://discourse.itk.org/u/debapriya)\
**Replies:** 2\
**Last updated:** [November 23, 2022, 6:41am UTC](https://discourse.itk.org/t/trouble-viewing-pet-image-mha-file-in-simpleitk/5507 "2022-11-23T06:41:16Z")

</div>

Hello, I am using the following python code to view a PET and an MR image. fixed\_image = sitk.ReadImage("PET.mha", sitk.sitkFloat64) moving\_image = sitk.ReadImage("MR.mha", sitk.sitkFloat64) point\_acquisition\_interfac…

---

## [how to view mha file in Python](https://discourse.itk.org/t/how-to-view-mha-file-in-python/5515)

<div class="topic-metadata">

**Author:** [@Uljibuh](https://discourse.itk.org/u/Uljibuh)\
**Replies:** 2\
**Last updated:** [November 22, 2022, 6:16pm UTC](https://discourse.itk.org/t/how-to-view-mha-file-in-python/5515 "2022-11-22T18:16:26Z")

</div>

Hi all, a beginner here, I am working on prostate cancer 3D dataset using deep learning, I can open these 3D files using Fiji, how I can open in python using SimpleITK ? do I need to convert these file into specific f…

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

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