[vtkusers] How to understand the slab thickness, slab resolution, spacing
David Gobbi
david.gobbi at gmail.com
Sat Jul 29 09:11:54 EDT 2017
Hi Zhang,
The code for vtkImageSlabReslice shows what SlabThickness and
SlabResolution do:
https://gitlab.kitware.com/vtk/vtk/blob/master/Imaging/
General/vtkImageSlabReslice.cxx#L47
this->NumBlendSamplePoints = 2*(static_cast<
int >(this->SlabThickness/(2.0 * this->SlabResolution))) + 1;
this->SlabNumberOfSlices = this->NumBlendSamplePoints;
and:
spacing[2] = this->SlabResolution;
The SlabThickness is only used to compute the SlabNumberOfSlices (which is
an integer). And the SlabResolution overrides the slice spacing. The
vtkImageSlabReslice filter is not meant to be used as a 3D output filter.
The output slice thickness is always an integer multiple of the output
slice spacing. This can be tweaked a little with the TrapezoidIntegration
option, but a true fractional slice thickness isn't possible.
http://www.vtk.org/doc/nightly/html/classvtkImageReslice.html#
a9a8fb0ce5f767733bbce72f5be32b409
https://en.wikipedia.org/wiki/Trapezoidal_rule
A different way to reduce image noise when reslicing is to use
vtkImageSincInterpolator with SetBlurFactors:
http://www.vtk.org/doc/nightly/html/classvtkImageSincInterpolator.html#
aa662697dec4b11dacfc21e062fb1551f
but the result will be different from thick slicing.
- David
On Sat, Jul 29, 2017 at 3:06 AM, zhang qiang <zhang07101 at 126.com> wrote:
> Dear David:
>
> Sorry for not CC to vtkusers list.
>
> For vtkImageReslice, if the output spacing[2] = 0.4, I can set the
> thickness of resliced image to 0.4*n by set the SetSlabNumberOfSlices to n.
> If I want the thickness to be 1mm, n will be 2.5. But the type of n is int,
> so n can not be 2.5, which means the thickness can not be 1mm if the
> outputspacing[2]=0.4. Am I right?
>
> On the other hand, I still feel confused about the vtkImageSlabReslice.
> What's the meaning of slab resolution and slab thickness? And after set the
> output spacing to (0.4,0.4,0.4), why the reslicedSpacing[2] of resliced
> image was not 0.4?
>
> vtkSmartPointer<vtkImageSlabReslice> resliceFilter =
> vtkSmartPointer<vtkImageSlabReslice>::New();
> resliceFilter->SetInputData(originalData);
> resliceFilter->SetOutputSpacing(0.4,0.4,0.4);
> resliceFilter->SetInterpolationModeToLinear();
> resliceFilter->SetOutputDimensionality(3);
> resliceFilter->Update();
>
> double reslicedSpacing[3];
> reslicedData->GetSpacing(reslicedSpacing);
>
> Best wishes!
> zhang qiang
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170729/ec9ee544/attachment.html>
More information about the vtkusers
mailing list