Dear Alvaro, <br><br>thanks for coming up with this bug fix. I've committed the change to the repository. <br><br>Best wishes, <br><br>Michel<br><br><div class="gmail_quote">2009/10/9 Alvaro Gómez <span dir="ltr"><<a href="mailto:agomez@fing.edu.uy" target="_blank">agomez@fing.edu.uy</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Michel:<br>
<br>
Thanks for your response. I modified the code in CrossHairSpatialObject<br>
::AttemptSetCursorPositionProcessing() as seen below and it seems to work fine. Let me know your opinion.<br>
<br>
---------------------------------------------<br>
void<br>
CrossHairSpatialObject<br>
::AttemptSetCursorPositionProcessing()<br>
{<br>
<br>
igstkLogMacro( DEBUG, "igstk::CrossHairSpatialObject\<br>
::AttemptSetCursorPositionProcessing called...\n");<br>
<br>
<br>
bool validPosition = true;<br>
<br>
const BoundingBoxType::BoundsArrayType &bounds = m_BoundingBox->GetBounds();<div><br>
<br>
<br>
if( m_CursorPositionToBeSet[0] < bounds[0] ||<br></div><div>
m_CursorPositionToBeSet[0] > bounds[1] ||<br>
m_CursorPositionToBeSet[1] < bounds[2] ||<br>
m_CursorPositionToBeSet[1] > bounds[3] ||<br>
m_CursorPositionToBeSet[2] < bounds[4] ||<br>
m_CursorPositionToBeSet[2] > bounds[5] )<br>
<br></div>
{<br>
validPosition = false;<br>
}<br>
<br>
<br>
if( validPosition )<br>
{<br>
igstkPushInputMacro( ValidCursorPosition );<br>
}<br>
else<br>
{<br>
igstkPushInputMacro( InValidCursorPosition );<br>
}<br>
<br>
m_StateMachine.ProcessInputs();<br>
}<br>
----------------------------------------------------<br>
<br>
<br>
Please check also this:<br>
Some time ago the Navigator example was reported not to work in debug mode and I didn't see a fix later in the list.<br>
<a href="http://public.kitware.com/pipermail/igstk-users/2009-February/000598.html" target="_blank">http://public.kitware.com/pipermail/igstk-users/2009-February/000598.html</a><br>
<br>
I think the problem is that the initial position of the crosshair is not defined and the initialization may differ between debug and release. I tried to set the crosshair to a known position and this seems to fix the problem. I put the code below before starting the views in<br>
void Navigator::ConnectImageRepresentation()<br>
-----------------------------------------------------<br>
ImageSpatialObjectType::IndexType index;<br>
index[0]=1;<br>
index[1]=1;<br>
index[2]=1;<br>
PointType point;<br>
<br>
m_ImageSpatialObject->TransformIndexToPhysicalPoint( index, point );<br>
const double *data = point.GetVnlVector().data_block();<br>
<br>
m_CrossHair->RequestSetCursorPosition(data);<br>
------------------------------------------------------<br>
<br>
Regards<br>
Alvaro<br>
<br>
<br>
El día jueves, 08 de octubre de 2009 09:05:36 p.m.<div><br>
Michel Audette <<a href="mailto:michel.audette@kitware.com" target="_blank">michel.audette@kitware.com</a>><br></div>
escribió:<div><div></div><div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Alvaro,<br>
<br>
sorry this is late. We are still looking into this. Should have an<br>
answer for you tomorrow.<br>
<br>
Cheers,<br>
<br>
Michel<br>
<br>
2009/10/7 Alvaro Gómez <<a href="mailto:agomez@fing.edu.uy" target="_blank">agomez@fing.edu.uy</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm working with Release 4.2<br>
<br>
In<br>
void CrossHairSpatialObject::AttemptSetCursorPositionProcessing()<br>
<br>
the cursor position is checked against the bounding box. Is this check<br>
correct?<br>
------------------------------------------------<br>
if( m_CursorPositionToBeSet[0] < bounds[0] ||<br>
m_CursorPositionToBeSet[1] > bounds[1] ||<br>
m_CursorPositionToBeSet[2] < bounds[2] ||<br>
m_CursorPositionToBeSet[3] > bounds[3] ||<br>
m_CursorPositionToBeSet[4] < bounds[4] ||<br>
m_CursorPositionToBeSet[5] > bounds[5] )<br>
{<br>
validPosition = true;<br>
}<br>
------------------------------------------------<br>
<br>
m_CursorPositionToBeSet[3], m_CursorPositionToBeSet[4] and<br>
m_CursorPositionToBeSet[5] are not valid values.<br>
<br>
The if clause seems to check an invalid position, not a valid position.<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users</a><br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Michel Audette, Ph.D. <br>R & D Engineer, <br>Kitware Inc.,<br>Chapel Hill, N.C. <br><br>