Hi community,
when reading a volume as a TIFF stack using the vtkTIFFReader the size of the volume can not be scaled using the readers SetDataSpacing function.The SetDataSpacing(x,y,z) function don’t seem to do anything.
how should i modify it.
thanks!
vtkSmartPointer<vtkStringArray> fileArray = vtkSmartPointer<vtkStringArray>::New();
for (const auto& file : filesName)
{
vtkStdString::StdString fileStr(file);
fileArray->InsertNextValue(fileStr);
}
vtkSmartPointer<vtkTIFFReader> reader = vtkSmartPointer<vtkTIFFReader>::New();
reader->SetFileNames(fileArray);
reader->Update();
int dimensions[3] = { 0,0,0 };
reader->GetOutput()->GetDimensions(dimensions);
reader->SetFileDimensionality(3);
reader->SetDataExtent(0, dimensions[0] - 1, 0, dimensions[1] - 1, 0, imgUsedTotal - 1);
reader->SetDataSpacing(1.0, 1.0, 3.0);
reader->SetDataOrigin(0, 0, 0);
reader->SetDataByteOrderToLittleEndian();