[vtk-developers] VTK - How to read Tensors/Matrix per cell from a NIFTI Image?
hausfrau87
westcoast_gangstar at web.de
Fri Aug 21 06:35:14 EDT 2015
Hey guys!
I'm trying to implement a MRT-DTI real-time fibertracking visualization tool
based on VTK. Therefore we need to read the DTI tensors/matrices per cell
stored in a NIFTI Image (.nii) and I really can't figure out how to do this.
It's not a problem to retrieve a single scalar value from the NIFTI file,
but I don't know how to get the tensor (3x3/4x4 matrix). We would really
appreciate any help !
Since the NIFTIImageReader is supposed to read a tensor NIFTI image as a
multi-component vtkImage we tried this:
vtkSmartPointer<vtkImageExtractComponents> extractTupel1 =
vtkSmartPointer<vtkImageExtractComponents>::New();
extractTupel1->SetInputConnection(reader->GetOutputPort());
extractTupel1->SetComponents(0,1,2);
extractTupel1->Update();
vtkSmartPointer<vtkImageExtractComponents> extractTupel2 =
vtkSmartPointer<vtkImageExtractComponents>::New();
extractTupel2->SetInputConnection(reader->GetOutputPort());
extractTupel2->SetComponents(3, 4, 5);
extractTupel2->Update();
vtkSmartPointer<vtkImageExtractComponents> extractTupel3 =
vtkSmartPointer<vtkImageExtractComponents>::New();
extractTupel3->SetInputConnection(reader->GetOutputPort());
extractTupel3->SetComponents(6, 7, 8);
extractTupel3->Update();
extractTupel1->GetOutput()->GetPoint(pointId, tupel1);
extractTupel2->GetOutput()->GetPoint(pointId, tupel2);
extractTupel3->GetOutput()->GetPoint(pointId, tupel3);
But it doesn't work. Maybe the GetPoint-Method is the wrong choice? Please
help :)
--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-How-to-read-Tensors-Matrix-per-cell-from-a-NIFTI-Image-tp5733583.html
Sent from the VTK - Dev mailing list archive at Nabble.com.
More information about the vtk-developers
mailing list