Hello there!
I recently started playing with vtk and I am using vtkVolume to visualize medical images. I want to overlay two images (CT and MR) on top of each other and match them. I’m using vtkMultiVolume for this and I want to get the positions of the center of each volume. However, every time calling the volume->GetCenter() function returns a position of 0,0,0 which is false, similarly GetPosition(). Below is the code on how I create vtkMultiVolume and how I try to get the center position.
vtkGPUVolumeRayCastMapper* mapper = vtkGPUVolumeRayCastMapper::New();
mapper->SetInputConnection(0, firstFileData->getThreshold());
mapper->SetInputConnection(1, secondFileData->getThreshold());
mapper->UseJitteringOn();
vtkMultiVolume* mergedVolume = vtkMultiVolume::New();
mergedVolume->SetMapper(mapper);
vtkVolume* firstActor = vtkVolume::New();
vtkVolume* secondActor = vtkVolume::New();
mergedVolume->SetVolume(firstActor, 0);
mergedVolume->SetVolume(secondActor, 1);
mergedVolume->Update();
vtkVolume* volume = mergedVolume->GetVolume(1);
double* center = volume->GetCenter(); // this always returns [0,0,0]
I will appreciate any advice. Thanks!