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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
32 views

How to Improve rigid registration for 2D images

I am looking for a way to improve the rigid registration procedure of 2D images and evaluate metrics for better rigid registration using SimpleITK, here is my code import SimpleITK as sitk import ...
DevanDev's user avatar
  • 355
-1 votes
1 answer
29 views

How to load 3D MRI images into deep learning images?

I am working on prostate cancer classification task using MRI images, in my case, each patient has both ADC and DWI images. I have preprocessed all ADC and DWI images, and labeled them, the label is ...
Shazman's user avatar
0 votes
1 answer
33 views

How to decide the value of the sigma value to use for the SimpleITK Filter: SmoothingRecursiveGaussianImageFilter depending on the voxel size?

I am using a code similar to this example in order to smooth voxel volume data (so from a CTA scan): https://examples.itk.org/src/filtering/smoothing/computessmoothingwithgaussiankernel/documentation ...
Alex1111's user avatar
0 votes
1 answer
15 views

Simple ITK slicing on coronal direction ends up with an upside down image?

SimpleITK version '2.2.0'. Python version 3.9.3 Numpy version 1.24.2 I was using SimpleITK to read in an image and then slicing it on different direction. For example, the image is 'image.mhd', I read ...
user1836485's user avatar
1 vote
0 answers
30 views

SimpleITK ImportError with fresh conda env

I have been having an issue installing SimpleITK>2.2. Fully reinstalled miniconda and I am still having issues. However, it works for SimpleITK<=2.1.1.1 Not sure what the issue is, but I’ve ...
krolic's user avatar
  • 61
0 votes
0 answers
18 views

The execution of SimpleITK's STAPLE algorithm gets stuck in certain cases

