converter->Update();
mVtkImages.push_back( converter->GetOutput() );
- // Account for direction in transform. The offset is already accounted for
+ // Account for direction in transform. The offset is already accounted for
// in the VTK image coordinates, no need to put it in the transform.
+ vtkSmartPointer<vtkMatrix4x4> matrix = vtkSmartPointer<vtkMatrix4x4>::New();
+ matrix->Identity();
for(unsigned int j=0; j<input->GetImageDimension(); j++)
for(unsigned int i=0; i<input->GetImageDimension(); i++)
- mTransform->GetMatrix()->SetElement(i,j, input->GetDirection()[i][j]);
+ (*matrix)[i][j] = input->GetDirection()[i][j];
+ mTransform->SetMatrix(matrix);
// Create the corresponding transformed image
mVtkImageReslice.push_back(vtkSmartPointer<vtkImageReslice>::New());
itk::Matrix<double, 4, 4> itkMat = clitk::ReadMatrix3D(filename);
- vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
- transform->Identity();
+ vtkSmartPointer<vtkMatrix4x4> matrix = vtkSmartPointer<vtkMatrix4x4>::New();
+ matrix->Identity();
for(int j=0; j<4; j++)
for(int i=0; i<4; i++)
- transform->GetMatrix()->SetElement(j,i,itkMat[j][i]);
+ matrix->SetElement(j,i,itkMat[j][i]);
mImage->GetTransform()->PostMultiply();
- mImage->GetTransform()->Concatenate(transform->GetMatrix());
+ mImage->GetTransform()->Concatenate(matrix);
mImage->GetTransform()->Update();
}
}