Operating system:Windows 10
Slicer version: 4.10.1
I have masks stored in numpy ndarray, and I am using pynrrd to write them to .nrrd format for use in pyradiomics. When I check the nrrd masks against the dicom image in Slicer, the image origin and voxel size do not align. It’s easy enough to correct manually in slicer by changing the ‘Image Spacing:’, and ‘Image Origin:’, but I need to do this for thousands of DICOM files.Pixel spacing is available in the DICOM header, but the slice thickness seems difficult to get.
What is the best way to approach this problem? Do I try to convert all the DICOM to nrrd first? How can I do that in a python script? Saving as nrrd in Slicer works well but is too slow for many files.
Thank you for your help