Display image/mask pair after mask correction?

Operating system: Windows10 64-bit
Slicer version: 4.11.0

Hello,

I’ve been working through some bugs in feature extraction with a data set of image/mask pairs that are pretty heterogenous in terms of size and file type. Developing code in Jupyter notebook with python 3.7.6.

Currently getting successful extraction on all my images, but results aren’t up to snuff on sanity checks. My best lead is to explore image/mask alignment as it occurs when correctMask is called, but as of yet have not been unable to figure out how.

I’d like to be able to display the image/mask after correctMask is executed. Any help to that end is greatly appreciated.

You can visualize the alignment of image and mask by loading them into 3D slicer, though this may not completely accurately display the corrected mask (as it does not accont for segmented voxels ‘lost’ when resampling to another spacing), it does show correct alignment, as it is also inside PyRadiomics.

Correction of the mask uses SimpleITK under the hood. (i.e. ResamleImageFilter with interpolator NearestNeighbor and the input image set as reference image).

Additionally, it may help to review the diagnostic features (part of the output by default). This provides information on the mask and image at various steps in pre-processing.