I am running the STAPLE algorithm to ensemble 9 segmentations from several models (each segmentation has 3 labels (1,2,3) and the background (0)), but it is getting stuck in some cases (specifically 2 ...
Andre Ferreira's user avatar
0 votes
0 answers
31 views

Change Direction of an image to match a reference, and obtain Origin, without changing the original voxel spacing

I apologize and thank you Ori I will have to edit my question since I wasn't so clear. What I try to do is to calculate the new origin for new direction. The images belong to the same patient, same ...
HarryKa's user avatar
0 votes
0 answers
66 views

SimpleITK copy headers/metadata to align segmentation with image

I am trying to copy all the metadata/header information from one image to another. I have a segmentation (original_image) that when I overlap it with the MRI image it comes from it overlaps as ...
Cristóbal Rodero Gómez's user avatar
1 vote
1 answer
39 views

Images sizes not matched when downsampling then upsampling images

I am trying to downsample an image (for speed), run prediction, then upsample it back. Due to rounding, I get mismatches with the original image size for some pixel dimensions/voxel sizes. What is the ...
illan's user avatar
  • 163
0 votes
2 answers
31 views

Where do i get SimpleITK JNI Lib?

using intellij in windows and i'm getting this error: java.lang.UnsatisfiedLinkError: no SimpleITKJava in java.library.path reading this tutorial: https://itk.org/Wiki/SimpleITK/GettingStarted/...
Salu Ramos's user avatar
0 votes
0 answers
30 views

no SimpleITKJava in java.library.path with intellij

i am trying to use simpleitk with java. already setup pom.xml and maven works with no error or warning. i can even import simpleitk in my scripts and run without problems. when trying to make ...
Salu Ramos's user avatar
0 votes
2 answers
51 views

what is the dependency of simpleitk for maven?

first time using maven, searching for 'simpleitk' in mvnrepository.com returns this: <!-- https://mvnrepository.com/artifact/org.itk.simple/simpleitk --> <dependency> <groupId>...
Salu Ramos's user avatar
0 votes
0 answers
66 views

changing spacing of a dicom image using resample function of simpleITK

I'm trying to change the spacing of a 2D dicom image to that of 3D dicom volume.I realised that simply using the SetSpacing() function of the SimpleITK library won't do it and that I had to resample ...
villich's user avatar
1 vote
2 answers
68 views

SimpleITK Filtering with sitk.ConnectedThresholdImageFilter() wrong output

I have tried many things to segment gray_matter, white_matter and cs_fluid images using sitk.ConnectedThresholdImageFilter(). unfortunately, I couldn't. Please, let me know what I am doing wrong. Here ...
Burak's user avatar
  • 29
0 votes
1 answer
243 views

SimpleITK WriteImage Error, DICOM does not support this component type

I am getting this error when running my program: RuntimeError: Exception thrown in SimpleITK ImageFileWriter_Execute: D:\a\1\sitk-build\ITK\Modules\IO\GDCM\src\itkGDCMImageIO.cxx:1392: ITK ERROR: ...
Ahmed Farghaly's user avatar
0 votes
0 answers
111 views

SimpleITK: Rigidly transform image according to 4x4 matrix defined in numpy

I have an image that I have read using sitk.ReadImage and a 4x4 numpy array representing a rigid transform I would like to apply on the image. For the life of me, I cannot seem to figure out how to ...
brohan322's user avatar
  • 358
0 votes
0 answers
60 views

Output MRI images have value 0 (almost) everywhere after resampling using SimpleITK

I have 3-dimensional NIfTI MRI images that I would like to resample to uniform voxel size (1, 1, 1). This works fine: img = sitk.ReadImage(img_path) output_spacing = [1.0, 1.0, 1.0] input_spacing = ...
heiland's user avatar
  • 51
1 vote
2 answers
269 views

read nifti files 3d slicer vs other methods

I have some nii.gz files which, when I open using imajeJ , or any python library such as SimpleITK or Monai I get a stack of MRI images, as if taken from top to bottom. That being said, when I open ...
Iliasp's user avatar
  • 153
0 votes
2 answers
355 views

SimpleITK : How to change the shape of the image without changing the pixel spacing?

I am trying to change the shape of my 3d array from (66, 47, 21) to \[64, 64, 16\] with the following axis being ( X, Y , Z) . My 3d array came from CT scan , so the Z axis correspond to the number ...
Sta Hamid's user avatar
0 votes
1 answer
65 views

Why is PasteImageFilter from SimpleITK so slow? Is there any alternative to it?

I am trying to create an 3D volume (dimenstions are 4000 x 4000 x 1600) from separate images. I have a for loop, where I first create an std::vector and then use ImportImageFilter to create an image ...
Michailina's user avatar
0 votes
1 answer
78 views

How to efficient create SimpleITK image?

I have two really long std::vector m1 and m2. To create two SimpleITK images i currently do this: sitk::PixelIDValueEnum pixelType = sitk::sitkUInt8; sitk::PixelIDValueEnum pixelTypeFloat = sitk::...
Michailina's user avatar
0 votes
0 answers
45 views

What is causing the fatal error: SimpleITK.h: No such file or directory? (C++ project with cmake)

I get fatal error: SimpleITK.h: No such file or directory after executing make -j8 trying to build my project. I have no expirience with SimpleITK. Here are the steps that followed to install ...
Michailina's user avatar
0 votes
0 answers
90 views

Installation of SimpleITK for c++ Project fails with errors

I have a C++ Project with cmake where I want to use SimpleITK (Red Hat Linux). I tried to follow multiple tutorials how to install SimpleITK but every one of them failed with errors. I use conda ...
Michailina's user avatar
0 votes
0 answers
219 views

How to move nibabel.Nifti1Image metadata into a SimpleITK.Image object?

I am working with MRI images which in their raw form are 5-dimensional. I can load them in using nibabel package which gives me nibabel.Nifti1Image objects. Then I can slice that object into a bunch ...
Jeremy Joe's user avatar
0 votes
0 answers
161 views

DICOM Volume to Point Cloud using SimpleITK and Open3D

I need to convert a knee MRI into a point cloud representation. here I load a serie: import SimpleITK as sitk reader = sitk.ImageSeriesReader() dicom_names = reader.GetGDCMSeriesFileNames(path) ...
Leili_Kue's user avatar
0 votes
1 answer
153 views

How to pad edge with black color (0 value) in affine registration using SimpleITK

I used SimpleITK to do affine registration and find that after transform the moving image was scaled smaller than its original size while the edge was padded with gray color. How to pad the edge with ...
Chaoye Jin's user avatar
0 votes
0 answers
69 views

how can I extract only the skin surface from a MRI nrrd file with SimpleITK, VTK, PyVista?

Starting from brain MRI I manage to obtain a raw 3D reconstruction of the skin plus other elements inside the brain MRI with thresholding in Pyvista, then with .extract_surface I obtained the PolyData ...
MIM's user avatar
  • 11
1 vote
1 answer
79 views

SimpleITK Python apply BinaryMorphologicalClosingImageFilter to a TIFF image

I am trying to apply a BinaryMorphologicalClosingImageFilter to a binary TIFF image to fill empty spaces between structures (where ImageJ Fill Holes doesn't help). Here is the code I use: import ...
Chris's user avatar
  • 33
-1 votes
1 answer
134 views

how to get an axial image from ct scan images. as i am using sliver07 dataset so it has 100+ images in single .mhd file

i using SLIVER07 dataset for liver segmentation task but i am stuck in reading that images. import SimpleITK as sitk import numpy as np import matplotlib.pyplot as plt # reading .mhd file from ...
Qazi Sami Ullah Khan's user avatar
0 votes
1 answer
121 views

Allow SimpleElastix version and official version of SimpleITK package exists but import with different names

I am currently developing an medical image Follow-up system which requires to use registration function provided in SimpleElastix version of SimpleITK (Modified SimpleITK 2.0.0), however, I will also ...
Steven T's user avatar
2 votes
1 answer
464 views

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 ...
CodingAddict's user avatar
1 vote
0 answers
263 views

How to read a Multiframe Dicom file and display it as video using an UI

I am looking to find a way to read a DICOM file and display the multi frame DICOM file as a video in an UI, I tried reading the multi frame DICOM file using pydicom and I was able to get each frame ...
Ron's user avatar
  • 83
2 votes
1 answer
345 views

What is the fastest and easiest way to resample a set of CT scans to same pixel spacing and volume size?

I have to train a neural net for semantic segmentation of kidney and his tumor, starting from the dataset available from the kiTS 19 Challenge. In this dataset, I have 100 CT scans for the training ...
Saras's user avatar
  • 21
0 votes
0 answers
128 views

How to add Patient Position tag (Origin) to each slice in a SimpleITK image?

I have a multi-slice volume [shape (256,256,14)] stored in a .vtk file. The header of the file, contains the following information: # vtk DataFile Version 3.0 vtk output BINARY DATASET ...
lbrandao's user avatar
2 votes
1 answer
657 views

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 ...
Sala's user avatar
  • 480
0 votes
0 answers
58 views

SimpleITK manifest.json file help adding new NIFTI file

I am using SimpleITK for image registration purposes. I followed the tutorials and would like to run the program on other brain MRI's now that were not provided in the tutorial. I know I have to add ...
Lauren's user avatar
  • 1
0 votes
1 answer
205 views

Modifying an 3D image in mhd format using Python

I have a MR image volume in *.mhd format, and I do not have access to the original DICOM file. The image is not square and I need to crop the image and save a new *.mhd file again. I have a *.json ...
Magi's user avatar
  • 341
-1 votes
1 answer
645 views

Registering a pair of binary masks [closed]

I'm trying to register a pair of binary masks, not a pair of images. To explain further, I'm trying to build a model that automatically strips the brain from the head skull. For the better model ...
goofyduck's user avatar
1 vote
1 answer
152 views

3D Image co-registration between multiple subjects

When preforming image co-registration of multiple subjects, how should we select the reference image? Can a randomly selected image form one dataset could be the reference image for an image from the ...
Dushi Fdz's user avatar
  • 131
-1 votes
1 answer
460 views

From numpy array to a mhd file in python

I'm trying to convert a numpy array into a mhd file using SimpleITK. Do you know if this is possible and if so, how to do it ?
manon's user avatar
  • 15
0 votes
1 answer
84 views

Understanding output from sitk.GetSpacing()

Can anyone explain me the meaning of the output that is generated from sitk.GetSpacing(). Also could anyone conform if I understood the concept of image spacing correctly, does it just mean the co-...
rRshabh's user avatar
0 votes
1 answer
48 views

raster_geometry.sphere is giving different volumes when only the position changes

I have a set of midpoints (from labelled tumours within a set of scans [512x512x512 voxels]). I'm just trying to create a sphere with a radius of 10 voxels at each midpoint. To do this, I'm using ...
Kyle Drover's user avatar
0 votes
1 answer
145 views

Migrating SimpleITK 1.x to 2.x

I'm working on a project on GitHub that was made with Python 2.7 (https://github.com/AIM-Harvard/DeepCAC) I've made most relevant changes as to update it to Python 3.7, but I'm fixed on an error ...
Fábio Nunes's user avatar
0 votes
1 answer
530 views

rotating an image after resampling to get the right slice direction

I'm using simpleITK in python to do image registration between an atlas image and an MRI image. I'm doing a resampling to give the atlas the same metadata as the image (origin, direction, spacing etc.....
97nevermore's user avatar
0 votes
2 answers
163 views

Getting the intensities of a certain region of an MR image

I have a 3D MR image as a NIfTI file (.nii.gz). I also have a 'mask' image as a NIfTI file, which is just a bunch of 0s and 1s. The 1s in this mask image represent the region of the 3D MR image I am ...
user745587's user avatar
1 vote
1 answer
274 views

SimpleITK.Show() generates error in ImageJ on Macbook

I'm struggling with imagej on Jupyter. This is part of the code that i'm running: def ImageGen(a,b,x_0,y_0, sigma_x, sigma_y, theta ): g=GaussianFunc(x_0,y_0,sigma_x,sigma_y,theta) g2=sitk....
zahra ameli's user avatar
0 votes
1 answer
3k views

ImportError: DLL load failed while importing _SimpleITK. Can't find the given module

I am trying to use the following script provided through GitHub: Script. I have python 3.9.10 installed, pip version 22.0.4. But when I run py script.py I get the following error message: "...
Don_twice's user avatar
0 votes
1 answer
167 views

How to set voxel value based on absolute distances/coordinates from origin in simpleITK

I have a dicom 3D image and additional file describing binary mask. Binary mask is encoded with XYZ coordinates: 5.123422, 6.123123, 5.123123; 5.123422, 6.123123, 5.123123; 5.123422, 6.123123, 5....
andyPity's user avatar
1 vote
2 answers
966 views

Skull stripping with python/simpleITK

I'm trying to perform a skull stripping with simpleITK in python. I'm using the StripTsImageFilter function as follows: #upload data # Path of nii img path = r'C:\Users\Kate\Jupyter\DataThesis\...
Kate's user avatar
  • 13
0 votes
1 answer
172 views

SimpleITK thresholding based on ratio

I am trying to do some basic thresholding on brain images. I'm trying to find the tumor to brain ratio and then use do some basic filtering based on the following ratio: the intensity of every pixel/...
nibs's user avatar
  • 43

1
2 3 4 5