+ // Direction is used around the image origin in ITK
+ (*matrix)[i][3] -= (*matrix)[i][j] * input->GetOrigin()[j];
+ }
+ (*matrix)[i][3] += input->GetOrigin()[i];
+ }
+
+ // GetDirection provides the forward transform, vtkImageReslice wants the inverse
+ matrix->Invert();
+
+ mTransform.push_back(vtkSmartPointer<vtkTransform>::New());
+ mTransform.back()->SetMatrix(matrix);