Hi, I’m using Activiz and want to save the output of a vtkImageReslice. My (experimental) code regarding the export is as follows:
var data = reslice.GetOutput().GetPointData().GetScalars();
var imData = new ushort[data.GetNumberOfValues()];
for (int li = 0; li < imData.Length; ++li)
{
var shortValue = (int)data.GetVariantValue(li).ToInt();
imData[li] = (ushort)(Math.Max(-1024, shortValue) + 1024);
}
I noticed that the GetVariantValue call is very slow, it takes 90% of the runtime, which is unexpected, as I’d expect the actual reslice operation to take more time. Is there a faster way to access the data from the vtkimagereslice?
Thanks!