SimpleITK is a simplified, open-source interface to the United States National Library of Medicine’s Insight Segmentation and Registration Toolkit. The SimpleITK image analysis library is available in multiple programming languages including C++, Python, R, Java, C#, Lua, Ruby and Tcl.
Questions tagged [simpleitk]
221 questions
1
vote
2 answers
How do I use SimpleITK's ExpandImageFilter?
I have 2 SimpleITK images, and I want to use their package's ExpandImageFilter to upsample one of my images to match the other.
Does anyone have any idea on how to use this?
I took a look at their documentation…

Icy Lemons
- 143
- 7
1
vote
1 answer
SimpleITK read io.ByteIO
I have a io.ByteIO object which represent an uploaded image (.nii), is there a way to obtain an simpleITK object from it ?
A bad workaround would be to write the file then read it with simpleITK

Chopin
- 188
- 1
- 10
1
vote
1 answer
Convert Dicom image pixel value to Unity color
I use SimpleITK to read a Dicom image in Unity. I create a list of Unity Texture2D to store Dicom slices. My question is how can we convert the pixel value from Dicom image to Unity Color?
List _imageListTexture = new…

vuthea
- 11
- 2
1
vote
1 answer
Check file before calling SimpleITK.SimpleITK.ImageFileReader.ReadImageInformation()
I am processing a set of DICOM files, some of which have image information and some of which don't. If a file has image information, the following code works fine.
file_reader =…

OtagoHarbour
- 3,969
- 6
- 43
- 81
1
vote
1 answer
Limiting DICOM tags
I am trying to limit the DICOM tags, which are retained, by using
for key in keys:
if key.upper() not in {'0028|0010','0028|0011'}:
image_slice.EraseMetaData(key)
in Python 3.6 where image_slice is of type SimpleITK.SimpleITK.Image
I…

OtagoHarbour
- 3,969
- 6
- 43
- 81
1
vote
1 answer
Python: update plot with image with slider weight
I loaded a .nii file in my application.
def show(self):
image = SimpleITK.ReadImage(file_name)
t1 = SimpleITK.GetArrayFromImage(image)
t2 = color.rgb2gray(t1[w.get()])
print(w.get())
print(t2.shape)
plt.ion()
fig =…

Cristina Bîrsan
- 11
- 2
1
vote
2 answers
SimpleITK for image registration. Writing issue
I've installed from sources the SimpleITK package on Python3. When I perform the provided registration example :
#!/usr/bin/env python
#=========================================================================
#
# Copyright NumFOCUS
#
# …

ananass
- 95
- 14
1
vote
1 answer
How to save an array with the same spacing and origin into a SimpleITK image?
I want to write the image [that I have loaded into array] after changing the values of array into a SimpleITK Image. How can I set the spacing and origin?
[res_file_dir is the path to the nii.gz…

S.EB
- 1,966
- 4
- 29
- 54
1
vote
2 answers
How to use SimpleITK "LabelOverlapMeasuresImageFilter" to extract measures on Python using NiftiImages
I need to extract a set of metrics from 2 labeled 3d images, with the same dimensions, data types EVERYTHING IS THE SAME, except that one is my silver standard and the other one is the result of a pipeline.
my code is:
reader =…

Vitor Hugo
- 23
- 2
1
vote
1 answer
Assignment to indexed images in SimpleITK
What is the best way to do assign values or slices to indexed arrays in SimpleITK?
Example (1): Assigning a 2D slice to an indexed 2D slice in a 3D volume
In NumPy, we can do the following assignment to the index arrays:
import numpy as np
nda =…

mehrtash
- 910
- 3
- 9
- 16
1
vote
2 answers
SimpleItk crop image
I would like to crop a 3D image using simpleItk in Python3
first, loading the image and get numpy array
image_ct = sitk.ReadImage(path_ct, sitk.sitkInt16)
array_ct = sitk.GetArrayFromImage(image_ct)
then I do a crop on array data
center = (200,…

Chopin
- 188
- 1
- 10
1
vote
1 answer
Simple ITK Problem when saving deformation field : the deformation field is empty
I'm looking for help with simpleITK, I'm working with NII files in order to calculate the deformation field. I use Python and simpleITK (simpleitk 1.2.0rc2.dev1167+gd4cf2). I can easily register my images or volumes but I cannot get the deformation…

Armand
- 11
- 1
1
vote
1 answer
Install SimpleElastix on Windows for Python
It seems some people have reported this on GitHub but I still couldn't find a clear solution to it - in the last step of installing the python module on Windows, there is no such folder called "/Wrapping/Python/Packaging" under "SimpleITK-build",…

Linghua
- 21
- 4
1
vote
1 answer
How to access specific voxels that satisfies the specific condition in ITK C++?
I have a 3D image and a sphere equation. I need to take out all the voxels that are outside the circle and want to apply a transformation to them. How do I differentiate those points from all the points? I'm not understanding how to actually write…

Cndu
- 57
- 8
1
vote
2 answers
BSplineTransform.GetInverse() throws sitk::ERROR: Unable to create inverse
I calculated a B-spline transform in Python using the method described in the docs, and trying to invert it using bspline.GetInverse(). This causes the following error:
Traceback (most recent call last):
...
File…

Michael Litvin
- 3,976
- 1
- 34
- 40