[IGSTK-Users] CrossHairSpatialObject
Michel Audette
michel.audette at kitware.com
Sun Oct 11 18:50:22 EDT 2009
Dear Alvaro,
thanks for coming up with this bug fix. I've committed the change to the
repository.
Best wishes,
Michel
2009/10/9 Alvaro Gómez <agomez at fing.edu.uy>
> Hi Michel:
>
> Thanks for your response. I modified the code in CrossHairSpatialObject
> ::AttemptSetCursorPositionProcessing() as seen below and it seems to work
> fine. Let me know your opinion.
>
> ---------------------------------------------
> void
> CrossHairSpatialObject
> ::AttemptSetCursorPositionProcessing()
> {
>
> igstkLogMacro( DEBUG, "igstk::CrossHairSpatialObject\
> ::AttemptSetCursorPositionProcessing called...\n");
>
>
> bool validPosition = true;
>
> const BoundingBoxType::BoundsArrayType &bounds =
> m_BoundingBox->GetBounds();
>
>
> if( m_CursorPositionToBeSet[0] < bounds[0] ||
> m_CursorPositionToBeSet[0] > bounds[1] ||
> m_CursorPositionToBeSet[1] < bounds[2] ||
> m_CursorPositionToBeSet[1] > bounds[3] ||
> m_CursorPositionToBeSet[2] < bounds[4] ||
> m_CursorPositionToBeSet[2] > bounds[5] )
>
> {
> validPosition = false;
> }
>
>
> if( validPosition )
> {
> igstkPushInputMacro( ValidCursorPosition );
> }
> else
> {
> igstkPushInputMacro( InValidCursorPosition );
> }
>
> m_StateMachine.ProcessInputs();
> }
> ----------------------------------------------------
>
>
> Please check also this:
> 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.
> http://public.kitware.com/pipermail/igstk-users/2009-February/000598.html
>
> 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
> void Navigator::ConnectImageRepresentation()
> -----------------------------------------------------
> ImageSpatialObjectType::IndexType index;
> index[0]=1;
> index[1]=1;
> index[2]=1;
> PointType point;
>
> m_ImageSpatialObject->TransformIndexToPhysicalPoint( index, point );
> const double *data = point.GetVnlVector().data_block();
>
> m_CrossHair->RequestSetCursorPosition(data);
> ------------------------------------------------------
>
> Regards
> Alvaro
>
>
> El día jueves, 08 de octubre de 2009 09:05:36 p.m.
> Michel Audette <michel.audette at kitware.com>
> escribió:
>
> Hi Alvaro,
>>
>> sorry this is late. We are still looking into this. Should have an
>> answer for you tomorrow.
>>
>> Cheers,
>>
>> Michel
>>
>> 2009/10/7 Alvaro Gómez <agomez at fing.edu.uy>:
>>
>>> I'm working with Release 4.2
>>>
>>> In
>>> void CrossHairSpatialObject::AttemptSetCursorPositionProcessing()
>>>
>>> the cursor position is checked against the bounding box. Is this check
>>> correct?
>>> ------------------------------------------------
>>> if( m_CursorPositionToBeSet[0] < bounds[0] ||
>>> m_CursorPositionToBeSet[1] > bounds[1] ||
>>> m_CursorPositionToBeSet[2] < bounds[2] ||
>>> m_CursorPositionToBeSet[3] > bounds[3] ||
>>> m_CursorPositionToBeSet[4] < bounds[4] ||
>>> m_CursorPositionToBeSet[5] > bounds[5] )
>>> {
>>> validPosition = true;
>>> }
>>> ------------------------------------------------
>>>
>>> m_CursorPositionToBeSet[3], m_CursorPositionToBeSet[4] and
>>> m_CursorPositionToBeSet[5] are not valid values.
>>>
>>> The if clause seems to check an invalid position, not a valid position.
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
>>>
>>>
>>
>>
>>
--
Michel Audette, Ph.D.
R & D Engineer,
Kitware Inc.,
Chapel Hill, N.C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20091011/dd4503c4/attachment-0001.html>
More information about the IGSTK-Users
mailing list