[vtkusers] Reslice rotation

Fabian Torres fabian.trobles at gmail.com
Wed May 25 18:40:53 EDT 2016


Hi all.

I have a volume and I want to extract the center sagital slice of the
volume and rotate it around the x axis in the center of the image. For this
I'm using vtkImageReslice and vtkTransform.
Everything works fine until I rotate the slice. It is rotating around the
origin of the output image (lower left corner of the image) and not through
the center of it. Can any one explain to me how do I choose the rotation
axis in the transform. here is a brief of my code.

const double MainWindow::sagitalElements[16] = {
0, 0, 1, 0,
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 0, 1
};

volumeData->GetSpacing(spacing);
volumeData->GetOrigin(origin);
volumeData->GetDimensions(dimensions);

centerSlice[0] = floor(dimensions[0]*0.5);
centerSlice[1] = floor(dimensions[1]*0.5);
centerSlice[2] = floor(dimensions[2]*0.5);

positionCenter[0] = origin[0] + spacing[0] * centerSlice[0];
positionCenter[1] = origin[1] + spacing[1] * centerSlice[1];
positionCenter[2] = origin[2] + spacing[2] * centerSlice[2];

resliceAxesSagital->DeepCopy(sagitalElements);

reslicerSagital->SetInput(volumeData);
reslicerSagital->SetOutputDimensionality(2);
reslicerSagital->SetResliceAxes(resliceAxesSagital);
reslicerSagital->SetResliceAxesOrigin(positionCenter);
reslicerSagital->SetInterpolationModeToLinear();


-- 
Fabián Torres Robles
Maestria en Ciencias en Ingeniería Electrónica
Ingeniería en Sistemas Electrónicos
tel. 58081280, 0445534661338
e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160525/5ed6a4f8/attachment.html>


More information about the vtkusers mailing list