I am working on extracting radiomics features from MR images. In my dataset, some ROIs span only a single slice. On imageoperations.py I read a comment saying “Do not resample in those directions where labelmap spans only one slice.” I was wondering about the reason for this. Is there a way within PyRadiomics to allow me to resample such cases to make them isotropic?
I have found a way to resample such cases. I have changed a line in imageoperations.py from:
# Do not resample in those directions where labelmap spans only one slice.
maskSize = numpy.array(maskNode.GetSize())
resampledPixelSpacing = numpy.where(bb[Nd_mask:] != 1, resampledPixelSpacing, maskSpacing)
to:
# Do not resample in those directions where labelmap spans only one slice.
maskSize = numpy.array(maskNode.GetSize())
resampledPixelSpacing = numpy.where(bb[Nd_mask:] != 0, resampledPixelSpacing, maskSpacing)