<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Ahmad,<br>
<br>
Take a look at vtkCamera::OrthogonalizeViewUp().<br>
<br>
Marc<br>
<br>
Zack Galbreath wrote:
<blockquote cite="mid:467AC00F.50604@kitware.com" type="cite"><br>
  <br>
  <hr size="4" width="90%"><br>
  <table class="header-part1" border="0" cellpadding="0" cellspacing="0"
 width="100%">
    <tbody>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">Subject:
        </div>
Problem with volume rendering</td>
      </tr>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">From: </div>
Ahmad Abdel-khalek <a class="moz-txt-link-rfc2396E" href="mailto:zondous@yahoo.com">&lt;zondous@yahoo.com&gt;</a></td>
      </tr>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">Date: </div>
Thu, 21 Jun 2007 10:54:18 -0700 (PDT)</td>
      </tr>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">To: </div>
<a class="moz-txt-link-abbreviated" href="mailto:mailman-owner@vtk.org">mailman-owner@vtk.org</a></td>
      </tr>
    </tbody>
  </table>
  <table class="header-part2" border="0" cellpadding="0" cellspacing="0"
 width="100%">
    <tbody>
      <tr>
        <td>
        <div class="headerdisplayname" style="display: inline;">To: </div>
<a class="moz-txt-link-abbreviated" href="mailto:mailman-owner@vtk.org">mailman-owner@vtk.org</a></td>
      </tr>
    </tbody>
  </table>
  <br>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">Hi all&#8230;</font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">I am having a trouble concerning volume
rendering as (I don&#8217;t know for what reason) not all data(DICOM data
sets) works for me&#8230; they sometimes give me this error:</font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">vtkOpenGLRenderer (03660D00): Resetting
view-up since view plane normal is parallel</font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font size="3"><font
 face="Calibri">and it doesn&#8217;t show anything in the render window&#8230;</font></font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">Any suggestions concerning this topic? I would
really appreciate any help&#8230;</font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">The code through the button used for volume
rendering used:</font></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; color: blue; font-family: 'Courier New';">void</span><span
 style="font-size: 10pt; font-family: 'Courier New';">
Demo::on_pushButton_3_clicked()<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">{<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">vtkPiecewiseFunction*
opacityTransferFunction = vtkPiecewiseFunction::New();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">opacityTransferFunction-&gt;AddPoint(20,0.0);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">opacityTransferFunction-&gt;AddPoint(255,0.2);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; color: green; font-family: 'Courier New';">//
Create transfer mapping scalar value to color<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">vtkColorTransferFunction*
colorTransferFunction=vtkColorTransferFunction::New();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">colorTransferFunction-&gt;AddRGBPoint(
0.0,0.0,0.0,0.0);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">colorTransferFunction-&gt;AddRGBPoint(64.0,1.0,0.0,0.0);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">colorTransferFunction-&gt;AddRGBPoint(128.0,0.0,0.0,1.0);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">colorTransferFunction-&gt;AddRGBPoint(192.0,0.0,1.0,0.0);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">colorTransferFunction-&gt;AddRGBPoint(255.0,0.0,0.2,0.0);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; color: green; font-family: 'Courier New';">//
The property describes how the data will look<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">vtkVolumeProperty*
volumeProperty=vtkVolumeProperty::New();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">volumeProperty-&gt;SetColor(colorTransferFunction);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">volumeProperty-&gt;SetScalarOpacity(opacityTransferFunction);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">volumeProperty-&gt;ShadeOn();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt;">volumeProperty-&gt;SetInterpolationTypeToLinear;<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; color: green; font-family: 'Courier New';">//
The mapper / ray cast function know how to render the data<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">vtkVolumeRayCastCompositeFunction*
compositeFunction = vtkVolumeRayCastCompositeFunction::New();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">vtkVolumeRayCastMapper*
volumeMapper = vtkVolumeRayCastMapper::New();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">volumeMapper-&gt;SetVolumeRayCastFunction(compositeFunction);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">volumeMapper-&gt;SetInputConnection(dicomReader-&gt;GetOutputPort());<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; color: green; font-family: 'Courier New';">//
The volume holds the mapper and the property and<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; color: green; font-family: 'Courier New';">//
can be used to position/orient the volume<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">vtkVolume* volume
= vtkVolume::New();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">volume-&gt;SetMapper(volumeMapper);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">volume-&gt;SetProperty(volumeProperty);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">ren_Vol-&gt;AddVolume(volume);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">vtkCamera
*aCamera = vtkCamera::New();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">aCamera-&gt;SetViewUp(0,
0, -1);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">ren_Vol-&gt;SetActiveCamera(aCamera);<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">ren_Vol-&gt;ResetCamera();<o:p></o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></div>
  <div class="MsoNormal"
 style="margin: 0in 0in 0pt; line-height: normal;"><span
 style="font-size: 10pt; font-family: 'Courier New';">}<o:p></o:p></span></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><o:p><font
 face="Calibri" size="3">&nbsp;</font></o:p></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">Thanks in advance</font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">Regards,</font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">Ahmad Abdel-Khalek</font></div>
  <div class="MsoNormal" style="margin: 0in 0in 10pt;"><font
 face="Calibri" size="3">Senior Student in Systems and Biomedical
Engineering Department</font></div>
  <p> </p>
  <hr size="1">Yahoo! oneSearch: Finally, <a moz-do-not-send="true"
 href="http://us.rd.yahoo.com/evt=48252/*http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC">
mobile search that gives answers</a>, not web links.
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
  </pre>
</blockquote>
</body>
</html>