# Pyradiomics voxel-based extraction adds empty slices when using rectangular mask

**URL:** <https://discourse.slicer.org/t/pyradiomics-voxel-based-extraction-adds-empty-slices-when-using-rectangular-mask/37197>\
**Category:** Support\
**Created:** [July 4, 2024, 3:21pm UTC](https://discourse.slicer.org/t/pyradiomics-voxel-based-extraction-adds-empty-slices-when-using-rectangular-mask/37197 "2024-07-04T15:21:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidpalomino6](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davidpalomino6/32/77933_2.png) [@davidpalomino6](https://discourse.slicer.org/u/davidpalomino6)\
**Post date:** [July 4, 2024, 3:21pm UTC](https://discourse.slicer.org/t/pyradiomics-voxel-based-extraction-adds-empty-slices-when-using-rectangular-mask/37197/1 "2024-07-04T15:21:17Z")

</div>

Operating system: Windows 11  
Slicer version: 4.11  
Expected behavior: I am trying to get the radiomic maps based on the voxel-based extraction provided by pyradiomics. In addition, I am trying to obtain the radiomics map in a rectangular region (in 3 dimensions) defined in my CT. For this, I use the pyradiomics extractor by telling it the original image, the mask (rectangular region) and the voxel-based parameter set to true. My configuration file for the extraction is as follows (leaving by default all acquisition parameters, including discretization and specifying only a resampling to isotropic voxel size [1x1x1]):

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/0/e09bb3d263d3272b1a350af5800892e0d15ff5d8.png)

The expected behavior would be to be able to obtain a radiomap resampled to [1x1x1] spacing and having the same dimensions as the rectangular segmentation mask provided to the extractor.

Actual behavior:  
When I try to visualize the volume of the radiomics map obtained in 3D Slicer on the original CT and the defined rectangular segmentation mask, I find that pyradiomics has added empty slices to the volume of the radiomics map at the margins (in red):

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/6/16b8fdca761ccd6ca23dcbf6e752a39928df1958.jpeg)

Why is this behavior? Does it have to do with the volume resampling? The documentation for the pyradiomics resample\_image function details the following information:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/f/9fcf2d96d590ba746d2e38183289d48966b559f4.png)
