<div dir="ltr"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">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);
transformSagital->RotateX(rotate);
reslicerSagital->SetInput(volumeData);
reslicerSagital->SetOutputDimensionality(2);
reslicerSagital->SetResliceAxes(resliceAxesSagital);
reslicerSagital->SetResliceAxesOrigin(positionCenter);
reslicerSagital->SetInterpolationModeToLinear();
reslicerSagital->SetResliceTransform(transformSagital);
reslicerSagital->Update();
sliceImageSagital = reslicerSagital->GetOutput();
As I dsaid before the problem is that I want to rotate around the
center of the image and not the origin of the image.
Thanks a lot</pre><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Fabián Torres Robles<br>Maestria en Ciencias en Ingeniería Electrónica<br>Ingeniería en Sistemas Electrónicos<br>tel. 58081280, 0445534661338<br>e-mail <a href="mailto:fabian.trobles@gmail.com" target="_blank">fabian.trobles@gmail.com</a>, <a href="mailto:dae.wong@gmail.com" target="_blank">dae.wong@gmail.com</a> <div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div></div>
</div>