Hi Jim,<br><br>I get the solution, the problem is that i am dont select position correctly with mouse. I stop use integer and use now float for get position the mouse cilck and i now i get the correct values.<br><br>One observation, the positions the ITKsnap and vtk are be differents. The Y axi is inverted.<br>

<br>Thank you for everything.<br><br><div class="gmail_quote">2010/9/13 Jim Peterson <span dir="ltr">&lt;<a href="mailto:jimcp@cox.net">jimcp@cox.net</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Italo,<br>
I am not sure what I am supposed to &quot;look very close&quot; at, nor what actual problem we are addressing. What you have raised is a technical need to access the scalar data for an image in vtk, could easily be a classroom assignment, and not a problem I have any great interest in.<br>


Have you implemented a point picker in vtk to interact with the 3d model in vtk to access the scalar values for selected points? I believe you will find each structured grid &quot;point&quot; to be a 3d space location derived from the row and column location in a dicom image file, the combination of row, column and file number times the sample spacing results in a location is space for the point. the radio intensity value results in a scalar. at a sufficient scaling a point scalar is a voxel scalar is a pixel scalar, depending on whether we are talking the structured grid in 3d space, a surface element in the space or a row and column in a single dicom image file.<br>


<br>
The image of the dicom data loaded is generated in itk and vtk by similar &quot;surface generating&quot; algorithms that construct polygon defined surfaces connecting points with similar scalar values. So if ITKSnap and vtk both generate similar images, they are both finding similar scalar data.   <br>


I am afraid I am at the end if my interest in this problem,<br>
Jim<br>
<br>
Italo Ribeiro wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Hi Jim and Bill,<br>
<br>
Look very closed, in ITKsnap the slice 1 is slice 107 in my code, but when i get the value, i am getting the same slice.<br>
<br>
I are begining think that i must get values intensity of voxel and not point. Look for cell data in vtk, i dont find one function that &quot;GetScalarCell()&quot;, so how i get cell data in vtk? I must use &quot;GetCell(100)-&gt;Derivatives()&quot;? Cell = Voxel?<br>


<br>
thanks<br>
<br></div>
2010/9/12 Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a> &lt;mailto:<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;&gt;<div class="im">

<br>
<br>
    vtk images are flipped in the y -direction. This is because vtk takes<br>
    a &quot;computer graphics&quot; view of images while itk takes a &quot;medical&quot; view.<br>
<br>
    In itk, the first pixel in memory is the first pixel on disk. In vtk,<br>
    the first pixel in memory is the first pixel of the last y &quot;line&quot;.<br>
