def __init__(self): self.dti_math = slicer.vtkDiffusionTensorMathematics() self.single_pixel_image = vtk.vtkImageData() self.single_pixel_image.SetExtent(0, 0, 0, 0, 0, 0) self.single_pixel_image.AllocateScalars() self.tensor_data = vtk.vtkFloatArray() self.tensor_data.SetNumberOfComponents(9) self.tensor_data.SetNumberOfTuples(self.single_pixel_image.GetNumberOfPoints()) self.single_pixel_image.GetPointData().SetTensors(self.tensor_data) self.dti_math.SetInput(self.single_pixel_image)
def __init__(self): self.dti_math = slicer.vtkDiffusionTensorMathematics() self.single_pixel_image = vtk.vtkImageData() self.single_pixel_image.SetExtent(0, 0, 0, 0, 0, 0) self.single_pixel_image.AllocateScalars() self.tensor_data = vtk.vtkFloatArray() self.tensor_data.SetNumberOfComponents(9) self.tensor_data.SetNumberOfTuples(self.single_pixel_image.GetNumberOfPoints()) self.single_pixel_image.GetPointData().SetTensors(self.tensor_data) self.dti_math.SetInput(self.single_pixel_image)