<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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:Batang;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:MingLiU;
        panose-1:2 2 3 9 0 0 0 0 0 0;}
@font-face
        {font-family:MingLiU;
        panose-1:2 2 3 9 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@Batang";
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@MingLiU";
        panose-1:2 2 3 9 0 0 0 0 0 0;}
@font-face
        {font-family:"\@Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:바탕;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        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;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:625817626;
        mso-list-type:hybrid;
        mso-list-template-ids:176714366 2083954224 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:20.25pt;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1
        {mso-list-id:1153988666;
        mso-list-type:hybrid;
        mso-list-template-ids:-859559316 1497009808 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:22.5pt;
        text-indent:-.25in;}
@list l1:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Dear Sam,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks a lot for your help. It works now! Still I have another small question. Here is my code. You can find that I define some variables such as </span><span style='font-size:10.0pt;font-family:"Courier New"'>picked[3]</span><span style='color:#1F497D'> and </span><span style='font-size:10.0pt;font-family:"Courier New"'>pixelIndex</span><span style='color:#1F497D'>. Then I made the transformation from physical point to index in the interaction style class and showed the index in command line. So far everything worked well. And then in the</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'> int </span><span style='font-size:10.0pt;font-family:"Courier New"'>main</span><span style='color:#1F497D'> code, I would like to use the transformed index to do something, for example using the index as a seed point for segmentation. However, the index always 0, 0, 0. Do you know why?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&lt;vtkSmartPointer.h&gt;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>. . .<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;font-family:"Courier New"'> picked[3];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>typedef</span><span style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:blue'>unsigned</span> <span style='color:blue'>short</span>  InputPixelType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>. . .<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>InputImageType::Pointer image = reader-&gt;GetOutput();<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>InputImageType::IndexType pixelIndex;</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:green'>// Define interaction style<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>class</span><span style='font-size:10.0pt;font-family:"Courier New"'> MouseInteractorStylePP : <span style='color:blue'>public</span> vtkInteractorStyleTrackballCamera<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>  <span style='color:blue'>public</span>:<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>    <span style='color:blue'>static</span> MouseInteractorStylePP* New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>    vtkTypeMacro(MouseInteractorStylePP, vtkInteractorStyleTrackballCamera);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>    <span style='color:blue'>virtual</span> <span style='color:blue'>void</span> OnLeftButtonDown() <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>    {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>      . . .<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        point[0]=picked[0];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        point[1]=picked[1];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        point[2]=picked[2];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>              <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>      <span style='color:blue'>bool</span> isInside = image-&gt;TransformPhysicalPointToIndex( point, pixelIndex ); <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>      <span style='color:blue'>if</span> ( isInside )<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        InputImageType::PixelType pixelValue = image-&gt;GetPixel( pixelIndex );<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        pixelValue += 5;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        image-&gt;SetPixel( pixelIndex, pixelValue );<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>        }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:red'>      std::cout &lt;&lt; &quot;pixelIndex: &quot; &lt;&lt; pixelIndex[0] &lt;&lt; &quot; &quot; &lt;&lt; pixelIndex[1] &lt;&lt; &quot; &quot; &lt;&lt; pixelIndex[2] &lt;&lt; std::endl; </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>//works fine</span><span style='font-size:10.0pt;font-family:"Courier New";color:red'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>     <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>      vtkInteractorStyleTrackballCamera::OnLeftButtonDown();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'>    }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'> };<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>vtkStandardNewMacro(MouseInteractorStylePP);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;font-family:"Courier New"'> main(<span style='color:blue'>int</span>, <span style='color:blue'>char</span> *[])<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>. . .<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:red'>std::cout &lt;&lt; &quot;pixelIndex: &quot; &lt;&lt; pixelIndex[0] &lt;&lt; &quot; &quot; &lt;&lt; pixelIndex[1] &lt;&lt; &quot; &quot; &lt;&lt; pixelIndex[2] &lt;&lt; std::endl;</span><span style='font-size:10.0pt;font-family:"Courier New";color:green'> //Always zero</span><span style='font-size:10.0pt;font-family:"Courier New";color:red'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>. . .<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Merry Christmas and Happy new year!<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Xiaopeng<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 lang=ZH-CN style='font-size:10.0pt;font-family:宋体'>发件人</span></b><b><span style='font-size:10.0pt;font-family:宋体'>:</span></b><span style='font-size:10.0pt;font-family:宋体'> (Samuel) Byeongjun Park [mailto:byeongjun.park@case.edu] <br><b><span lang=ZH-CN>发送时间</span>:</b> 2010</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>년</span><span style='font-size:10.0pt;font-family:宋体'> 12</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>월</span><span style='font-size:10.0pt;font-family:宋体'> 18</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>일</span><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>토요일</span><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>오전</span><span style='font-size:10.0pt;font-family:宋体'> 12:50<br><b><span lang=ZH-CN>收件人</span>:</b> 'Xiaopeng Yang'<br><b><span lang=ZH-CN>抄送</span>:</b> insight-users@itk.org; 'vtk'<br><b><span lang=ZH-CN>主题</span>:</b> RE: [vtkusers] Programming challenges with QT, VTK, and ITK<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='color:#1F497D'>Xiaopeng,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If you use iktImageToVTKImageFilter, it means the image data is in itk::Image object, not in vtkImageData.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>So if you got world coordinate, then the first three elements of world coordinate array is the PhysicalPoint of itk::Image.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>You can get the index of itkImage using itk::Image::TransformPhysicalPointToIndex(..).<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>You shouldn’t read the image to both of itk::Image and vtkImageData.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Summarizing..<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Read the image to itk::Image.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Apply itkImageToVTKImageFilter<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Get a point from vtk<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Change it to world coordinate point<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Store the x,y,z coordinate into Itk::Image::PointType object<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Itk::Image::TransformPhysicalPointToIndex()<o:p></o:p></span></p><p class=MsoNormal style='margin-left:2.25pt'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='margin-left:2.25pt'><span style='color:#1F497D'>Now you get the index of the itk::Image where you picked in vtk window.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:2.25pt'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='margin-left:2.25pt'><span style='color:#1F497D'>Good luck and merry Christmas!<o:p></o:p></span></p><p class=MsoNormal style='margin-left:2.25pt'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Sam.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>-------------- Innovation for the Future Radiation Oncology&nbsp; (<a href="http://rophys.meds.case.edu/">http://rophys.meds.case.edu</a>)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>(Samuel) Byeongjun Park, Ph.D.&nbsp; -- Research associate of Sohn Lab.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Case Western Reserve Univerisity, School of Medicine<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Visiting: Wood building W517,&nbsp; Phone: 1-216-368-6583<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='margin-left:2.25pt'><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</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"'> Xiaopeng Yang [mailto:yxp233@postech.ac.kr] <br><b>Sent:</b> Friday, December 17, 2010 7:13 AM<br><b>To:</b> '(Samuel) Byeongjun Park'<br><b>Cc:</b> insight-users@itk.org; 'vtk'<br><b>Subject:</b> RE: [vtkusers] Programming challenges with QT, VTK, and ITK<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='color:#1F497D'>Hello Park,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>It has been a very long time since I received your help. These days I am still working on this problem. Now I can get the VTK coordinate (i.e., world coordinate). You mentioned that if I use itk ImageToVTKImageFilter, I can directly use the VTK coordinate as ITK coordinate. However, I could not understand clearly. In my program, I need ITK coordinate for applying ITK region growing algorithm. I do not know how to translate VTK coordinate to ITK coordinate. Could you please explain more in detail?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks very much!<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Xiaopeng<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</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 lang=ZH-CN style='font-size:10.0pt;font-family:MingLiU'>发件人</span></b><b><span style='font-size:10.0pt;font-family:宋体'>:</span></b><span style='font-size:10.0pt;font-family:宋体'> (Samuel) Byeongjun Park [mailto:byeongjun.park@case.edu] <br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:MingLiU'>发送时间</span></b><b><span style='font-size:10.0pt;font-family:宋体'>:</span></b><span style='font-size:10.0pt;font-family:宋体'> 2010</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>년</span><span style='font-size:10.0pt;font-family:宋体'> 10</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>월</span><span style='font-size:10.0pt;font-family:宋体'> 27</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>일</span><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>수요일</span><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>오후</span><span style='font-size:10.0pt;font-family:宋体'> 10:41<br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>收件人</span></b><b><span style='font-size:10.0pt;font-family:宋体'>:</span></b><span style='font-size:10.0pt;font-family:宋体'> 'Xiaopeng Yang'<br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>抄送</span></b><b><span style='font-size:10.0pt;font-family:宋体'>:</span></b><span style='font-size:10.0pt;font-family:宋体'> 'vtk'<br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>主</span></b><b><span lang=ZH-CN style='font-size:10.0pt;font-family:MingLiU'>题</span></b><b><span style='font-size:10.0pt;font-family:宋体'>:</span></b><span style='font-size:10.0pt;font-family:宋体'> RE: [vtkusers] Programming challenges with QT, VTK, and ITK<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>My name is Sam Park. Since you told you are using QT, I think you are using QVTKWidget.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>You can make your own QVTK widget class inheriting QVTKWidget.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>In there, override <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp; Virtual void mousePressEvent(QMouseEvent *pevent);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>You can read the mouse position in QVTKWidget window.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Then,<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:22.5pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Get the QT coordinate point (x,y)<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:22.5pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Flip y value by&nbsp; y=height-y;<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:22.5pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Get the pointer of the Render in your QVTKWidget object.<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:22.5pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>double wpoint[4];<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:22.5pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Render-&gt;SetDisplayPoint(x,y,0);<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:22.5pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Render-&gt;DisplayToWorld(); <o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:22.5pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>7.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='color:#1F497D'>Render-&gt;GetWorldPoint(wpoint);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Now You have the VTK coordinate of the point you clicked.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If you imported CT image in ITK and utilized itk::ImageToVTKImageFilter, <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>you can directly use the VTK coordinate as ITK coordinate.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Good luck.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Sam.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>-------------- Innovation for the Future Radiation Oncology&nbsp;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>(Samuel) Byeongjun Park, Ph.D.&nbsp; -- Research associate of Sohn Lab.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Case Western Reserve Univerisity, School of Medicine<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Visiting: Wood building W517,&nbsp; Phone: 1-216-368-6583<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</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"'> vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>Xiaopeng Yang<br><b>Sent:</b> Tuesday, October 26, 2010 9:06 PM<br><b>To:</b> 'Luis Ibanez'<br><b>Cc:</b> 'itk'; 'vtk'<br><b>Subject:</b> [vtkusers] Programming challenges with QT, VTK, and ITK<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Dear Luis,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>How are you doing? Thank you very much for your help so far. Sorry to ask you a question again.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I am now developing a liver segmentation program using QT, VTK, and ITK based on CT images. In my program, fast marching algorithm is used to extract the liver by multiple seed points. To pick the positions of the seed points, vtkImagePlaneWidget is applied. The problem is how to save the multiple seed points I selected by left-clicking of the mouse so that I do not need to type those positions into the code, which is time consuming.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Please provide me with your suggestions. I working on this for almost one week still I cannot figure it out.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Xiaopeng<o:p></o:p></p></div></body></html>