Smoothing effect only in 1 axis

is it possible to have smoothing effect only affect the one axis, the one that vertically goes through slices.

In other words, if the resolution of a slice is good but slices were spaced a lot, if the 2mm or 3mm smooth is applied, it affects all directions, that way resolution in the slice is sadly lost.

so is there an option to smooth only 1 direction?

  1. for example add extra slices between these and make a voxel through interplation
    Or
  2. somehow manouver 3D models to be smoothen only in 1 direction

?

If you are planning to apply this smoothing to a segmentation, and your dataset is highly anisotropic, probably you want to resample the original volume as isotropic using CropVolume before you start your segmentation. This would be equivalent to your #1.

If it is a scalar volume you want to smooth, then you can try SimpleFilters (e.g., gaussian or median) which let’s you specify the smoothing sigmas independently for each axis.

  1. no, I do not think this would be the same. Even isotropic volume when smooth applied it would be applied between horizontal pixels in each slice.

So let’s say the segmentaiton is a very sharp corner somewhere and looks beautiful when only viewed in a horizontal sice.

Even with isotropic voxels, smoothing will affect the horizontal edges and lines, thus result in rounding of the corners in horizonal slices as well.

  1. I am not sure what is a scalar volume, I will see what this means but this is a regular nrrd file made up of many slices that’s all… just images stacked upon one another. great resolution but horrible spacing.

Here I tried to illustrate it.

Assume you have 3 images stacked upon one another.

  1. you want to avoid sharp red line but
  2. you want to smoothen it to get the green line
  3. however on a horizontal plane you WANT to keep the sharp blue line as is
  4. and avoid having it smoothen out to be yellow line (because resolution is great 7T micrometers images and segmentation was done excellently well without errors.

However because process takes long, slices were few and huge spacing

hello PLease?! Help, I tried to apply median smartfilter so scalar volumes.

There are no gilters with these names gaussian or median
image

there are other similar named filters such as binarymedian something.

Which exactly filter to choose?
How to select axis in which to apply it?

Also Muratmaga, how will cropping volume solve anything?

There is no way to tell the slicer to create extra slicers and interpolate them only in 1 axis.

Here all I see is spaxin 1x.

Further more how would cropping create interpolated new slices which interpolate ONLY in one axis and not other two?

in order to check isotropic spacing it forces me to use “interpolated cropping” which then affects all directions with interpolation.

that is exactly what I am trying to avoid since images are perfectly clear and beautiful in horizontal plane. No need to interpolate them.

image

I mean look what it does to the horizontal images which were fine and okay. It creates opacity low many images horizontal images. This is actually a horrible solution to what I am proposing. IT completely ruins the detail and effects that were contained in high resolution horizontal images.

Crop Volume isotropic demands interpolation and that interpolation makes no distinction what it is interpolating or in which axis. It simply interpolates everything thus ruining the detail of horizontal images.

The proposal is simple:

Do not affect horizontal shapes of the OBJ, preserve all details of each pixel in the horizontal images, simply smoothen out the object vertically in 1 axis.

The SmartFilters you said do not exist. Those are the only three smartfilters with name median in them:
image

and here are the filters that have gaussian name in them:
image

Filters with simple name median or gaussian do not exist.

Please Muratmaga clarify if you can and have time?

What exactly could I do now? Is this even possible?

If you type median to the search box in the SimpleFilters, you should see the filters: BinaryMedianFilter is the first one shown, but the drop down should list the others. Same for Gaussian too.
image

You probably should have done the crop volume with interpolation and isotropic spacing prior to starting the segmentation. If you only want to resample in the Z direction, ResampleScalarVolume can give you what you want. (just leave x and y values as 0,0 and enter whatever spacing you want for Z).

Rest of what you are trying to achieve is not clear to me.

sir thank you very much. I have found similar methods in 3ds max to affect only one axis but this is much better I can tell because it is right away in slicer.

I did not want to bother you so I was researching on my own trying to do it but failed with many times over. Now I will try these two methods Hopefully see which one works. There is also one more student he was given similar tasks for 2 weeks and he has same issue. I hope this works

Thank you sir so much for replying

If your image is highly anisotropic then it means that you won’t be able to fully utilize the high resolution information within the image slice, because you just miss so much information between the slices.

You can find more information here: How can I import in the same volume 3 DICOM files of the same volume - #2 by lassoan

If your goal is not to reproduce the missing information (which is impossible), and it is OK to have sharp edges along two axes, while smooth interpolation along the third one, then you can use morphological interpolation to fill in the gaps. To achieve this, resample the input volume to be isotropic as @muratmaga suggested above, but then only segment at the middle of the original slices. To do that, you can choose your original sparse volume as background volume and use Scissors effect to fill a thin slice (Operation: Fill inside; Slice cut: symmetric 0.1mm or whatever the resolution along the high-resolution axis). You will end up with thin slices with large gaps between them. When you are finished with your segmentation, use Fill between slices effect to fill in the gaps.

Before “Fill between slices”:

After “Fill between slices”:

this exactly describes what I want and you have properly understood what I mean.

Aim to “recover” information between slices if of course impossible

The aim was only to smoothen the transition so that it doesn’t look so ugly.

The problem is that images are loaded from a sequence with white background. They are enumerated and then the automatic script segments them with treshold since they all have copletely white background. This way thousands of images are processed.

The threshold would simply segment everything right?
I would not be able to tell threshold function in the script “segment every third slice or every 4th slice”.

But yes, this properly describes what I mean or what I tried to express and what you did is exactly that what you demonstrated is exactly what I meant.

You could then insert blank slices between your segmented slices to create the desired input volume (with gaps between thin slices).

hello Lassoan, I have done this and yes results are nice :slight_smile:

1 Like