simpleitk - How parameters should be used in sitk.ReadImage()?

I am doing N4 bias correction in .nii file in python(Windows).For this I am using SimpleITK.While taking input of the image, I am having issues in reading the file.Code : print("N4 bias correction runs.") inputImage =sitk.ReadImage("C/Users/LENOVO/Desktop/Brats18_2013_1_1_t1.nii") maskImage = sitk.OtsuThreshold(inputImage,0,1,200) sitk.WriteImage(maskImage,"C/Users/LENOVO/Desktop/Brats18_2013_1_1_t1_Mask.nii") inputImage = sitk.Cast(inputImage,sitk.sitkFloat32) corrector = sitk.N4BiasFieldCorrectionImageFilter(); output = corrector.Execute(inp...Read more

simpleitk - sitk.N4BiasFieldCorrectionImageFilter() Proper Usage

I am trying to apply the N4ITKBiasFieldCorrectionImageFilter from SimpleITK, to an MRI scan as a pre-processing step. From what I've gathered this can be executed in 3D and I've been applying it with this code: corrector = sitk.N4BiasFieldCorrectionImageFilter()maskImage=sitk.OtsuThreshold(Original_scan, 0, 1, 200) I = sitk.Cast( Original_scan, sitk.sitkFloat32 )BiasCorrected_scan=corrector.Execute(I,maskImage)I keep getting the same Error eventually as it executes the function: RuntimeError: Exception thrown in SimpleITK N4BiasFieldCorrec...Read more

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 GetOrientedBoundingBoxVertices() method, it's not clear to me in what coordinate system these vertices are defined. They do not appear to be in the original image coordinate system.I am confident I am using the LabelShapeStatisticFilter class as intended (see below), following this excellent notebook: http://insightsoftwarecon...Read more

How to use SimpleITK.WarpImageFilter function in python

I can't find any python documentation on this function.I tried the following code, but the output is absolutely wrong.warp = sitk.WarpImageFilter()warp.SetInterpolator(sitk.sitkLinear)out = warp.Execute(reference_img, transform_img)it gives me exactly the reference_img, but not the transformed image.Have you ever used this function? Could you please help me on this issue?...Read more