<div dir="ltr"><div>Hi Zhang,</div><div><br></div><div>To make your data isotropic, I suggest using vtkImageReslice. I don't see any reason to use vtkImageSlabReslice, but maybe you can explain in more detail why the "slab" part is important for your result.</div><div><br></div><div>VTK does not record the SliceThickness. The VTK spacing measures the distance from the center of one slice to the center of the next slice. If you need the thickness, you must get it from the DICOM metadata (e.g. you could use the vtkDICOMReader from <a href="http://github.com/dgobbi/vtk-dicom" target="_blank">github.com/dgobbi/vtk-<wbr>dicom</a>, which reads all of the metadata).</div><div><br></div><div>If you use vtkImageReslice, making the data isotropic should be as easy as this:</div><div><br></div><div><div> vtkSmartPointer<<wbr>vtkImageReslice> resliceFilter = vtkSmartPointer<<wbr>vtkImageReslice>::New();</div></div><div><div> resliceFilter->SetInputData(<wbr>originalData);</div><div> resliceFilter-><wbr>SetOutputSpacing(0.4,0.4,0.4);</div></div><div> resliceFilter-><wbr>SetInterpolationModeToLinear()<wbr>;<br></div><div> resliceFilter->Update();</div><div><br></div><div>There is no need to call resliceFilter->SetOutputDimensionality(3), since this is already the default.</div><div><br></div><div> - David</div><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 28, 2017 at 1:32 AM, zhang qiang <span dir="ltr"><<a href="mailto:zhang07101@126.com" target="_blank">zhang07101@126.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all<br>
<br>
I feel confused about some concepts about VTK. Currently, I need to<br>
reslice a 3D data to make the data isotropic, and I use vtkImageSlabReslice.<br>
<br>
Firstly, I read the data, the code is :<br>
<br>
vtkSmartPointer<vtkDICOMImageR<wbr>eader> reader =<br>
vtkSmartPointer<vtkDICOMImageR<wbr>eader>::New();<br>
<br>
reader->SetDirectoryName("G:\\<wbr>SNAP_Signal_Analysis\\snap_sim<wbr>ulation\\SNAP_TOF_Data\\Chang<br>
Cheng\\TOF");<br>
reader->Update();<br>
<br>
vtkSmartPointer<vtkImageData> originalData = reader->GetOutput();<br>
int originalDims[3];<br>
double originalSpacing[3];<br>
originalData->GetDimensions(or<wbr>iginalDims);<br>
originalData->GetSpacing(origi<wbr>nalSpacing);<br>
<br>
My question is: how does the originalData record the data thickness<br>
information? Because I can not find the thickness from originalData.<br>
<br>
Then, I reslice the data by the following code:<br>
<br>
vtkSmartPointer<vtkImageSlabRe<wbr>slice> resliceFilter =<br>
vtkSmartPointer<vtkImageSlabRe<wbr>slice>::New();<br>
resliceFilter->SetInputData(or<wbr>iginalData);<br>
resliceFilter->SetOutputSpacin<wbr>g(0.4,0.4,0.4);<br>
//resliceFilter->SetSlabResolu<wbr>tion(0.4);<br>
resliceFilter->SetInterpolatio<wbr>nModeToLinear();<br>
resliceFilter->SetOutputDimens<wbr>ionality(3);<br>
resliceFilter->Update();<br>
<br>
Then, I check the output by:<br>
<br>
vtkSmartPointer<vtkImageData> reslicedData = resliceFilter->GetOutput();<br>
int reslicedDims[3];<br>
double reslicedSpacing[3];<br>
reslicedData->GetDimensions(re<wbr>slicedDims);<br>
reslicedData->GetSpacing(resli<wbr>cedSpacing);<br>
<br>
I find that the resliceFilter->SetSlabResoluti<wbr>on is critical to get the<br>
correct pixel spacing. Without the resliceFilter->SetSlabResoluti<wbr>on, the<br>
reslicedSpacing is (0.4,0.4,1), which means the SetOutputSpacing do not<br>
work. In the SetOutputSpacing(spacing[0],sp<wbr>aicng[1],spacing[3]), what's the<br>
meaning of spacing[3]? It is the thickness, or it is the spacing between<br>
slice?<br>
<br>
Through dicom viewer, I refer to the dicom header, and I am sure that<br>
originalSpacing[3] is the spacing between slice. So, Why<br>
resliceFilter->SetOutputSpacin<wbr>g(0.4,0.4,0.4) do not make<br>
reslicedSpacing[3]=0.4?<br>
<br>
In addition, I find two function in vtkImageSlabReslice:<br>
SetSlabThickness and SetSlabResolution. From some explanation from Internet,<br>
I guess that SetSlabThickness *NumBlendSamplePoints=SetSlabR<wbr>esolution. But,<br>
after test some case, I find it is wrong. And I have no idea about what is<br>
the relationship between slab thickness and slab resolution.<br>
<br>
zhang qiang<br></blockquote></div></div></div>