[IGSTK-Users] Displaying spatial objects in 2D views

Sophie Blestel sophie.blestel at gmail.com
Tue Mar 27 10:06:55 EDT 2007


Hi,

So it isn't possible to represent a spatial objet on 2D views exept if it is
in the corner ?

2007/3/26, Patrick Cheng <cheng at isis.georgetown.edu>:
>
> Hi Sophie,
>
> Because the initial camera focus point is set to (0,0,0)
> If your object is at location:
>
> transform.SetTranslation (100, 0.1, 1000);
>
> The object will appear at one of the four corners depending on the view
> orientation(Axial, Coronal, and Sagittal). Because the camera will try
> to accommodate everything in the window.
>
> I will try your code to see if there is any issue of the cone object.
>
> Patrick
>
> ---------- Original Message ----------------------------------
> From: "Sophie Blestel" <sophie.blestel at gmail.com>
> Date:  Mon, 26 Mar 2007 11:22:53 +0200
>
> >Hi,
> >
> >I try to display a cone in 3D and 2D views, with a location and
> orientation
> >given. But on the 2D views the cone remains in the origin (on the
> right high
> >corner ) (on the 3D views it is well represented).
> >
> >This is my code :
> >
> >First I declare and initialise the cone :
> >    ConeType::Pointer m_Cone = ConeType::New();
> >    ConeRepresentationType::Pointer m_ConeRepresentation     =
> >ConeRepresentationType::New();
> >
> >    transform.SetTranslation (100, 0.1, 1000);
> >
> >    m_Cone->RequestSetTransform( transform );
> >    m_ConeRepresentation->RequestSetConeObject( m_Cone );
> >
> >
> >I create my 4 views (Axial, Sagittal, Coronal and 3D) in a file .FL as
> >follows :
> >    Fl_Box DisplaySagittal {
> >          label {Display Sagittal}
> >          xywh {550 0 380 330} box FLAT_BOX color 0 labelcolor 7
> >          class {igstk::View2D}     }
> >
> >Then I set the orientation ok the 2D views :
> >    DisplayAxial->RequestSetOrientation( View2D::Axial );
> >    DisplaySagittal->RequestSetOrientation( View2D::Sagittal );
> >    DisplayCoronal->RequestSetOrientation( View2D::Coronal );
> >
> >And I add the cone representation to the 2D and 3D views :
> >    DisplayAxial->RequestAddObject( m_ConeRepresentation );   // if I do
> >m_ConeRepresentation->Copy() the cone disappears
> >    DisplaySagittal->RequestAddObject( m_ConeRepresentation );
> >    DisplayCoronal->RequestAddObject( m_ConeRepresentation );
> >    Display3D->RequestAddObject( m_ConeRepresentation );
> >
> >For each view, I do :
> >    DisplaySagittal->RequestResetCamera();
> >    DisplaySagittal->Update();
> >    DisplaySagittal->RequestEnableInteractions();
> >    DisplaySagittal->RequestSetRefreshRate( 20 );
> >    DisplaySagittal->RequestStart();
> >
> >And this is my loop :
> >    while(m_tms->mainWindow->visible())
> >    {
> >        Fl::wait(0.05);
> >        igstk::PulseGenerator::CheckTimeouts();
> >        Fl::check();
> >    }
> >
> >
> >Thanks for helping me,
> >
> >Sophie
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20070327/7d5c11f2/attachment-0001.html>


More information about the IGSTK-Users mailing list