<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:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:0in;
        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:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {mso-style-name:msochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        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-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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=EN-US link=blue vlink=purple>
<div class=Section1>
<div>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Hi
Shaadi,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span 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 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
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 style='font-size:9.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif"'>Best
of luck,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif"'>Sarah</span><span
style='font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p></o:p></span></p>
</div>
<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 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
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><o:p> </o:p></p>
<div>
<div>
<p class=MsoNormal>Hi Sarah,<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>I've tried it with both vtkCellPicker and vtkPointPicker,
but the problem is still there. Can someone please help me.<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>Shaadi<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><br>
<o:p></o:p></p>
</div>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'>----- 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></p>
<div>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Hi Shaadi,</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span 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
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><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>All the best,</span><o:p></o:p></p>
<div>
<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Sarah Macumber</span><o:p></o:p></p>
</div>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> </span><o:p></o:p></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
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><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal> <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class=MsoNormal><span style='color:black'>Hi Everyone,</span><o:p></o:p></p>
<p class=MsoNormal><span 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><o:p></o:p></p>
<p class=MsoNormal><span 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><o:p></o:p></p>
<p class=MsoNormal><span 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><o:p></o:p></p>
<p class=MsoNormal><span 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><o:p></o:p></p>
<p class=MsoNormal><span style='color:black'> </span><o:p></o:p></p>
<p class=MsoNormal><span 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><o:p></o:p></p>
<p class=MsoNormal><span style='color:black'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:black'>Thanks</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:black'>Shaadi</span><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System;</span><o:p></o:p></p>
</div>
<div>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.Collections.Generic;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.ComponentModel;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.Data;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.Drawing;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.Linq;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.Text;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.Windows.Forms;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> System.Collections;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> vtk;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>using</span><span
style='font-size:10.0pt'> itk;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>namespace</span><span
style='font-size:10.0pt'> InteractiveHierarchicalSegmentationDotNet.Test</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>public</span><span
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><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkCellPicker</span><span
style='font-size:10.0pt'> picker;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkRenderer</span><span
style='font-size:10.0pt'> renderer = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkRenderer</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>public</span><span
style='font-size:10.0pt'> testPicking()</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>InitializeComponent();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>vtkFormsWindowControl1.GetRenderWindow().AddRenderer(renderer);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>viewImage();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>picker = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkCellPicker</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>picker.PickFromListOn(); <span
style='color:green'>// to make sure picker won't pick props instead of cells</span></span><o:p></o:p></p>
<p><span 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><o:p></o:p></p>
<p><span style='font-size:10.0pt'>vtkFormsWindowControl1.GetInteractor().SetPicker(picker);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>private</span><span
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><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>object</span><span
style='font-size:10.0pt'> clientData, <span style='color:#2B91AF'>IntPtr</span>
callData)</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkActor2D</span><span
style='font-size:10.0pt'> textActor = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkActor2D</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'>[] selPt = picker.GetSelectionPoint();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> x = selPt[0];</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> y = selPt[1];</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'>[] pickPos = picker.GetPickPosition();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> xp = pickPos[0];</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> yp = pickPos[1];</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> zp = pickPos[2];</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>pointsDataGridView.Rows.Add();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>pointsDataGridView.Rows[pointsDataGridView.RowCount
- 1].Cells[0].Value = xp;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>pointsDataGridView.Rows[pointsDataGridView.RowCount
- 1].Cells[1].Value = yp;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>pointsDataGridView.Rows[pointsDataGridView.RowCount
- 1].Cells[2].Value = zp;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'>[] newPoint = <span style='color:blue'>new</span> <span
style='color:blue'>double</span>[] { xp, yp, zp };</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'>[] previousPoint = <span style='color:blue'>new</span>
<span style='color:blue'>double</span>[3];</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>if</span><span style='font-size:
10.0pt'> (pointsDataGridView.Rows.Count == 1)</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>previousPoint = newPoint;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>else</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:green'>// retrieve the previous row</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> pxp = <span style='color:#2B91AF'>Convert</span>.ToDouble(pointsDataGridView.Rows[pointsDataGridView.Rows.Count
- 2].Cells[0].Value);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> pyp = <span style='color:#2B91AF'>Convert</span>.ToDouble(pointsDataGridView.Rows[pointsDataGridView.Rows.Count
- 2].Cells[1].Value);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>double</span><span
style='font-size:10.0pt'> pzp = <span style='color:#2B91AF'>Convert</span>.ToDouble(pointsDataGridView.Rows[pointsDataGridView.Rows.Count
- 2].Cells[2].Value);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>previousPoint[0] = pxp;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>previousPoint[1] = pyp;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>previousPoint[2] = pzp;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>int</span><span style='font-size:
10.0pt'> r = 1, g = 0, b = 0;</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>createLine(previousPoint, newPoint);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>vtkFormsWindowControl1.Refresh();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>private</span><span
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><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkPoints</span><span
style='font-size:10.0pt'> VTKpoints = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkPoints</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>VTKpoints.SetNumberOfPoints(2);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>VTKpoints.InsertPoint(0, startPoint[0],
startPoint[1], startPoint[2]);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>VTKpoints.InsertPoint(1, endPoint[0],
endPoint[1], endPoint[2]);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'> </span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkLine</span><span
style='font-size:10.0pt'> line = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkLine</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>line.GetPointIds().SetId(0, 0);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>line.GetPointIds().SetId(1, 1);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkUnstructuredGrid</span><span
style='font-size:10.0pt'> grid = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkUnstructuredGrid</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>grid.Allocate(1, 1);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>grid.InsertNextCell(line.GetCellType(),
line.GetPointIds());</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>grid.SetPoints(VTKpoints);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkDataSetMapper</span><span
style='font-size:10.0pt'> aLineMapper = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkDataSetMapper</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>aLineMapper.SetInput(grid);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkActor</span><span
style='font-size:10.0pt'> aLineActor = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkActor</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>aLineActor.SetMapper(aLineMapper);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>aLineActor.AddPosition(0, 0, 0);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>aLineActor.GetProperty().SetDiffuseColor(1,
0, 0);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>renderer.AddActor(aLineActor);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>vtkFormsWindowControl1.GetRenderWindow().AddRenderer(renderer);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>private</span><span
style='font-size:10.0pt'> <span style='color:blue'>void</span> viewImage()</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>try</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>itkImage_UC3</span><span
style='font-size:10.0pt'> input = <span style='color:#2B91AF'>itkImage_UC3</span>.New();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>input.Read(<span style='color:#A31515'>"C:/brain.tif"</span>);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:green'>// Import ITK image to VTK</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>itkImageToVTKImageFilter_IUC3</span><span
style='font-size:10.0pt'> itk2vtk =</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>itkImageToVTKImageFilter_IUC3</span><span
style='font-size:10.0pt'>.New();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>itk2vtk.SetInput(input);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>itk2vtk.Update();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkImageData</span><span
style='font-size:10.0pt'> data = itk2vtk.GetOutput();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>vtkImageFlip</span><span
style='font-size:10.0pt'> imageFlip = <span style='color:blue'>new</span> <span
style='color:#2B91AF'>vtkImageFlip</span>();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>imageFlip.SetFilteredAxis(1);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>imageFlip.SetInput(data);</span><o:p></o:p></p>
<p><span 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><o:p></o:p></p>
<p><span style='font-size:10.0pt'>imageActor.SetInput(imageFlip.GetOutput());</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>renderer.AddActor(imageActor);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>vtkFormsWindowControl1.Update();</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:blue'>catch</span><span
style='font-size:10.0pt'> (<span style='color:#2B91AF'>Exception</span> ex)</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>{</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;color:#2B91AF'>Console</span><span
style='font-size:10.0pt'>.WriteLine(ex);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
<p><span style='font-size:10.0pt'>}</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>