[vtkusers] MR MPR and labelling

prakash kotre prakash.medsphere at gmail.com
Sat Jul 30 07:21:57 EDT 2011


 Dear All,
  I have developed the 3D MPR for CT using VTK and DCMTK stack.
  It works for Aquisition Data along z-axis.

  Now, I want to do MPR for MR data.
  MR data can be acquired along arbitrary axis.
  If MR data acquired in z-axis, My pipeline renders it correctly.
  If it arbitrary axis then I have problems.
  My steps
  1) I have created the volume from the MR data of same orientation.
  2) I have calculated the normal of slice  (V, normal unit vector of
  plane)
  Now, I want to align this normal vector V to the Z-axis,so that my
  pipeline for CT will take care the rest.
  How do I do this?

In Z-axis aquisition (CT) I set the transform like :

Transform->Identity();
switch(this->SliceType)
        {
        case AXIAL_SLICE:
            break;
        case CORONAL_SLICE:
   Transform->RotateX(90);
            break;
        case SAGITTAL_SLICE:
Transform->RotateY(90);
            Transform->RotateZ(90);
            break;
}

For arbitrary axis acquisition:
I set it as
 Aquisition matrix:
mat = orientation matrix of the aquired slice.
 Transform->setMatrix(mat).
 switch(this->SliceType)
        {
        case AXIAL_SLICE:
            break;
        case CORONAL_SLICE:
   Transform->RotateX(90);
            break;
        case SAGITTAL_SLICE:
    Transform->RotateY(90);
            Transform->RotateZ(90);
            break;
}
 It appears to be renderring correctly.
Is it the right way to do it?
 If yes, Now, how can we label
left/Right,superior/inferior,anterior/posterior.
 In CT case, I calculate using following function, given by the David
clunie.
http://groups.google.com/group/comp.protocols.dicom/browse_thread/thread/1966e9c96b914af2/18783cb56fc54a56?lnk=gst&q=image+orientation
.

>>>>>>>>>>>>>
vector = vtkResliceImage->GetDirectionCosines()
char *
DerivedImagePlane::getOrientation(Vector3D vector)
{
        char *orientation=new char[4];
        char *optr = orientation;
        *optr='\0';
        char orientationX = vector.getX() < 0 ? 'R' : 'L';
        char orientationY = vector.getY() < 0 ? 'A' : 'P';
        char orientationZ = vector.getZ() < 0 ? 'F' : 'H';
        double absX = fabs(vector.getX());
        double absY = fabs(vector.getY());
        double absZ = fabs(vector.getZ());
        int i;
        for (i=0; i<3; ++i) {
                if (absX>.0001 && absX>absY && absX>absZ) {
                        *optr++=orientationX;
                        absX=0;
                }
                else if (absY>.0001 && absY>absX && absY>absZ) {
                        *optr++=orientationY;
                        absY=0;
                }
                else if (absZ>.0001 && absZ>absX && absZ>absY) {
                        *optr++=orientationZ;
                        absZ=0;
                }
                else break;
                *optr='\0';
        }
        return orientation;
}
<<<<<<<<<<<

But as we are applying the matrix instead of identity matrix at the
beginning in the transformation, the labelling is not working correctly for
coronal/sagittal aquired dicom images.

Could you pls help me to sort out this issue?

Thanks and regards
Prakash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110730/99cdddfa/attachment.htm>


More information about the vtkusers mailing list