Reg:Oblique MPR

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Reg:Oblique MPR

Pandia raja
Hi,

Could you please help me to generate Oblique MPR. I can able to generate Orthogonal MPR using the below code.My requirement is based on the angle seletion I need to generate sagittal and coronal images,


dicomImageReader.SetDirectoryName ( dicomImagePath );
dicomImageReader.Update ();
xyminmax = dicomImageReader.GetOutput ().GetExtent ();
xMin = xyminmax[0];
xMax = xyminmax[1];
yMin = xyminmax[2];
yMax = xyminmax[3];
zMin = xyminmax[4];
zMax = xyminmax[5];

spacing = dicomImageReader.GetOutput ().GetSpacing ();
sx = spacing[0];
sy = spacing[1];
sz = spacing[2];

origin = dicomImageReader.GetOutput ().GetOrigin ();
ox = origin[0];
oy = origin[1];
oz = origin[2];
//Display mpr image
double cx = (ox + (0.5 * (xMax - xMin)) * sx);
double cy = (oy + (0.5 * (yMax - yMin)) * sy);
double cz = (oy + (0.5 * (zMax - zMin)) * sz);

double[] axialElements = { 1, 0, 0, cx, 0, 1, 0, cy, 0, 0, 1, cz, 0, 0, 0, 1 };
double[] coronalElements = { 1, 0, 0, cx, 0, 0, 1, cy, 0, -1, 0, cz, 0, 0, 0, 1 };
double[] sagittalElements = { 0, 0, -1, cx, -1, 0, 0, cy, 0, -1, 0, cz, 0, 0, 0, 1 };

// For display the Axial Slice...
// Set the slice orientation...
vtkMatrix4x4 axialResliceAxes = new vtkMatrix4x4();
axialResliceAxes.DeepCopy(axialElements);

// Extract a slice in the desired orientation...
axialReslice = new vtkImageReslice();
//axialReslice.SetSlabNumberOfSlices ( 1 );
axialReslice.SetInputConnection(dicomImageReader.GetOutputPort());
axialReslice.SetOutputDimensionality(2);
axialReslice.SetResliceAxes(axialResliceAxes);
axialReslice.SetInterpolationModeToLinear();
axialReslice.SetResliceAxes(axialResliceAxes);

// For display the Coronal Slice...
// Set the slice orientation...
vtkMatrix4x4 coronalResliceAxes = new vtkMatrix4x4();
coronalResliceAxes.DeepCopy(coronalElements);

// Extract a slice in the desired orientation...
coronalReslice = new vtkImageReslice();
coronalReslice.SetInputConnection(dicomImageReader.GetOutputPort());
coronalReslice.SetOutputDimensionality(2);
coronalReslice.SetResliceAxes(coronalResliceAxes);
coronalReslice.SetInterpolationModeToLinear();
coronalReslice.SetResliceAxes(coronalResliceAxes);

// For display the Sagittal Slice...
// Set the slice orientation...
vtkMatrix4x4 sagittalResliceAxes = new vtkMatrix4x4();
sagittalResliceAxes.DeepCopy(sagittalElements);

// Extract a slice in the desired orientation
sagittalReslice = new vtkImageReslice();
sagittalReslice.SetInputConnection(dicomImageReader.GetOutputPort());
sagittalReslice.SetOutputDimensionality(2);
sagittalReslice.SetResliceAxes(sagittalResliceAxes);
sagittalReslice.SetInterpolationModeToLinear();
sagittalReslice.SetResliceAxes(sagittalResliceAxes);
dicomImageReader.Delete ();

Thanks,
Pandiyan



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reg:Oblique MPR

Sankhesh Jhaveri-2

Hi Pandiyan,

You should be able to use the same class (vtkImageReslice) to generate oblique MPR. Just use the appropriate reslice axes direction cosines and origin.

Hope that helps.

Sankhesh


On Mon, Mar 6, 2017 at 5:40 AM Pandia raja <[hidden email]> wrote:
Hi,

Could you please help me to generate Oblique MPR. I can able to generate Orthogonal MPR using the below code.My requirement is based on the angle seletion I need to generate sagittal and coronal images,


dicomImageReader.SetDirectoryName ( dicomImagePath );
dicomImageReader.Update ();
xyminmax = dicomImageReader.GetOutput ().GetExtent ();
xMin = xyminmax[0];
xMax = xyminmax[1];
yMin = xyminmax[2];
yMax = xyminmax[3];
zMin = xyminmax[4];
zMax = xyminmax[5];

spacing = dicomImageReader.GetOutput ().GetSpacing ();
sx = spacing[0];
sy = spacing[1];
sz = spacing[2];

origin = dicomImageReader.GetOutput ().GetOrigin ();
ox = origin[0];
oy = origin[1];
oz = origin[2];
//Display mpr image
double cx = (ox + (0.5 * (xMax - xMin)) * sx);
double cy = (oy + (0.5 * (yMax - yMin)) * sy);
double cz = (oy + (0.5 * (zMax - zMin)) * sz);

double[] axialElements = { 1, 0, 0, cx, 0, 1, 0, cy, 0, 0, 1, cz, 0, 0, 0, 1 };
double[] coronalElements = { 1, 0, 0, cx, 0, 0, 1, cy, 0, -1, 0, cz, 0, 0, 0, 1 };
double[] sagittalElements = { 0, 0, -1, cx, -1, 0, 0, cy, 0, -1, 0, cz, 0, 0, 0, 1 };

// For display the Axial Slice...
// Set the slice orientation...
vtkMatrix4x4 axialResliceAxes = new vtkMatrix4x4();
axialResliceAxes.DeepCopy(axialElements);

