Good day, while i try to export single image from .nii file in result i get an image but with defective pixels. I also tried to cast image from sitkUInt8 to sitkUInt16 but it become worse.
import sys import SimpleITK as sitk if len(sys.argv) is 3: inputImageName = sys.argv output = sys.argv reader = sitk.ReadImage(inputImageName) image = reader[256, :, :] filePath = output + "/image.tiff" image = sitk.Cast(image, sitk.sitkUInt8) sitk.WriteImage(image, filePath) else: print("Not enough arguments!")
But if i open same .nii for example in Slicer3D it looks:
I can’t figure out what I’m doing wrong.