[vtkusers] How to understand the slab thickness, slab resolution, spacing

zhang qiang zhang07101 at 126.com
Fri Jul 28 03:32:47 EDT 2017


Dear all

    I feel confused about some concepts about VTK. Currently, I need to
reslice a 3D data to make the data isotropic, and I use vtkImageSlabReslice.

    Firstly, I read the data, the code is :

vtkSmartPointer<vtkDICOMImageReader> reader =
vtkSmartPointer<vtkDICOMImageReader>::New();

reader->SetDirectoryName("G:\\SNAP_Signal_Analysis\\snap_simulation\\SNAP_TOF_Data\\Chang
Cheng\\TOF");
	reader->Update();

	vtkSmartPointer<vtkImageData> originalData = reader->GetOutput();
	int originalDims[3];
	double originalSpacing[3];
	originalData->GetDimensions(originalDims);
	originalData->GetSpacing(originalSpacing);

    My question is: how does the originalData record the data thickness
information? Because I can not find the thickness from originalData.

    Then, I reslice the data by the following code:

    vtkSmartPointer<vtkImageSlabReslice> resliceFilter =
vtkSmartPointer<vtkImageSlabReslice>::New();
	resliceFilter->SetInputData(originalData);
	resliceFilter->SetOutputSpacing(0.4,0.4,0.4);
	//resliceFilter->SetSlabResolution(0.4);
	resliceFilter->SetInterpolationModeToLinear();
	resliceFilter->SetOutputDimensionality(3);
	resliceFilter->Update();

    Then, I check the output by:

    vtkSmartPointer<vtkImageData> reslicedData = resliceFilter->GetOutput();
	int reslicedDims[3];
	double reslicedSpacing[3];
	reslicedData->GetDimensions(reslicedDims);
	reslicedData->GetSpacing(reslicedSpacing);

     I find that the resliceFilter->SetSlabResolution is critical to get the
correct pixel spacing. Without the resliceFilter->SetSlabResolution, the
reslicedSpacing is (0.4,0.4,1), which means the SetOutputSpacing do not
work. In the SetOutputSpacing(spacing[0],spaicng[1],spacing[3]), what's the
meaning of spacing[3]? It is the thickness, or it is the spacing between
slice?

     Through dicom viewer, I refer to the dicom header, and I am sure that
originalSpacing[3] is the spacing between slice. So, Why
resliceFilter->SetOutputSpacing(0.4,0.4,0.4) do not make
reslicedSpacing[3]=0.4?

     In addition, I find two function in vtkImageSlabReslice:
SetSlabThickness and SetSlabResolution. From some explanation from Internet,
I guess that SetSlabThickness *NumBlendSamplePoints=SetSlabResolution. But,
after test some case, I find it is wrong. And I have no idea about what is
the relationship between slab thickness and slab resolution.

zhang qiang 




--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-understand-the-slab-thickness-slab-resolution-spacing-tp5744188.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list