<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {mso-style-name:msochpdefault;
        mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";}
span.emailstyle18
        {mso-style-name:emailstyle18;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=TR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Shady; <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You must use vtkPropPicker, and when setting picking point you
must also transform the display point with the inverse transform of the image’s
transform(rotate, scaling etc.)...<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#1F497D'>***Sercani***<o:p></o:p></span></b></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org
[mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>Sarah Macumber<br>
<b>Sent:</b> Friday, September 26, 2008 8:01 PM<br>
<b>To:</b> Shady Shidfar<br>
<b>Cc:</b> VTKUsers<br>
<b>Subject:</b> Re: [vtkusers] problem with vtkPicker(vtkCellPicker,
vtkPointPicker)<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Hi
Shaadi,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>You
are working image data so you probably don’t have cells or points, have you
tried </span><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#548DD4'><a
href="http://www.vtk.org/doc/nightly/html/classvtkPropPicker.html"
target="_blank"><span style='color:#548DD4'>vtkPropPicker</span></a></span><span
lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif"'>? I
don’t work with images but you want a picker that will select a point confined
to the image plane. Try reading the helps on the pickers.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif"'>Best
of luck,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif"'>Sarah</span><span
lang=EN-US style='font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p></o:p></span></p>
</div>
<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Shady Shidfar
[mailto:shady_shidfar@yahoo.com] <br>
<b>Sent:</b> Friday, September 26, 2008 5:25 AM<br>
<b>To:</b> Sarah Macumber; VTKUsers<br>
<b>Subject:</b> Re: [vtkusers] problem with vtkPicker(vtkCellPicker,
vtkPointPicker)<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<div>
<div>
<p class=MsoNormal><span lang=EN-US>Hi Sarah,<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span lang=EN-US>I've tried it with both vtkCellPicker and
vtkPointPicker, but the problem is still there. Can someone please help me.<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span lang=EN-US>Shaadi<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span lang=EN-US><br>
<o:p></o:p></span></p>
</div>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US>----- Original
Message ----<br>
From: Sarah Macumber <S.Macumber@QuestReliability.com><br>
To: Shady Shidfar <shady_shidfar@yahoo.com>; VTKUsers
<vtkusers@vtk.org><br>
Sent: Thursday, 25 September, 2008 21:02:36<br>
Subject: RE: [vtkusers] problem with vtkPicker(vtkCellPicker, vtkPointPicker)<o:p></o:p></span></p>
<div>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Hi Shaadi,</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>vtkPicker will pick 3D world coordinates which may not have a z
value of 0. You will want to use a picker which will return you points
confined to your image plane. You could try using </span><span
lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif"'><a
href="http://www.vtk.org/doc/nightly/html/classvtkCellPicker.html"
target="_blank">vtkCellPicker</a> or <a
href="http://www.vtk.org/doc/nightly/html/classvtkPropPicker.html"
target="_blank">vtkPropPicker</a>.</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>All the best,</span><span lang=EN-US><o:p></o:p></span></p>
<div>
<p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Sarah Macumber</span><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org
[mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>Shady Shidfar<br>
<b>Sent:</b> Thursday, September 25, 2008 4:48 AM<br>
<b>To:</b> VTKUsers<br>
<b>Subject:</b> [vtkusers] problem with vtkPicker(vtkCellPicker,
vtkPointPicker)</span><span lang=EN-US><o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<div>
<div>
<div>
<div>
<div>
<p class=MsoNormal><span lang=EN-US style='color:black'>Hi Everyone,</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'>I sent this yesterday
but I don't know why it didn't apear in the forum. I'm sending it again, please
can someone help me with it.</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'>I'm using vtkPicker to
pick cells on an image and draw on the image. I've copied a short version of my
program. I'm using vtkDotNet and managedItk. I want to draw lines through the
picked points on a 2d tif image. Key 'p' is used to pick a point. The lines
need to remain in the same place they've been drawn no matter zooming or
rotating. The problem is :</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'>1- When I zoom the
image and get the picked cell dimension, Z would be a value rather than 0 which
I don't understand why.</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'>2- When I rotate the
image and pick the points and draw lines. It seems they are in the right place
but when I rotate the image the lines would be somewhere outside the image. </span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'> </span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'>I'm using
picker.GetPickPosition() to get the dimension of the picked point. I'd probably
need to change this. Does anyone know how I can fix the problem? Any
suggestions would be a great help</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'> </span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'>Thanks</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:black'>Shaadi</span><span
lang=EN-US><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System;</span><span lang=EN-US><o:p></o:p></span></p>
</div>
<div>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.Collections.Generic;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.ComponentModel;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.Data;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.Drawing;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.Linq;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.Text;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.Windows.Forms;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> System.Collections;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> vtk;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>using</span><span
lang=EN-US style='font-size:10.0pt'> itk;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>namespace</span><span
lang=EN-US style='font-size:10.0pt'>
InteractiveHierarchicalSegmentationDotNet.Test</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>public</span><span
lang=EN-US style='font-size:10.0pt'> <span style='color:blue'>partial</span> <span
style='color:blue'>class</span> <span style='color:#2B91AF'>testPicking</span>
: <span style='color:#2B91AF'>Form</span></span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkCellPicker</span><span
lang=EN-US style='font-size:10.0pt'> picker;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkRenderer</span><span
lang=EN-US style='font-size:10.0pt'> renderer = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkRenderer</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>public</span><span
lang=EN-US style='font-size:10.0pt'> testPicking()</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>InitializeComponent();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>vtkFormsWindowControl1.GetRenderWindow().AddRenderer(renderer);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>viewImage();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>picker = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkCellPicker</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>picker.PickFromListOn(); <span
style='color:green'>// to make sure picker won't pick props instead of cells</span></span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>picker.AddObserver((<span
style='color:blue'>uint</span>)vtk.<span style='color:#2B91AF'>EventIds</span>.EndPickEvent,
<span style='color:blue'>new</span> vtk.<span style='color:#2B91AF'>vtkDotNetCallback</span>(annotatePick));</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>vtkFormsWindowControl1.GetInteractor().SetPicker(picker);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>private</span><span
lang=EN-US style='font-size:10.0pt'> <span style='color:blue'>void</span>
annotatePick(vtk.<span style='color:#2B91AF'>vtkObject</span> caller, <span
style='color:blue'>uint</span> eventId,</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>object</span><span
lang=EN-US style='font-size:10.0pt'> clientData, <span style='color:#2B91AF'>IntPtr</span>
callData)</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkActor2D</span><span
lang=EN-US style='font-size:10.0pt'> textActor = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkActor2D</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'>[] selPt = picker.GetSelectionPoint();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> x = selPt[0];</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> y = selPt[1];</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'>[] pickPos = picker.GetPickPosition();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> xp = pickPos[0];</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> yp = pickPos[1];</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> zp = pickPos[2];</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>pointsDataGridView.Rows.Add();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>pointsDataGridView.Rows[pointsDataGridView.RowCount
- 1].Cells[0].Value = xp;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>pointsDataGridView.Rows[pointsDataGridView.RowCount
- 1].Cells[1].Value = yp;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>pointsDataGridView.Rows[pointsDataGridView.RowCount
- 1].Cells[2].Value = zp;</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'>[] newPoint = <span style='color:blue'>new</span>
<span style='color:blue'>double</span>[] { xp, yp, zp };</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'>[] previousPoint = <span style='color:blue'>new</span>
<span style='color:blue'>double</span>[3];</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>if</span><span
lang=EN-US style='font-size:10.0pt'> (pointsDataGridView.Rows.Count == 1)</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>previousPoint = newPoint;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>else</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:green'>// retrieve the
previous row</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> pxp = <span style='color:#2B91AF'>Convert</span>.ToDouble(pointsDataGridView.Rows[pointsDataGridView.Rows.Count
- 2].Cells[0].Value);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> pyp = <span style='color:#2B91AF'>Convert</span>.ToDouble(pointsDataGridView.Rows[pointsDataGridView.Rows.Count
- 2].Cells[1].Value);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>double</span><span
lang=EN-US style='font-size:10.0pt'> pzp = <span style='color:#2B91AF'>Convert</span>.ToDouble(pointsDataGridView.Rows[pointsDataGridView.Rows.Count
- 2].Cells[2].Value);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>previousPoint[0] = pxp;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>previousPoint[1] = pyp;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>previousPoint[2] = pzp;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>int</span><span
lang=EN-US style='font-size:10.0pt'> r = 1, g = 0, b = 0;</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>createLine(previousPoint,
newPoint);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>vtkFormsWindowControl1.Refresh();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>private</span><span
lang=EN-US style='font-size:10.0pt'> <span style='color:blue'>void</span>
createLine(<span style='color:blue'>double</span>[] startPoint, <span
style='color:blue'>double</span>[] endPoint)</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkPoints</span><span
lang=EN-US style='font-size:10.0pt'> VTKpoints = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkPoints</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>VTKpoints.SetNumberOfPoints(2);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>VTKpoints.InsertPoint(0,
startPoint[0], startPoint[1], startPoint[2]);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>VTKpoints.InsertPoint(1,
endPoint[0], endPoint[1], endPoint[2]);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'> </span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkLine</span><span
lang=EN-US style='font-size:10.0pt'> line = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkLine</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>line.GetPointIds().SetId(0, 0);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>line.GetPointIds().SetId(1, 1);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkUnstructuredGrid</span><span
lang=EN-US style='font-size:10.0pt'> grid = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkUnstructuredGrid</span>();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>grid.Allocate(1, 1);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>grid.InsertNextCell(line.GetCellType(),
line.GetPointIds());</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>grid.SetPoints(VTKpoints);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkDataSetMapper</span><span
lang=EN-US style='font-size:10.0pt'> aLineMapper = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkDataSetMapper</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>aLineMapper.SetInput(grid);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkActor</span><span
lang=EN-US style='font-size:10.0pt'> aLineActor = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkActor</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>aLineActor.SetMapper(aLineMapper);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>aLineActor.AddPosition(0, 0, 0);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>aLineActor.GetProperty().SetDiffuseColor(1,
0, 0);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>renderer.AddActor(aLineActor);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>vtkFormsWindowControl1.GetRenderWindow().AddRenderer(renderer);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>private</span><span
lang=EN-US style='font-size:10.0pt'> <span style='color:blue'>void</span>
viewImage()</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>try</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>itkImage_UC3</span><span
lang=EN-US style='font-size:10.0pt'> input = <span style='color:#2B91AF'>itkImage_UC3</span>.New();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>input.Read(<span style='color:
#A31515'>"C:/brain.tif"</span>);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:green'>// Import ITK image to
VTK</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>itkImageToVTKImageFilter_IUC3</span><span
lang=EN-US style='font-size:10.0pt'> itk2vtk =</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>itkImageToVTKImageFilter_IUC3</span><span
lang=EN-US style='font-size:10.0pt'>.New();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>itk2vtk.SetInput(input);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>itk2vtk.Update();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkImageData</span><span
lang=EN-US style='font-size:10.0pt'> data = itk2vtk.GetOutput();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>vtkImageFlip</span><span
lang=EN-US style='font-size:10.0pt'> imageFlip = <span style='color:blue'>new</span>
<span style='color:#2B91AF'>vtkImageFlip</span>();</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>imageFlip.SetFilteredAxis(1);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>imageFlip.SetInput(data);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>vtk.<span style='color:#2B91AF'>vtkImageActor</span>
imageActor = <span style='color:blue'>new</span> <span style='color:#2B91AF'>vtkImageActor</span>();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>imageActor.SetInput(imageFlip.GetOutput());</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>renderer.AddActor(imageActor);</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>vtkFormsWindowControl1.Update();</span><span
lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:blue'>catch</span><span
lang=EN-US style='font-size:10.0pt'> (<span style='color:#2B91AF'>Exception</span>
ex)</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>{</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt;color:#2B91AF'>Console</span><span
lang=EN-US style='font-size:10.0pt'>.WriteLine(ex);</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
<p><span lang=EN-US style='font-size:10.0pt'>}</span><span lang=EN-US><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
</div>
</body>
</html>