[IGSTK-Users] Viewer Problem due to TransformPhysicalPointToIndex
Patrick Cheng
cheng at isis.georgetown.edu
Sat Jun 17 18:07:27 EDT 2006
Hi Fucang,
I guess the problem is you keep clicking on the same point: The first
time you click on a point, vtk's z buffer store the value, where the
ray intersects with the image plane. but NOTICE here, we put an sphere
on that clicking point, if you do not moving the mouse, the second
time you click again, it actually will return the point on the sphere
you have clicked. that's why the slice is still jumping. if you move
you mouse a little bit, and click on the same image plane, it
shouldn't have an jumping, i have tested here without any problem.
By default, all the spatial object in the view is pickable in IGSTK.
Patrick
Fucang Jia wrote:
>
> Hi Patrick,
>
> I found that another vtk dlls exists in the default path, which
> cause the fltk app can not execute, when
> I copy the compiled vtk dlls into the path of fltk app, which works well.
>
> But on the slice index jumping problem, it seems that it exists. If you
> launch the app
> FourViewTrackingWithCT compiled in debug mode( I have not tried in
> release mode),
> and load dataset IGSTK/Testing/Data/Input/E000192
> then let left mouse click on the sagittal view plane, you will see that.
> I first change the sagittal
> index to 511, then click once, the index is 511, then I click it again,
> the index changes to 510.
> When I continue click left mouse on it, it will change to 509, 508, ...
> When it change to 464, it
> will never change. When I change the sagittal slice to another slice,
> then click, the slice changes
> again.
>
> I found this is not due to TransformPhysicalPointToIndex function, but
> in igstkView.cxx
> m_PointPicker->GetPickPosition( data );
> which compute z buffer depth from vtkOpenGLRenderWindow.cxx
> int vtkOpenGLRenderWindow::GetZbufferData( int x1, int y1, int x2, int y2,
> float* z_data )
> glReadPixels( x_low, y_low,
> width, height,
> GL_DEPTH_COMPONENT, GL_FLOAT,
> z_data );
>
> I add a line
> std::cout<<"z_data is "<<*z_data<<std::endl;
>
> when I click the mouse at one position, the z_data changes. I think this
> may be the cause. But
> I can not figure out why now.
>
> Thanks!
>
> Fucang
>
>
> ------------------------------------------------------------------------
> On 2006-06-15 22:55:33 Patrick Cheng
> Subject: Re: [IGSTK-Users] Viewer Problem due to
> TransformPhysicalPointToIndex
>
> Hi Fucang,
>
> 1. You should update both IGSTK and IGSTKSandbox (bug fix is
> in the
> IGSTK, I have also changed the example app in IGSTKSandbox to
> use the
> ContinuousIndex)
>
> 2. You might need to cmake the IGSTKSandbox again, this will
> take the
> latest code from IGSTK to IGSTKSandbox build directory, and
> then compile
> the IGSTKSandbox. (You have to run the cmake on IGSTKSandbox
> again,
> after you update the IGSTK)
>
> I have tested this on the same platform here, it works out
> fine here. If
> you still have problem with this. Can you be more specific on
> the error
> and difficulty you have encountered?
>
> Patrick
>
> Fucang Jia wrote:
> > Hi Patrick,
> >
> > Thank you for your rapid reply.
> >
> > But after I synchronized with CVS version, I found that
> all fltk app can
> > not run ( this app
> > is compiled in debug mode, VC.Net2003 fltk-1-1.7 or
> fltk-1.1.12-16-05).
> >
> > Then I switched to VC6 and compiled it. But I found that
> jumping problem
> > still exists.
> > and m_CTImageObserver- >GetCTImage()- >IsInside( p ) will
> incorrectly
> > report to 0 when
> > sagittal slice is 0, so it will report "Picked point
> outside image".
> >
> > Thanks !
> >
> > Fucang
> >
> >
> > ------------------------------------------------------------------------
> > On 2006-06-15 01:10:05 Patrick Cheng
> > Subject: Re: [IGSTK-Users] Viewer Problem due to
> > TransformPhysicalPointToIndex
> >
> > Hi Fucang,
> >
> > A new TransformPhysicalPointToContinuousIndex(p,index)
> function and a
> > ContinuousIndexType is being added to the
> ImageSpatialObject's API.
> >
> > Now if you take the pick position and use
> the continuous
> > index to
> > reslice the image, it will be much smoother
> and won't jump.
> >
> > Please update your IGSTK main and Sandbox
> repository code.
> >
> > Thank you,
> >
> > Patrick
> >
> > Fucang Jia wrote:
> > > Hi, Patrick,
> > >
> > > There is a problem due to
> TransformPhysicalPointToIndex
> > function, which
> > > belongs to Bug# 738,
> > > but it seems that this critial bug has
> not been fixed.
> > >
> > > When I load
> IGSTK\Sandbox-Release-8\Testing\Data\E000192,
> > > press the left mouse button on the
> sagittal view in
> > > FourViewsTrackingWithCT app continuously,
> > > then the index changes little bye one,
> when the index of
> > sagittal viewer
> > > was changed to 0, I press the
> > > mouse button onto the sagittal image, it
> says "Picked point
> > outside
> > > image". I tracked this bug,
> > > and found that it is due to index
> round up problem.
> > >
> > > For example, the origin is -153.6640625,
> > > the spacing is 0.671875
> > > the physical coordinate is 16.3203
> > > so the according index is
> > > (16.3203+153.6640625)/0.671875 = 252.9999813953,
> > > it was truncated to 252.
> > >
> > > Then resliceImage function will change the
> orthogonal image
> > slice.
> > >
> > > I also found this behaviour will occur
> when certain DICOM
> > dataset is
> > > loaded. When I load other DICOM dataset,
> > > the axial and coronal slice will have
> problem, but sagittal
> > view does
> > > not change when mouse pressed. It is
> because
> > > that certain origin and spacing parameters
> trigger this problem.
> > >
> > > Thanks!
> > >
> > > Fucang
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > IGSTK-Users mailing list
> > > IGSTK-Users at public.kitware.com
> > > http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
> >
>
--
Patrick Cheng Work phone: 202-687-2902
Software Engineer Work fax: 202-784-3479
Email: cheng at isis.georgetown.edu
Imaging Science and Information Systems (ISIS) Center
Department of Radiology, Georgetown University Medical Center
2115 Wisconsin Avenue, Suite 603, Washington, DC, 20007
More information about the IGSTK-Users
mailing list