I have 2 reslicers in my application and I pipe the input of one of them to a vtkImageCast object and set the output as the output type of the other second reslicer.<br><br>Then, I pass the input to a vtkImageMathematics object and try to subtract these values. However, it always returns with the error:
<br><br>vtkImageMathematics (): Execute: input2 ScalarType, 11, must match output ScalarType 5.<br><br>Here is some code as to what I have tried so far:<br><br>vtkImageCast * cast = vtkImageCast::New();<br>cast->SetOutputScalarType(slicer1->GetOutput()->GetScalarType());
<br>cast->SetInputConnection(slicer2->GetOutputPort());<br>cast->ClampOverflowOn();<br><br>vtkImageMathematics * math = vtkImageMathematics::New();<br>math->SetOperationToSubtract();<br>math->SetInput1(slicer1->GetOutput());
<br>math->SetInput2(cast->GetOutput());<br><br>I think that this should work. Obviously, I have missed something. I would be grateful if someone can point out what I am doing wrong here...<br><br>Thanks :)<br><br>Anna
<br>