djelouze / Chiron

Medical Imaging plugin for ParaView
7 stars 3 forks source link

Changing the direction of binormal along the curve. #5

Closed nycholas closed 14 years ago

nycholas commented 14 years ago

:D,

I used part of its algorithm to make an overview of a volume[1]. But I found that the binormal alter the direction along the cut, with that solved by making the dot product of the binormal to the current point of my curve cut, if less than zero then I change the cross product of [tangent x normal] By binormal = [normal x tangent] = binormal, and the binormal not change the direction of the court[2].

[1] - http://code.google.com/p/moonstonemedical/source/browse/src/moonstone/ilsa/plugins/reslice/gui/qt/resliceaction.py

[2] - http://code.google.com/p/moonstonemedical/source/browse/src/moonstone/ilsa/plugins/reslice/gui/qt/resliceaction.py#1144

So long and good luck, Nycholas de Oliveira e Oliveira.

djelouze commented 14 years ago

I think you are dealing with vtkStraightenedCurvedPlanarReformation? I am afraid I did not understand your notification. The reslice plane needs two vectors, its normal Nr and another vector Tr, tangent to the plane. Nr simply defines the geometry of the reslice plane in the space and Tr define a chart. The chart is completed by a third vector Br = Nr^Tr. The purpose of this filter is to reslice along a spline. Thus spline has a Frenet-Serret frame at each point computed from Ts, the tangent to the spline curve and Ns, the normal to the spline. The binormal is Bs = Ns^Ts. The first think I did was to basically set Tr = Ns and Nr = Ts. The problem is that at each inflexion point of the spline (ie the sign of the curvature changes), Ns is inverted. The effect on the reslicing algorithm is that successive slices could look upside down. That why I implemented the 'ConsistentNormal' computation: I take care of the previous normal along the curve in order to minimize the angle with the current one, thus preventing bad reslicing. I saw in your code the constant CONSISTENT_NORMALS, but is always 0 thus I feel that you don't use this feature. Furthermore, the workaround you expose involve a dot product with a point. IMHO, it makes the algorithm variant to the translation (eg if the volume origin is set to the central voxel, the resliced output will change).

Sorry for this loooooong exposition, but can you be more precise about the issue/notification/somethingelse ? If you are interested in a python wrap of Chiron's specific algorithms, just tell me and I will try to enable it in the CMakeLists. Many thanks for your interest.

nycholas commented 14 years ago

Oops! I cheated on site for clarification of doubts. I was unhappy in my composition of explanation, excuse.

Yes, I'm using vtkStraightenedCurvedPlanarReformation, did not use CONSISTENT_NORMALS because damage was not expected volume, removing it and adding additional factor towards the binormal curve made a blunt change of direction.

But you explaining CONSISTENT_NORMALS made me realize that I have erred in their understanding and use, I will redo the entire code of transcribing vtkStraightenedCurvedPlanarReformation for Python.

Thank you.

So long and good luck, Nycholas de Oliveira and Oliveira.

djelouze commented 14 years ago

-- Set to close issue --