<br>
    On Sun, Sep 12, 2010 at 11:37 AM, Jim Peterson &lt;<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a><br></div><div><div></div><div class="h5">
    &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a>&gt;&gt; wrote:<br>
    &gt; ok, I believe we have a registration problem between the vtk model<br>
    &gt; coordinates and the ITKSnap model coordinates. if I understand<br>
    the data you<br>
    &gt; have given, we have some point data like:<br>
    &gt;<br>
    &gt; tested point<br>
    &gt;        ITKSnap value<br>
    &gt;        ITK Snap Material<br>
    &gt;        VTK Value<br>
    &gt;        Vtk Material<br>
    &gt; pt1<br>
    &gt;        2318<br>
    &gt;        dense bone<br>
    &gt;        -1024<br>
    &gt;        air (-1000 is air at STP calibration)<br>
    &gt; pt2<br>
    &gt;        2210<br>
    &gt;        dense bone<br>
    &gt;        1023<br>
    &gt;        soft bone<br>
    &gt; pt3<br>
    &gt;        2410<br>
    &gt;        dense bone<br>
    &gt;        41<br>
    &gt;        watery liquid (0 is water at STP calibration)<br>
    &gt; pt4<br>
    &gt;        2130<br>
    &gt;        dense bone<br>
    &gt;        993<br>
    &gt;        soft bone<br>
    &gt;<br>
    &gt;<br>
    &gt; We agree all of these values are reasonable for some location in<br>
    a dental<br>
    &gt; scan. I believe the problem is, in spite of expectations and<br>
    intentions, the<br>
    &gt; location tested are not from the same input data, maybe the<br>
    coordinate<br>
    &gt; schemes in vtk and itk do not match. Can you find corresponding<br>
    values in<br>
    &gt; the ITKSnap? perhaps by transposing a coordinate location? can<br>
    we find<br>
    &gt; locations to &quot;sample&quot; in the vtk model that produce the dense<br>
    bone values?<br>
    &gt;<br>
    &gt; does that make sense?<br>
    &gt; Hope that helps,<br>
    &gt; Jim<br>
    &gt;<br>
    &gt; Italo Ribeiro wrote:<br>
    &gt;&gt;<br>
    &gt;&gt; Hi Jim,<br>
    &gt;&gt;<br>
    &gt;&gt; The value not is same the entire tooth, the diferents values<br>
    are the same<br>
    &gt;&gt; point. In point (226, 100, 1) the values are:<br>
    &gt;&gt;<br>
    &gt;&gt; ITKsnap : 2130<br>
    &gt;&gt; Mycode: 993<br>
    &gt;&gt;<br>
    &gt;&gt; 2010/9/12 Jim Peterson &lt;<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a> &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a>&gt;<br></div></div><div><div></div><div class="h5">


    &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a> &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a>&gt;&gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;    Hi Italo,<br>
    &gt;&gt;<br>
    &gt;&gt;    I am not an ITKSnap user myself, you are suggesting ITKSnap<br>
    &gt;&gt;    reports the same value for the entire tooth? I think you would<br>
    &gt;&gt;    have to iterate over the points in the tooth to find the maximum<br>
    &gt;&gt;    value in vtk to duplicate that if it is true. Can you<br>
    display the<br>
    &gt;&gt;    point coordinates that have that value in ITKSnap? Then see<br>
    if vtk<br>
    &gt;&gt;    has the same value at that point? I have trouble believing<br>
    vtk has<br>
    &gt;&gt;    incorrect pixel data by point for imaging content.<br>
    &gt;&gt;<br>
    &gt;&gt;    Jim<br>
    &gt;&gt;<br>
    &gt;&gt;    Italo Ribeiro wrote:<br>
    &gt;&gt;<br>
    &gt;&gt;        Hi Jim,<br>
    &gt;&gt;<br>
    &gt;&gt;        I have dicom image with teeth, i am looking intensity values<br>
    &gt;&gt;        of 2 front teeth.<br>
    &gt;&gt;<br>
    &gt;&gt;        But some happen very strange, the tooth the left have<br>
    greater<br>
    &gt;&gt;        intensity in ITKsnap 2518 and my code -1024. The tooth the<br>
    &gt;&gt;        right side have in ITKsnap 2402 and in my code 41. I do not<br>
    &gt;&gt;        know why the values are different.<br>
    &gt;&gt;<br>
    &gt;&gt;        In my code i get 255 points of heigh and width, but when<br>
    i get<br>
    &gt;&gt;        dimension the image, vtk show 512 x 512, same dimesion<br>
    show in<br>
    &gt;&gt;        ITKsnap. ITKsnap get dimension of voxels, so i must get<br>
    &gt;&gt;        information the intensity value voxel of volume and no pixel<br>
    &gt;&gt;        the image?<br>
    &gt;&gt;<br>
    &gt;&gt;        thanks.<br>
    &gt;&gt;<br>
    &gt;&gt;        2010/9/11 Jim Peterson &lt;<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a><br>
    &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a>&gt; &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a> &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a>&gt;&gt;<br>


    &gt;&gt;        &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a> &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a>&gt;<br>
    &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a> &lt;mailto:<a href="mailto:jimcp@cox.net" target="_blank">jimcp@cox.net</a>&gt;&gt;&gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;           Personally, I am sorry, but there is not enough<br>
    information in<br>
    &gt;&gt;           your description of the problem to be sure you have a<br>
    &gt;&gt;        legitimate<br>
    &gt;&gt;           complaint. does your dicom data consist of only one<br>
    point?<br>
    &gt;&gt;        how are<br>
    &gt;&gt;           you certain you have selected the exact same location?<br>
    &gt;&gt;<br>
    &gt;&gt;           in my mainframe programming life we have a saying:<br>
    &gt;&gt;<br>
    &gt;&gt;           &quot;when expected results do not match observed results,<br>
    check the<br>
    &gt;&gt;           library concatenation&quot;<br>
    &gt;&gt;<br>
    &gt;&gt;           .... in my opinion, chances are you are looking at<br>
    &gt;&gt;        different points.<br>
    &gt;&gt;<br>
    &gt;&gt;           sorry, Hoping to be helpful not critical.<br>
    &gt;&gt;           Jim<br>
    &gt;&gt;<br>
    &gt;&gt;           Italo Ribeiro wrote:<br>
    &gt;&gt;<br>
    &gt;&gt;               No more ideas?<br>
    &gt;&gt;<br>
    &gt;&gt;               2010/9/10 Italo Ribeiro &lt;<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;<br>
    &gt;&gt;        &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;&gt;<br>
    &gt;&gt;               &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;<br>
    &gt;&gt;        &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;&gt;&gt;<br>
    &gt;&gt;               &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;<br>
    &gt;&gt;        &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;&gt;<br>
    &gt;&gt;               &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;<br>
    &gt;&gt;        &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a><br>
    &lt;mailto:<a href="mailto:italo.ribeiro@gmail.com" target="_blank">italo.ribeiro@gmail.com</a>&gt;&gt;&gt;&gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;                  I am expecting MIP of image point. In my<br>
    program the<br>
    &gt;&gt;        value<br>
    &gt;&gt;               for one<br>
    &gt;&gt;                  point is 1023 and ITKsnap show 2210.<br>
    &gt;&gt;<br>
    &gt;&gt;                  Why the value is different?<br>
    &gt;&gt;<br>
    &gt;&gt;                  2010/9/10 John Drescher &lt;<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a><br>
    &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;<br>
    &gt;&gt;        &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a> &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;&gt;<br>
    &gt;&gt;               &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a><br>
    &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt; &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a><br>
    &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;&gt;&gt;<br>
    &gt;&gt;                  &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a><br>
    &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;<br>
    &gt;&gt;        &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a><br>
    &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;&gt; &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a><br>
    &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;<br>
    &gt;&gt;        &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a><br>
    &lt;mailto:<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;&gt;&gt;&gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;                      &gt; Using GetScalarType the type returned is<br>
    &gt;&gt;        short, i was<br>
    &gt;&gt;               using<br>
    &gt;&gt;                      int. But the<br>
    &gt;&gt;                      &gt; value maximum showed is 1024 and i see the<br>
    &gt;&gt;        maximum short<br>
    &gt;&gt;                      value is 32767 and<br>
    &gt;&gt;                      &gt; the intensity value is not corret.<br>
    &gt;&gt;                      &gt;<br>
    &gt;&gt;<br>
    &gt;&gt;                      Depending on how you read the dicom file<br>
    the value<br>
    &gt;&gt;               should be in<br>
    &gt;&gt;                      hounsfield units. I am confused on whether you<br>
    &gt;&gt;        mean you<br>
    &gt;&gt;               were<br>
    &gt;&gt;                      expecting<br>
    &gt;&gt;                      32767 or hounsfield.<br>
    &gt;&gt;<br>
    &gt;&gt;                      John<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;                  --     Ítalo Mendes<br>
    &gt;&gt;                  <a href="http://ogre.irados.org" target="_blank">ogre.irados.org</a> &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &gt;&gt;        &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &gt;&gt;               &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;               --         Ítalo Mendes<br>
    &gt;&gt;<br>
    &gt;&gt;               <a href="http://ogre.irados.org" target="_blank">ogre.irados.org</a> &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &gt;&gt;        &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt; &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
     ------------------------------------------------------------------------<br>
    &gt;&gt;<br>
    &gt;&gt;               _______________________________________________<br>
    &gt;&gt;               Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
    &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt; &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
    &gt;&gt;        &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;               Visit other Kitware open-source projects at<br>
    &gt;&gt;               <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
    &gt;&gt;<br>
    &gt;&gt;               Please keep messages on-topic and check the VTK<br>
    FAQ at:<br>
    &gt;&gt;               <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
    &gt;&gt;<br>
    &gt;&gt;               Follow this link to subscribe/unsubscribe:<br>
    &gt;&gt;               <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;        --         Ítalo Mendes<br>
    &gt;&gt;        <a href="http://ogre.irados.org" target="_blank">ogre.irados.org</a> &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt; &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; --<br>
    &gt;&gt; Ítalo Mendes<br>
    &gt;&gt; <a href="http://ogre.irados.org" target="_blank">ogre.irados.org</a> &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt; &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>


    &gt;<br>
    &gt; _______________________________________________<br>
    &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<br>
    &gt;<br>
    &gt; Visit other Kitware open-source projects at<br>
    &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
    &gt;<br>
    &gt; Please keep messages on-topic and check the VTK FAQ at:<br>
    &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
    &gt;<br>
    &gt; Follow this link to subscribe/unsubscribe:<br>
    &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
    &gt;<br>
<br>
<br>
<br>
<br>
-- <br>
Ítalo Mendes<br>
<a href="http://ogre.irados.org" target="_blank">ogre.irados.org</a> &lt;<a href="http://ogre.irados.org" target="_blank">http://ogre.irados.org</a>&gt;<br>
</div></div></blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Ítalo Mendes<br><a href="http://ogre.irados.org">ogre.irados.org</a><br>