<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear vtk users</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Forgive me for just asking you without giving any
contribution yet, since I am still newbie in this field. Hope you can
still enough time to help me to answer my questions. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I want to read a series of CT medical images
(Dicom) format, apply image processing methods to obtain the desired quality of
images and render the volume using volume rendering or surface
rendering. For these purposes I will combine VTK and ITK since as far
as I know these two brother is suitable for these tasks. Below are the steps I
will do:</FONT></DIV>
<DIV><FONT face=Arial size=2>1. Read Dicom files (using ITK)</FONT></DIV>
<DIV><FONT face=Arial size=2>2. Apply image processing methods on each images
(using ITK)</FONT></DIV>
<DIV><FONT face=Arial size=2>3. Apply segmentation process for surface
rendering (using ITK)</FONT></DIV>
<DIV><FONT face=Arial size=2>4. Use the itkImageToVTKImageFilter to convert the
images to the format recognized by VTK.</FONT></DIV>
<DIV><FONT face=Arial size=2>5. Apply volume rendering or surface
rendering.</FONT></DIV>
<DIV><FONT face=Arial size=2>6. Make a render window that contains 4 different
renderers, one renderer to display volume or surface rendering result, and the
rest (3 renderers) are used to display the 3 desired slices.
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here are the list of what I've done:
</FONT></DIV>
<DIV><FONT face=Arial size=2>1. Try to open image file by ITK function and
convert it to VTK format and display it with VTK. I tried this and succeed to
open one image file as illustrated in the code below. </FONT></DIV>
<DIV><FONT face=Arial size=2>2. Convert medical3.cxx example to MFC based
so I can add control button (slider, spinner, checkbox,etc). I succeed to do
this although the speed is slower than its original version. The code I
mentioned in my previous mail.</FONT></DIV>
<DIV><FONT face=Arial size=2>3. Modify the result where there are 4 vtkRenderer
instead of one, so the 3D is displayed in one vtkRenderer, and the rest will
displays the slices in axial, sagittal, coronal plane. The code of this
module is illustrated below. The result is not like I expect since the 3
renderer display the same image. I also add two button to navigate from one
slice to another.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here are my questions and the problems I
have:</FONT></DIV>
<DIV><FONT face=Arial size=2>1. Is the step mention above are correct to achieve
the goal I need?</FONT></DIV>
<DIV><FONT face=Arial size=2>2. Is it correct to apply image
processing methods before it is feed in into the VTK or do with
VTK functions is enough? </FONT></DIV>
<DIV><FONT face=Arial size=2>3. Based on the book, milist and the result of
the trial I made, I make an assumption that to display the resliced images from
a volume, it is used vtkImageActor instead of vtkImgeViewer. Is this
correct?</FONT></DIV>
<DIV><FONT face=Arial size=2>4. I have a difficulties to find a good way how to
reslice the volume and display it in 3 renderer, since these 3 renderers produce
the same images, and I cannot navigate from one slice to another slice in
each direction (sagittal,axial,coronal). Please show me what the
mistakes I've done in the code? </FONT></DIV>
<DIV><FONT face=Arial size=2>5. As I mentioned above I have 4 renderer, lets say
ren1,ren2,ren3,ren4. The ren1 is used for the 3D visualization, and the
other are used to display the 3 resliced images. I want to change the
default interaction mode of the vtkRenderWindowInteractor in ren2,ren3 and ren4
by issuing ren2->interactiveOff(). This function run incorrectly
since when I click the mouse on ren2 area it influence ren1 so the 3D
object in ren1 is moving. How to avoid this problem so 3D object
is moving just by the interaction in ren1. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank you in advance. </FONT></DIV>
<DIV><FONT face=Arial size=2>Paulus</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>// THE CODE TO READ IMAGE AND CONVERT ITK TO
VTK</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include "itkImage.h"<BR>#include
"itkImageFileReader.h"<BR>#include "itkImageFileReader.h"<BR>#include
"vtkImageViewer.h"<BR>#include "vtkRenderWindowInteractor.h"<BR>#include
"itkImageToVTKImageFilter.h"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR>int main( int argc, char ** argv )<BR>{<BR> typedef unsigned
short PixelType;<BR> const
unsigned int Dimension = 2;</DIV>
<DIV> </DIV>
<DIV> typedef itk::Image< PixelType, Dimension >
ImageType;<BR> typedef itk::ImageFileReader< ImageType
> ReaderType;<BR> typedef
itk::ImageToVTKImageFilter< ImageType > ConnectorType;</DIV>
<DIV> </DIV>
<DIV> ReaderType::Pointer reader = ReaderType::New();<BR>
ConnectorType::Pointer connector = ConnectorType::New();<BR>
reader->SetFileName( argv[1] );<BR> //reader->Update();</DIV>
<DIV> </DIV>
<DIV> connector->SetInput(reader->GetOutput()); </DIV>
<DIV> </DIV>
<DIV> vtkImageViewer *viewer=vtkImageViewer::New();<BR>
vtkRenderWindowInteractor *renderWindowInteractor=vtkRenderWindowInteractor
::New();<BR> viewer->SetupInteractor(renderWindowInteractor);<BR>
viewer->SetInput(connector->GetOutput());<BR>
viewer->Render();<BR> viewer->SetColorWindow(255);<BR>
viewer->SetColorLevel(128);<BR>
//renderWindowInteractor->Start();</DIV>
<DIV> </DIV>
<DIV> return 0;<BR>}<BR></DIV>
<DIV>// THE CODE TO READ QUARTER IMAGES, CREATE THE VOLUME AND DISPLAY THE
3 RESLICE OF IT IN 3 DIFFERENT RENDERER</DIV>
<DIV>// MedicalSDIView.cpp : implementation of the CMedicalSDIView
class<BR>//</DIV>
<DIV> </DIV>
<DIV>#include "stdafx.h"<BR>#include "MedicalSDI.h"</DIV>
<DIV> </DIV>
<DIV>#include "MedicalSDIDoc.h"<BR>#include "MedicalSDIView.h"</DIV>
<DIV> </DIV>
<DIV>#ifdef _DEBUG<BR>#define new DEBUG_NEW<BR>#undef THIS_FILE<BR>static char
THIS_FILE[] = __FILE__;<BR>#endif</DIV>
<DIV> </DIV>
<DIV>/////////////////////////////////////////////////////////////////////////////<BR>//
CMedicalSDIView</DIV>
<DIV> </DIV>
<DIV>IMPLEMENT_DYNCREATE(CMedicalSDIView, CFormView)</DIV>
<DIV> </DIV>
<DIV>BEGIN_MESSAGE_MAP(CMedicalSDIView,
CFormView)<BR> //{{AFX_MSG_MAP(CMedicalSDIView)<BR> ON_WM_CREATE()<BR> ON_BN_CLICKED(IDC_BTNDOWN,
OnBtndown)<BR> ON_BN_CLICKED(IDC_BTNUP, OnBtnup)<BR>
//ON_WM_ERASEBKGND() <BR> //}}AFX_MSG_MAP<BR>END_MESSAGE_MAP()</DIV>
<DIV> </DIV>
<DIV>/////////////////////////////////////////////////////////////////////////////<BR>//
CMedicalSDIView construction/destruction</DIV>
<DIV> </DIV>
<DIV>CMedicalSDIView::CMedicalSDIView()<BR> :
CFormView(CMedicalSDIView::IDD)<BR>{<BR> //{{AFX_DATA_INIT(CMedicalSDIView)<BR> //
NOTE: the ClassWizard will add member initialization
here<BR> //}}AFX_DATA_INIT<BR> // TODO: add construction code
here<BR> this->volumeRenderer = vtkRenderer::New();</DIV>
<DIV> </DIV>
<DIV> this->renWin = vtkRenderWindow::New();<BR> this->iren =
vtkRenderWindowInteractor::New();<BR> this->v16 =
vtkVolume16Reader::New();<BR> this->skinExtractor =
vtkContourFilter::New();<BR> this->skinNormals =
vtkPolyDataNormals::New();<BR> this->skinStripper =
vtkStripper::New();<BR> this->skinMapper =
vtkPolyDataMapper::New();<BR> this->skin = vtkActor::New();<BR>
this->boneExtractor = vtkContourFilter::New();<BR> this->boneNormals
= vtkPolyDataNormals::New();<BR> this->boneStripper =
vtkStripper::New();<BR> this->boneMapper =
vtkPolyDataMapper::New();<BR> this->bone = vtkActor::New();<BR>
this->outlineData = vtkOutlineFilter::New();<BR> this->mapOutline =
vtkPolyDataMapper::New();<BR> this->outline =
vtkActor::New();<BR> this->bwLut = vtkLookupTable::New();<BR>
this->hueLut = vtkLookupTable::New();<BR> this->satLut =
vtkLookupTable::New();<BR> this->saggitalColors =
vtkImageMapToColors::New();<BR> this->saggital =
vtkImageActor::New();<BR> this->axialColors =
vtkImageMapToColors::New();<BR> this->axial =
vtkImageActor::New();<BR> this->coronalColors =
vtkImageMapToColors::New();<BR> this->coronal =
vtkImageActor::New();<BR> this->aCamera = vtkCamera::New();</DIV>
<DIV> </DIV>
<DIV> this->coronalShiftScale=vtkImageShiftScale::New(); <BR>
this->coronalRenderer = vtkRenderer::New();<BR>
this->coronalImgActor = vtkImageActor::New();<BR>
this->coronalTransform = vtkTransform::New();<BR> this->coronalSlice
= vtkImageReslice::New();</DIV>
<DIV> </DIV>
<DIV> this->sagittalShiftScale=vtkImageShiftScale::New(); <BR>
this->sagittalRenderer = vtkRenderer::New();<BR>
this->sagittalImgActor = vtkImageActor::New();<BR>
this->sagittalTransform = vtkTransform::New();<BR>
this->sagittalSlice = vtkImageReslice::New();</DIV>
<DIV> </DIV>
<DIV> this->axialShiftScale=vtkImageShiftScale::New(); <BR>
this->axialRenderer = vtkRenderer::New();<BR>
this->axialImgActor = vtkImageActor::New();<BR> this->axialTransform
= vtkTransform::New();<BR> this->axialSlice =
vtkImageReslice::New();</DIV>
<DIV> </DIV>
<DIV> this->shiftScale=vtkImageShiftScale::New(); <BR>
coronalDisp = 0.0;<BR> sagittalDisp = 0.0;<BR>
axialDisp = 0.0;<BR>}</DIV>
<DIV> </DIV>
<DIV>CMedicalSDIView::~CMedicalSDIView()<BR>{<BR>
v16->Delete();<BR> skinExtractor->Delete();<BR>
skinNormals->Delete();<BR> skinStripper->Delete();<BR>
skinMapper->Delete();<BR> skin->Delete();<BR>
boneExtractor->Delete();<BR> boneNormals->Delete();<BR>
boneStripper->Delete();<BR> boneMapper->Delete();<BR>
bone->Delete();<BR> outlineData->Delete();<BR>
mapOutline->Delete();<BR> outline->Delete();<BR>
bwLut->Delete();<BR> hueLut->Delete();<BR>
satLut->Delete();<BR> saggitalColors->Delete();<BR>
saggital->Delete();<BR> axialColors->Delete();<BR>
axial->Delete();<BR> coronalColors->Delete();<BR>
coronal->Delete();<BR> aCamera->Delete();<BR>
renWin->Delete();<BR> iren->Delete();</DIV>
<DIV> </DIV>
<DIV> volumeRenderer->Delete();</DIV>
<DIV> </DIV>
<DIV> coronalRenderer->Delete();<BR>
coronalSlice->Delete();<BR> coronalTransform->Delete();<BR>
coronalImgActor->Delete();</DIV>
<DIV> </DIV>
<DIV> sagittalRenderer->Delete();<BR>
sagittalSlice->Delete();<BR> sagittalTransform->Delete();<BR>
sagittalImgActor->Delete();</DIV>
<DIV> </DIV>
<DIV> axialRenderer->Delete();<BR>
axialSlice->Delete();<BR> axialTransform->Delete();<BR>
axialImgActor->Delete();</DIV>
<DIV> </DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>void CMedicalSDIView::DoDataExchange(CDataExchange*
pDX)<BR>{<BR> CFormView::DoDataExchange(pDX);<BR> //{{AFX_DATA_MAP(CMedicalSDIView)<BR> //
NOTE: the ClassWizard will add DDX and DDV calls
here<BR> //}}AFX_DATA_MAP<BR>}</DIV>
<DIV> </DIV>
<DIV>BOOL CMedicalSDIView::PreCreateWindow(CREATESTRUCT&
cs)<BR>{<BR> // TODO: Modify the Window class or styles here by
modifying<BR> // the CREATESTRUCT cs</DIV>
<DIV> </DIV>
<DIV> return CFormView::PreCreateWindow(cs);<BR>}</DIV>
<DIV> </DIV>
<DIV>void
CMedicalSDIView::OnInitialUpdate()<BR>{<BR> CFormView::OnInitialUpdate();<BR> GetParentFrame()->RecalcLayout();<BR> ResizeParentToFit();</DIV>
<DIV> </DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>/////////////////////////////////////////////////////////////////////////////<BR>//
CMedicalSDIView diagnostics</DIV>
<DIV> </DIV>
<DIV>#ifdef _DEBUG<BR>void CMedicalSDIView::AssertValid()
const<BR>{<BR> CFormView::AssertValid();<BR>}</DIV>
<DIV> </DIV>
<DIV>void CMedicalSDIView::Dump(CDumpContext& dc)
const<BR>{<BR> CFormView::Dump(dc);<BR>}</DIV>
<DIV> </DIV>
<DIV>CMedicalSDIDoc* CMedicalSDIView::GetDocument() // non-debug version is
inline<BR>{<BR> ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMedicalSDIDoc)));<BR> return
(CMedicalSDIDoc*)m_pDocument;<BR>}<BR>#endif //_DEBUG</DIV>
<DIV> </DIV>
<DIV>/////////////////////////////////////////////////////////////////////////////<BR>//
CMedicalSDIView message handlers</DIV>
<DIV> </DIV>
<DIV>void CMedicalSDIView::Pipeline()<BR>{<BR>
renWin->AddRenderer(volumeRenderer);<BR>
renWin->AddRenderer(coronalRenderer);<BR>
renWin->AddRenderer(axialRenderer);<BR>
renWin->AddRenderer(sagittalRenderer);<BR> iren
->SetRenderWindow(renWin);</DIV>
<DIV> </DIV>
<DIV> v16->SetDataDimensions(64,64);<BR>
v16->SetDataByteOrderToLittleEndian();<BR>
v16->SetFilePrefix ("..\\data\\headsq\\quarter");<BR>
v16->SetImageRange(1, 93);<BR> v16->SetDataSpacing (3.2,
3.2, 1.5);</DIV>
<DIV> </DIV>
<DIV><BR> skinExtractor->SetInput(
v16->GetOutput());<BR> skinExtractor->SetValue(0,
500);<BR>
skinNormals->SetInput(skinExtractor->GetOutput());<BR>
skinNormals->SetFeatureAngle(60.0);<BR>
skinStripper->SetInput(skinNormals->GetOutput());<BR>
skinMapper->SetInput(skinStripper->GetOutput());<BR>
skinMapper->ScalarVisibilityOff();<BR>
skin->SetMapper(skinMapper);</DIV>
<DIV> </DIV>
<DIV> skin->GetProperty()->SetDiffuseColor(1, 49,
25);<BR>
skin->GetProperty()->SetSpecular(.3);<BR>
skin->GetProperty()->SetSpecularPower(20);</DIV>
<DIV> </DIV>
<DIV> boneExtractor->SetInput((vtkDataSet *)
v16->GetOutput());<BR> boneExtractor->SetValue(0,
1150);<BR>
boneNormals->SetInput(boneExtractor->GetOutput());<BR>
boneNormals->SetFeatureAngle(60.0);<BR>
boneStripper->SetInput(boneNormals->GetOutput());<BR>
boneMapper->SetInput(boneStripper->GetOutput());<BR>
boneMapper->ScalarVisibilityOff();<BR>
bone->SetMapper(boneMapper);<BR>
bone->GetProperty()->SetDiffuseColor(1, 1, .9412);</DIV>
<DIV> </DIV>
<DIV> outlineData->SetInput((vtkDataSet *)
v16->GetOutput());<BR>
mapOutline->SetInput(outlineData->GetOutput());<BR>
outline->SetMapper(mapOutline);<BR>
outline->GetProperty()->SetColor(0,0,0);</DIV>
<DIV> </DIV>
<DIV> bwLut->SetTableRange (0, 2000);<BR>
bwLut->SetSaturationRange (0, 0);<BR> bwLut->SetHueRange
(0, 0);<BR> bwLut->SetValueRange (0, 1);</DIV>
<DIV> </DIV>
<DIV> hueLut->SetTableRange (0,
2000);<BR> hueLut->SetHueRange (0,
1);<BR> hueLut->SetSaturationRange (1,
1);<BR> hueLut->SetValueRange (1, 1);</DIV>
<DIV> </DIV>
<DIV> satLut->SetTableRange (0,
2000);<BR> satLut->SetHueRange (.6,
6);<BR> satLut->SetSaturationRange (0,
1);<BR> satLut->SetValueRange (1, 1);</DIV>
<DIV> </DIV>
<DIV>
saggitalColors->SetInput(v16->GetOutput());<BR>
saggitalColors->SetLookupTable(bwLut);<BR>
saggital->SetInput(saggitalColors->GetOutput());<BR>
saggital->SetDisplayExtent(32,32, 0,63, 0,92);</DIV>
<DIV> </DIV>
<DIV>
axialColors->SetInput(v16->GetOutput());<BR>
axialColors->SetLookupTable(hueLut);<BR>
axial->SetInput(axialColors->GetOutput());<BR>
axial->SetDisplayExtent(0,63, 0,63, 46,46);</DIV>
<DIV> </DIV>
<DIV>
coronalColors->SetInput(v16->GetOutput());<BR>
coronalColors->SetLookupTable(satLut);</DIV>
<DIV> </DIV>
<DIV>
coronal->SetInput(coronalColors->GetOutput());<BR>
coronal->SetDisplayExtent(0,63, 32,32, 0,92);</DIV>
<DIV> </DIV>
<DIV> aCamera->SetViewUp (0, 0, -1);<BR>
aCamera->SetPosition (0, 1, 0);<BR>
aCamera->SetFocalPoint (0, 0, 0);<BR>
aCamera->ComputeViewPlaneNormal();</DIV>
<DIV> </DIV>
<DIV>
volumeRenderer->AddActor(outline);<BR>
volumeRenderer->AddActor(saggital);<BR>
volumeRenderer->AddActor(axial);<BR>
volumeRenderer->AddActor(coronal);<BR>
volumeRenderer->AddActor(axial);<BR>
volumeRenderer->AddActor(coronal);<BR>
volumeRenderer->AddActor(skin);<BR>
volumeRenderer->AddActor(bone);</DIV>
<DIV> </DIV>
<DIV><BR> coronalTransform ->Translate(0,coronalDisp,0);<BR>
sagittalTransform->Translate(sagittalDisp,0,0);<BR>
axialTransform ->Translate(0,0,axialDisp);<BR>//
coronal<BR> coronalSlice->SetInput(v16->GetOutput());<BR>
coronalSlice->SetResliceTransform(coronalTransform);<BR>
coronalSlice->InterpolateOn();<BR>
coronalSlice->SetInterpolationModeToCubic();<BR>
coronalSlice->SetBackgroundLevel(1023);</DIV>
<DIV> </DIV>
<DIV>
coronalShiftScale->SetInput(coronalSlice->GetOutput());<BR>
coronalShiftScale->SetShift(0);<BR>
coronalShiftScale->SetScale(0.07);<BR>
coronalShiftScale->SetOutputScalarTypeToUnsignedChar();</DIV>
<DIV> </DIV>
<DIV>
coronalImgActor->SetInput(coronalShiftScale->GetOutput());<BR>
coronalRenderer->AddActor(coronalImgActor);<BR>
coronalRenderer->InteractiveOff();<BR>// sagital<BR>
sagittalSlice->SetInput(v16->GetOutput());<BR>
sagittalSlice->SetResliceTransform(sagittalTransform);<BR>
sagittalSlice->InterpolateOn();<BR>
sagittalSlice->SetInterpolationModeToCubic();<BR>
sagittalSlice->SetBackgroundLevel(1023);</DIV>
<DIV> </DIV>
<DIV>
sagittalShiftScale->SetInput(sagittalSlice->GetOutput());<BR>
sagittalShiftScale->SetShift(0);<BR>
sagittalShiftScale->SetScale(0.07);<BR>
sagittalShiftScale->SetOutputScalarTypeToUnsignedChar();</DIV>
<DIV> </DIV>
<DIV>
sagittalImgActor->SetInput(sagittalShiftScale->GetOutput());<BR>
sagittalRenderer->AddActor(sagittalImgActor);<BR>
sagittalRenderer->InteractiveOff();<BR>// axial<BR>
axialSlice->SetInput(v16->GetOutput());<BR>
axialSlice->SetResliceTransform(axialTransform);<BR>
axialSlice->InterpolateOn();<BR>
axialSlice->SetInterpolationModeToCubic();<BR>
axialSlice->SetBackgroundLevel(1023);</DIV>
<DIV> </DIV>
<DIV> <BR>
axialShiftScale->SetInput(axialSlice->GetOutput());<BR>
axialShiftScale->SetShift(0);<BR>
axialShiftScale->SetScale(0.07);<BR>
axialShiftScale->SetOutputScalarTypeToUnsignedChar();</DIV>
<DIV> </DIV>
<DIV>
axialImgActor->SetInput(axialShiftScale->GetOutput());<BR>
axialRenderer->AddActor(axialImgActor);<BR>
axialRenderer->InteractiveOff();<BR> // Turn off bone for this
example.<BR> bone->VisibilityOff();</DIV>
<DIV> </DIV>
<DIV> // Set skin to semi-transparent.<BR>
skin->GetProperty()->SetOpacity(0.5);</DIV>
<DIV> </DIV>
<DIV> // An initial camera view is created. The Dolly() method moves
<BR> // the camera towards the FocalPoint, thereby enlarging the
image.<BR> volumeRenderer->SetActiveCamera(aCamera);<BR>
volumeRenderer->ResetCamera ();<BR> aCamera->Dolly(1.5);</DIV>
<DIV> </DIV>
<DIV><BR> // Set a background color for the renderer and set the size of
the<BR> // render window (expressed in pixels).<BR>
volumeRenderer->SetBackground(1,1,1);<BR>
//renWin->SetSize(512,512);</DIV>
<DIV> </DIV>
<DIV> // Note that when camera movement occurs (as it does in the
Dolly()<BR> // method), the clipping planes often need adjusting. Clipping
planes<BR> // consist of two planes: near and far along the view
direction. The <BR> // near plane clips out objects in front of the plane;
the far plane<BR> // clips out objects behind the plane. This way only
what is drawn<BR> // between the planes is actually rendered.<BR>
volumeRenderer->ResetCameraClippingRange ();</DIV>
<DIV> </DIV>
<DIV> // interact with data<BR> //iren->Initialize();<BR>
//iren->Start(); </DIV>
<DIV> </DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>void CMedicalSDIView::OnDraw(CDC* pDC) <BR>{<BR> CPaintDC dc(this);
// device context for painting<BR> <BR> // TODO: Add your message
handler code here<BR> <BR> CMedicalSDIDoc* pDoc =
GetDocument();<BR> ASSERT_VALID(pDoc);<BR> // TODO: Add your
specialized code here and/or call the base class<BR> if (
!this->iren->GetInitialized() )<BR> {<BR> CRect
rect;</DIV>
<DIV> </DIV>
<DIV> this->GetClientRect(&rect);<BR>
this->iren->Initialize();<BR>
this->renWin->SetPosition(250,0);<BR>
//this->renWin->SetSize(rect.right-rect.left-100,rect.bottom-rect.top-100);<BR>
this->renWin->SetSize(1024,1024);</DIV>
<DIV> </DIV>
<DIV> this->volumeRenderer->ResetCamera();<BR>
}</DIV>
<DIV> </DIV>
<DIV> // Invoke the pipeline<BR> Pipeline();<BR>
this->renWin->Render();</DIV>
<DIV> </DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>int CMedicalSDIView::OnCreate(LPCREATESTRUCT lpCreateStruct)
<BR>{<BR> if (CFormView::OnCreate(lpCreateStruct) ==
-1)<BR> return -1;<BR> <BR> // TODO: Add your specialized
creation code here<BR>
this->volumeRenderer->SetViewport(0.0,0.0,0.5,0.5);<BR>
this->volumeRenderer->SetBackground(0.2,0.3,0.3); <BR>
this->renWin->AddRenderer(this->volumeRenderer);</DIV>
<DIV> </DIV>
<DIV>
this->sagittalRenderer->SetViewport(0.5,0.0,1.0,0.5);<BR>
this->sagittalRenderer->SetBackground(0.2,0.3,0.3); <BR>
this->renWin->AddRenderer(this->sagittalRenderer);</DIV>
<DIV> </DIV>
<DIV> this->axialRenderer->SetViewport(0.0,0.5,0.5,1.0);<BR>
this->axialRenderer->SetBackground(0.2,0.3,0.3); <BR>
this->renWin->AddRenderer(this->axialRenderer);<BR> <BR>
this->coronalRenderer->SetViewport(0.5,0.5,1.0,1.0);<BR>
this->coronalRenderer->SetBackground(0.2,0.3,0.3); <BR>
this->renWin->AddRenderer(this->coronalRenderer);<BR> <BR>
// setup the parent window<BR>
this->renWin->SetParentId(this->m_hWnd);<BR>
this->iren->SetRenderWindow(this->renWin);<BR> <BR> return
0;<BR>}</DIV>
<DIV> </DIV>
<DIV>void CMedicalSDIView::OnBtndown() <BR>{<BR> // TODO: Add your control
notification handler code here<BR> coronalDisp = coronalDisp -
0.1;<BR> sagittalDisp = sagittalDisp -
0.1;<BR> axialDisp = axialDisp -
0.1;<BR> InvalidateRect(NULL,FALSE);<BR> <BR>}</DIV>
<DIV> </DIV>
<DIV>void CMedicalSDIView::OnBtnup() <BR>{<BR> // TODO: Add your control
notification handler code here<BR> coronalDisp = coronalDisp +
0.1;<BR> sagittalDisp = sagittalDisp +
0.1;<BR> axialDisp = axialDisp +
0.1;<BR> InvalidateRect(NULL,FALSE);<BR> <BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></FONT></BODY></HTML>