Questions tagged [simpleitk]

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.

221 questions
1
vote
1 answer

SimpleITK getDirection() explained

Could someone explain the output of SimpleITK.GetDirection() and how is related to DICOM standard Image Orientation (Patient) header and NIFTI? Eventually, I would like to get the right Image Orientation (Patient) given a cut e.g. axial, sagittal,…
vpap
  • 1,389
  • 2
  • 21
  • 32
1
vote
1 answer

SimpleITK cannot show image

I have below code. print(image.GetDimension()) works and prints the output (512, 512, 17). But sitk.Show(image) doesn't work. My Code import SimpleITK as sitk path = "C:/Users/myUserName/Desktop/0001.DCM" image =…
H42
  • 725
  • 2
  • 9
  • 28
1
vote
0 answers

SimpleITK Reader error in a python multiprocessing context

so I have an error when trying to use simpleITK to read multiple files in multiprocess context in python to speed up a normal pipeline. Excepected Behavior: The pipeline works as before paralellization with no issues. Actual Behavior: The pipeline…
1
vote
2 answers

SimpleITK 3Deuler angles rotation volumetric data

I want to rotate my volumetric CT data using the euler angles x, y and z. For this, I use SimpleITK. I have read the question from Dr. Jessop - simpleitk-rotation-of-volumetric-data-e-g-mri and I think I have the same problem that my…
MdB
  • 49
  • 1
  • 6
1
vote
1 answer

Transpose 3-D MRI image axis to different image view

How can I transpose 3D MRI image with SimpleITK to new image view, but keep aspect ration as it was in the initial view? Here is my code: def show_n_slices(array, start_from=0, step=10, columns=6, figsize=(18,10)): """ Plot N slices of a 3D…
CodingAddict
  • 181
  • 2
  • 15
1
vote
4 answers

Converting YBR_RCT Photometric Interpretation to RGB

I have a J2k Lossless dicom image and upon reading it with pydicom I see that it's in the YBR_RCT Color Space. I want to convert the Color Space to RGB. I tried using the convert_color_space method from pydicom however, apparently this conversion is…
Gaurav Fotedar
  • 715
  • 1
  • 6
  • 11
1
vote
2 answers

Difference between SimpleITK.Euler3DTransform and scipy.spatial.transform.Rotation.from_euler?

Using these two library functions: SimpleITK.Euler3DTransform scipy.spatial.transform.Rotation.from_euler to create a simple rotation matrix from Euler Angles: import numpy as np import SimpleITK as sitk from scipy.spatial.transform import…
Peter
  • 3,322
  • 3
  • 27
  • 41
1
vote
1 answer

How to maintain Direction in SimpleITK image to numpy array conversion?

I have three different isotropic MRI DICOM volumes of the same object, each with a different direction (orthogonal sagittal, coronal and transverse acquisitions of same object). I would like to convert them to numpy arrays and plot them, in such a…
walew
  • 11
  • 2
1
vote
1 answer

How to deal with negative pixel values in images loaded using simpleITK

I have been working on DICOM CT scan images. I used simleITK to read the images to a numpy array. But the image pixel values are negative float values as shown in the image and the dtype of each pixel is float32. How to convert this pixel values to…
1
vote
2 answers

change voxel values in nifti image and save it

I am going to read a nifti image and change the values of the voxels and save the new nifti image similar to the main image but only different voxel values. In other words I want my labels in segmentation image be from 0 to 7 instead of having…
parvaneh
  • 490
  • 2
  • 6
  • 16
1
vote
1 answer

Fixed mask must be of pixel type sitkUInt8 ' simpleitk"

I am fairly new to image registration by SimpleITK , and I have installed from sources the SimpleITK package on Python3. here is my code: import SimpleITK as sitk FIXED_IMAGE_NAME = '/data/fixedImage.nii' MOVING_IMAGE_NAME =…
1
vote
0 answers

Missing lib file, How to fix?

I get this error when trying to use SimpleITK package ImportError: dlopen(/Users/omarkamal/anaconda3/envs/Radiology/lib/python3.8/site-packages/SimpleITK/_SimpleITK.cpython-38-darwin.so, 2): image not found I have tried to reinstall the package and…
Omar Kamal
  • 55
  • 1
  • 9
1
vote
1 answer

simple itk is not behaving as expected while flip using affine transform

I want to flip a volume using simpleitk. vol = np.arange(1, 25).reshape((4, 6)) print(vol) vol = sitk.GetImageFromArray(vol) Result: [[ 1 2 3 4 5 6] [ 7 8 9 10 11 12] [13 14 15 16 17 18] [19 20 21 22 23 24]] according to the this…
1
vote
1 answer

How to calculate Mutual information of 3D images in python

I am using simpleITK for image registration, which is a good tool to use. But unfortunately, in the new version, we can not calculate the mutual information value. I have tried other calculation methods, but finally found that it is not applicable…
tang
  • 31
  • 3
1
vote
1 answer

SimpleITK reading a slice of an image

Good day to all. I happen to have a very large .mha file on my HDD (9.7 Gb) which is a 3D image of a brain. I know this image's shape and for the needs of a report, I would like to extract a slice of it, in order to get a 2D image that I can save as…
Murnawful
  • 135
  • 1
  • 12