// Extract a slice in the desired orientation...
axialReslice = new vtkImageReslice();
//axialReslice.SetSlabNumberOfSlices ( 1 );
axialReslice.SetInputConnection(dicomImageReader.GetOutputPort());
axialReslice.SetOutputDimensionality(2);
axialReslice.SetResliceAxes(axialResliceAxes);
axialReslice.SetInterpolationModeToLinear();
axialReslice.SetResliceAxes(axialResliceAxes);

// For display the Coronal Slice...
// Set the slice orientation...
vtkMatrix4x4 coronalResliceAxes = new vtkMatrix4x4();
coronalResliceAxes.DeepCopy(coronalElements);

// Extract a slice in the desired orientation...
coronalReslice = new vtkImageReslice();
coronalReslice.SetInputConnection(dicomImageReader.GetOutputPort());
coronalReslice.SetOutputDimensionality(2);
coronalReslice.SetResliceAxes(coronalResliceAxes);
coronalReslice.SetInterpolationModeToLinear();
coronalReslice.SetResliceAxes(coronalResliceAxes);

// For display the Sagittal Slice...
// Set the slice orientation...
vtkMatrix4x4 sagittalResliceAxes = new vtkMatrix4x4();
sagittalResliceAxes.DeepCopy(sagittalElements);

// Extract a slice in the desired orientation
sagittalReslice = new vtkImageReslice();
sagittalReslice.SetInputConnection(dicomImageReader.GetOutputPort());
sagittalReslice.SetOutputDimensionality(2);
sagittalReslice.SetResliceAxes(sagittalResliceAxes);
sagittalReslice.SetInterpolationModeToLinear();
sagittalReslice.SetResliceAxes(sagittalResliceAxes);
dicomImageReader.Delete ();

Thanks,
Pandiyan


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reg:Oblique MPR

David Gobbi
I'll add that you can use SetResliceAxes() and SetResliceTransform() together.  Use the former to define a set of axes, and use the latter to apply a rotation.

 - David

On Mon, Mar 6, 2017 at 7:05 AM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi Pandiyan,

You should be able to use the same class (vtkImageReslice) to generate oblique MPR. Just use the appropriate reslice axes direction cosines and origin.

Hope that helps.

Sankhesh


On Mon, Mar 6, 2017 at 5:40 AM Pandia raja <[hidden email]> wrote:
Hi,

Could you please help me to generate Oblique MPR. I can able to generate Orthogonal MPR using the below code.My requirement is based on the angle seletion I need to generate sagittal and coronal images,


dicomImageReader.SetDirectoryName ( dicomImagePath );
dicomImageReader.Update ();
xyminmax = dicomImageReader.GetOutput ().GetExtent ();
xMin = xyminmax[0];
xMax = xyminmax[1];
yMin = xyminmax[2];
yMax = xyminmax[3];
zMin = xyminmax[4];
zMax = xyminmax[5];

spacing = dicomImageReader.GetOutput ().GetSpacing ();
sx = spacing[0];
sy = spacing[1];
sz = spacing[2];

origin = dicomImageReader.GetOutput ().GetOrigin ();
ox = origin[0];
oy = origin[1];
oz = origin[2];
//Display mpr image
double cx = (ox + (0.5 * (xMax - xMin)) * sx);
double cy = (oy + (0.5 * (yMax - yMin)) * sy);
double cz = (oy + (0.5 * (zMax - zMin)) * sz);

double[] axialElements = { 1, 0, 0, cx, 0, 1, 0, cy, 0, 0, 1, cz, 0, 0, 0, 1 };
double[] coronalElements = { 1, 0, 0, cx, 0, 0, 1, cy, 0, -1, 0, cz, 0, 0, 0, 1 };
double[] sagittalElements = { 0, 0, -1, cx, -1, 0, 0, cy, 0, -1, 0, cz, 0, 0, 0, 1 };

// For display the Axial Slice...
// Set the slice orientation...
vtkMatrix4x4 axialResliceAxes = new vtkMatrix4x4();
axialResliceAxes.DeepCopy(axialElements);

// Extract a slice in the desired orientation...
axialReslice = new vtkImageReslice();
//axialReslice.SetSlabNumberOfSlices ( 1 );
axialReslice.SetInputConnection(dicomImageReader.GetOutputPort());
axialReslice.SetOutputDimensionality(2);
axialReslice.SetResliceAxes(axialResliceAxes);
axialReslice.SetInterpolationModeToLinear();
axialReslice.SetResliceAxes(axialResliceAxes);

// For display the Coronal Slice...
// Set the slice orientation...
vtkMatrix4x4 coronalResliceAxes = new vtkMatrix4x4();
coronalResliceAxes.DeepCopy(coronalElements);

// Extract a slice in the desired orientation...
coronalReslice = new vtkImageReslice();
coronalReslice.SetInputConnection(dicomImageReader.GetOutputPort());
coronalReslice.SetOutputDimensionality(2);
coronalReslice.SetResliceAxes(coronalResliceAxes);
coronalReslice.SetInterpolationModeToLinear();
coronalReslice.SetResliceAxes(coronalResliceAxes);

// For display the Sagittal Slice...
// Set the slice orientation...
vtkMatrix4x4 sagittalResliceAxes = new vtkMatrix4x4();
sagittalResliceAxes.DeepCopy(sagittalElements);

// Extract a slice in the desired orientation
sagittalReslice = new vtkImageReslice();
sagittalReslice.SetInputConnection(dicomImageReader.GetOutputPort());
sagittalReslice.SetOutputDimensionality(2);
sagittalReslice.SetResliceAxes(sagittalResliceAxes);
sagittalReslice.SetInterpolationModeToLinear();
sagittalReslice.SetResliceAxes(sagittalResliceAxes);
dicomImageReader.Delete ();

Thanks,
Pandiyan


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

Loading...