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
2
votes
1 answer
How to Flip MRI image in Python
I am trying to flip image shown in picture 1 to match the orientation of the image in picture 2, but I am not sure how.
This is how image should be oriented:
Any ideas how I can do this in Python with SimpleITK or nibabel for example?

CodingAddict
- 181
- 2
- 15
2
votes
1 answer
Merge channels of NIfTI (.nii) images in python
I am trying to superimpose a CT .nii image and its mask in another color (possibly red). This is easily achievable for example with imageJ, thanks to the "Merge Channels" functionality. What I would like to obtain looks like this:
given my original…

Sala
- 480
- 4
- 19
2
votes
1 answer
Get bias field using sitk
I'm trying to use sitk library to clear biased Mr image (MRI).
I'm able to get the corrected image but can't get the bias image.
Set the following parameters:
shrink_factor=1,
mask_image=mask,
number_of_iterations=100,…

Ohads
- 63
- 1
- 1
- 6
2
votes
1 answer
SimpleITK: registration with composite transform
I'm trying to use a composite transform (TranslationTransform + ScaleTransform) for registration. The concept is to first register with Translation, then do [Translation, Scale] with the initial transform of the translation given by the solution of…

Matthew Andrew
- 39
- 3
2
votes
1 answer
How to catch SimpleITK warnings?
I am loading a volume from a dicom folder
import SimpleITK as sitk
reader = sitk.ImageSeriesReader()
dicom_names = reader.GetGDCMSeriesFileNames(input_dir)
reader.SetFileNames(dicom_names)
image = reader.Execute()
, and I am getting the following…

Sep
- 347
- 3
- 13
2
votes
1 answer
How to do histogram equalization to DICOM images read with SimpleITK
I'm trying to do histogram equalization to all images read from a *.nii.gz file.
I have tried this code:
import SimpleITK as sitk
flair_file = '/content/gdrive/My Drive/Colab Notebooks/.../FLAIR.nii.gz'
images =…

VansFannel
- 45,055
- 107
- 359
- 626
2
votes
1 answer
Faster solution for sampling an index by value of ndarray
I have some pretty large arrays to deal with. By describing them big, I mean like in the scale of (514, 514, 374). I want to randomly get an index base on its pixel value. For example, I need the 3-d index of a pixl with value equal to 1. So, I…

yujuezhao
- 1,015
- 3
- 11
- 21
2
votes
2 answers
SimpleITK OrientedBoundingBoxVertices - in what coordinate system are the vertices defined?
Using the LabelShapeStatisticFilter, I can extract oriented regions of interest from the original image correctly. I want to plot those oriented bounding boxes over the original image.
When I try to view the output of the…

Kevin
- 31
- 5
2
votes
2 answers
How to Convert Simpleitk image to VTK in CSHARP project?
I'm using Activiz(c# library of vtk) and SimpleITK in my program,
I tried to load dicom series with SimpleITK, then transfer the image to Activiz,then create a volume with vtkVolumeRayCastMapper
ImageSeriesReader imageSeriesReader = new…

RicK
- 21
- 2
2
votes
2 answers
SimpleITK Rotation of volumetric data (e.g. MRI)
I have a 32x32x3 (height, width, depth) image that I am trying to rotate around the z axis by 45 degrees in sitk. It appears however that the z/depth axis I am getting sitk to rotate around is at an angle. How would I be able to rotate the image…

DrJessop
- 462
- 6
- 26
2
votes
1 answer
Threshold Otsu: AttributeError: 'AxesSubplot' object has no attribute 'ravel'
I loaded nifty files(These were as well converted from .pack CT scans). My goal is to use the threashold otsu algorithm to mask it from the background and compare the two images. When I try to plot I get the error
AttributeError: 'AxesSubplot'…

ama
- 53
- 1
- 7
2
votes
1 answer
Difference between image resizing and space changing
My current image is of size (240, 240, 155) with a voxel spacing of (1, 1, 1). My final image should be of (128, 128, 128) with a voxel spacing of (1.5, 1.5, 1.5). Is there a way to understand this phenomenon of resizing with voxel spacing?
I have…

BlackSpecter
- 61
- 2
- 12
2
votes
1 answer
SimpleITK: apply inverse transformation
I have recently began to use SimpleITK for image registration. For my current project I need to register an X-Ray image and a CT image, and then apply the inverse matrix on a ROI mask traced on the X-Ray image.
I got the inverse matrix with this…

schrodingercat
- 246
- 4
- 21
2
votes
0 answers
Issues Installing SimpleElastix on Ubuntu for Python
I am trying to install SimpleElastix/SimpleITK on an Ubuntu computer for either Python2 or 3, whichever we can get to work. Using pip install doesn't work as various methods don't import then (e.g. no "GetDefaultParameterMethod" exists). I tried…

cmitch
- 233
- 1
- 10
2
votes
2 answers
How are the spacing value of the z dimension and thickness (0018, 0050) different in dicom series?
I've been studying some dicom series and find that the thickness attribute and the itkimage.GetSpacing()[2] value are not always consistent.
For example the thickness (0018, 0050) value encoded in the dcm file is 1.5 mm but the corresponding spacing…

user1206899
- 1,564
- 1
- 11
- 15