223
questions
1
vote
1
answer
49
views
Image registration with SimpleITK: how to get transformed image
I recently learned image registration using SimpleITK (sitk).
My task is to subtract two CT images that were acquired at two different time points.
First of all, I need to register these images. I did ...
1
vote
1
answer
39
views
How to sort DICOM images in reverse order (by Slice Location) with SimpleITK?
I am new to SimpleITK, so I would really appreciate any help! My question is specific to SimpleITK (not Pydicom).
I imported CT DICOM slices from a directory and opened them using SimpleITK. The ...
0
votes
1
answer
27
views
Resampling MR image using sitk.ResampleImageFilter() and a composite transform results in grey artefacts in output image
I performed with FSL and ANTs registrations between the slices of a interleaved aquired t2 weighted MR image to get rid of geometric distortions (rotation, translation..) and i wanted to compute a ...
1
vote
1
answer
82
views
Different points after conversion from SITK image to VTK Image
I am trying to convert a SITK image with its corresponding spacing, origin, and direction metadata into a VTK Image, with a conversion to a Numpy array in between.
However, when I try to grab a point ...
1
vote
1
answer
130
views
Get 3D affine transformation matrix from mri DICOM files
I have both RTDose and MRI information in DICOM format. Unfortunately raw MRI and RTDose files share not only different dimensions but incompatible actual spacing as well.
Looking Here I've been ...
0
votes
0
answers
23
views
ITK ERROR: MaskNegatedImageFilter(000001D7CB479830): Inputs do not occupy the same physical space
I used a code to compute the 95HD and DSC to assess the segmentaion accuracy of medical image, and the following problem appered "ITK ERROR: MaskNegatedImageFilter(000001D7CB479830): Inputs do ...
0
votes
0
answers
22
views
Modifyng a deformed object so it has the same shape as the original
I have two png of the same object. However, png_b has the object a bit deformed, as if it was squished. Both of the images don't have the same shape or the same ratio.
I'm coding in python and need to ...
-1
votes
2
answers
136
views
.nii to .stl file conversion issue
Can someone please help me to convert the segmentation mask that is in .nii format to .stl format in python. I tried converting it there are few issues I see i) conversion is not smooth as shown in ...
1
vote
0
answers
301
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 ...
-1
votes
1
answer
105
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 ...
0
votes
1
answer
225
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
...
0
votes
1
answer
98
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 ...
1
vote
0
answers
93
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 ...
0
votes
0
answers
562
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 ...
1
vote
1
answer
139
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 ...
0
votes
2
answers
86
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/...
0
votes
2
answers
111
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>...
1
vote
2
answers
193
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 ...
0
votes
1
answer
851
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: ...
0
votes
0
answers
313
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 ...
1
vote
2
answers
737
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 ...
0
votes
2
answers
1k
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 ...
0
votes
1
answer
141
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 ...
0
votes
1
answer
175
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::...
0
votes
0
answers
84
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 ...
0
votes
0
answers
230
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 ...
0
votes
0
answers
656
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 ...
0
votes
1
answer
277
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 ...
0
votes
0
answers
141
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 ...
1
vote
1
answer
190
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 ...
-1
votes
1
answer
275
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 ...
0
votes
1
answer
146
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 ...
2
votes
1
answer
810
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 ...
1
vote
0
answers
411
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 ...
2
votes
1
answer
585
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 ...
0
votes
0
answers
206
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 ...
2
votes
1
answer
1k
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 ...
0
votes
0
answers
89
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 ...
0
votes
1
answer
305
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 ...
-1
votes
1
answer
1k
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 ...
1
vote
1
answer
262
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 ...
0
votes
1
answer
743
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 ?
0
votes
1
answer
513
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-...
0
votes
1
answer
61
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 ...
1
vote
1
answer
233
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 ...
0
votes
1
answer
843
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.....
0
votes
2
answers
308
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 ...
1
vote
1
answer
337
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....
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: "...
0
votes
1
answer
195
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....