help with understand of median filter and 3D scan treatment in general

hello,
I have a tiff image of a 3D scan that i am trying to use paraview for the extraction of surfaces meshes.
currently, i have the data with a space of 1 length voxel, i wanted to sub divide each voxel by a factor (sub divide each cell). once the data is subdivided apply a median filter to ‘clean’ a little bit the data for after applying thresholds etc.
i have several questions:

  1. when my voxel is not of 1x1x1 the median filter, scales the geometry?
    my current steps:
  • define a factor of refinement, lets say 2
  • import the tiff image → get the number of voxels in each direction using .GetBounds()
  • use resample to image filter and in sampling dimensions use the values of the GetBounds() * factor of refinement→this will give the ‘same’ tiff image but with smaller voxels
  • use median filter over the resampled data

with this workflow, i am getting a result that is larger in total volume? (the result of the median scales up in volume inversely to cell length i get when using the resample, just to notice also, the _Resampled looks the same in total size than the spruce_small filter (original tiff reading filter) the scaling comes when the median is applied)

normally, i should get from this data, 3 different material sections (the full volume is vol.material1+vol.material2+vol.material3) I thought about recovering the different volumes using clip filter, nevertheless this does not look perfect… if anyone has any other recommendations i would appreciate this. has paraview have any specific tools for this kind of thing? (for example, right now i am getting the clip values by looking at the population of the values of the Tiff Scalars point data). i have experience with paraview but not in this kind of application….

The data can be found in the link of this comment: why some filters require UpdatePipeline and other no? - #5 by otaolafr

@mwestphal sorry for the tag, no need to adresse the post itself, but could you confirm that is inteded that if the spacing is different to 1, the median will output a different volume? as if it was scaled up/down? i find it strange and i am asking myself if it is a bug or not.

Im afraid Im not following, please share some data to reproduce.

the data is here: FileSender

if one use resampling to reduce the size of the pixels, ie., cut them by 2 in each direction, when the median is applied, it increase the total volume.

I reproduce, it looks like the median filter completely ignore the extent of the image data and only considers dimensions.

Please open an issue.