A kind of interactive brain fiber selects and method for visualizing
Technical field
Present document relates to the research of cranial nerve fiber, be that a kind of interactive brain fiber selects and method for visualizing.
Background technology
The development of nmr imaging technique, diffusion-weighted imaging (DWI), diffusion tensor technology (DTI), height
The non-invasive imaging techniques such as angular resolution diffusion imaging technology (HARDI) come out one after another .DWI be a kind of measure spin proton microcosmic with
The technology that seat in the plane is moved, by measuring biological tissue's obstruction situation to hydrone Brownian movement, explores biological properties
.DTI it is on the basis of DWI, introduce tensor, thus has had directional information, become a kind of conventional detection cerebral white matter fine
The technology of dimension structure, but DTI model is assumed to be limited by Gaussian, can only provide a machine direction in each voxel
Information, it is impossible to disclose fiber intersect situation .HARDI technology be to be developed by DTI technology, it use sphere sampling, with
Time assume that hydrone is Gauss disperse in tissue, can be used to describe the intersection of fiber, the state such as merging, by correlational study person
Pay close attention to.
DTI Yu HARDI data can represent one group of fibre bundle, and this process is referred to as fiber tracking. fiber tracking can be
Three dimensions shows distribution and the annexation of brain fibers. the displaying to fiber is intensive line drawing process, three-dimensional
Visually there is complicated chaotic problem in brain fiber, fiber information obtains balance with blocking difficulty.Brain fiber is seen by people
When examining, block owing to its surface exists more fiber, often cannot observe directly the overall structure of brain fiber, therefore, it is difficult to
Full brain fiber is explored and is analyzed.
In sum, in order to reduce brain fiber VC situation in three dimensions, need brain fiber is entered
Row screening further and visualization.Reasonably screening mode can be removed and brain fibre structure causes the part blocked, and retains brain
Fiber overall structure.Good effect of visualization can preferably show the spatial relationship of brain fiber, helps people preferably to manage
Solve the organizational structure of brain fiber, thus preferably brain fiber is explored.
Summary of the invention
In order to improve the space structure perceived effect to brain fiber, the invention provides a kind of interactively brain fiber and select
With method for visualizing.
The interactive brain fiber of present invention design selects and method for visualizing, comprises the following steps:
1), import initial data, data are modeled, follow the tracks of out the path of fiber;
2), due to the self attributes of fiber data, all fibres path is the most non-isometric, for the spy that fiber is different in size
Property, fiber selection mode is divided into two classes by us, and a class is fiber system of selection based on scatter matrix, and the method pays close attention to list
The overall direction attribute of root fiber, does not consider the length of fiber;Another kind of, it is fiber selecting party based on local direction vector
Method, the method is paid close attention to the local direction attribute of fiber, is taken into account fibre length simultaneously.
2.1) fiber based on scatter matrix selects:
According to the direction vector of adjacent node on fiber path, calculate the scatter matrix of every fiber path.Spread square
Battle array eigenvalue can describe the directional information of this fiber, then constructs machine direction parameter according to the eigenvalue of scatter matrix, from
And the fiber of different directions is selected.
2.2) fiber based on local direction vector selects:
Calculate the direction vector of adjacent node on fiber path, direction vector carried out unitization, by the direction to
Machine direction is judged by three space coordinatess of amount, brain machine direction is divided three classes;Direction initialization length threshold, passes through
The mode of regulation threshold value, selects the fiber in some direction.
3), fiber is color coded, makes the color of fiber change according to the change in its direction, show fiber
Direction tendency, so that nerve fiber is easier to perception at three dimensions.
4), extract and can describe the integrally-built fiber of cranial nerve fiber, then the fiber of different directions is recombinated,
Repaint the fiber in full brain field, with opacity, fiber is rendered by regulation color, simultaneously by rotation, scaling
The operation such as little carries out virtual interactive interface to fiber, preferably represents the spatial relationship of brain fiber.
As preferably a kind of scheme: described step 2.1) include following steps:
Step 1 calculates the local direction vector n between brain fiber adjacent nodei, its formula is:
ni=(xi-xi+1,yi-yi+1,zi-zi+1) (1)
Wherein, (xi,yi,zi) and (xi+1,yi+1,zi+1) represent the xyz space coordinates of i-th and i+1 node respectively.
Meanwhile, if a total of N number of node on a fiber, then need to calculate the direction vector between an all above node of fiber
(n0,n1,n2,......nN-2,nN-1), and thus constitute the matrix of a direction vector.
Step 2 calculates the scatter matrix of every fiber.Its formula is as follows:
Wherein, niRepresent the direction vector of i-th point,Representing the transposition of the direction vector of i-th point, N represents current
The nodes of fiber.
After Step 3 obtains scatter matrix, calculate three eigenvalue β of scatter matrix1,β2,β3, each brain fiber spreads
Three eigenvalues of matrix can describe the xyz directional information of this fiber;Owing to the eigenvalue of scatter matrix may be plural number, institute
With, β herein1,β2,β3Represent the real part of three eigenvalues respectively.
Step 4 repeats step 1), step 2) and step 3), until calculating the characteristic of correspondence value of all fibres.
Step 5 is calculated the discriminant parameter C corresponding to scatter matrixl, its computing formula is as follows:
Wherein, ClSpan be (-1,1), for describing the general direction information of current fibre.
Step 6 is by ClValue falls within threshold interval (Clstart,Clend) fiber take out, wherein, (Clstart,Clend) belong to (-
1,1), ClstartRepresent taken ClInterval minima, ClendRepresent taken ClInterval maximum.The choosing of different directions fiber
Select, can be by the interval (C of regulationlstart,Clend) realize.
As a kind of preferred version: described step 2.2) comprise the following steps:
Step 1 is with step 2.1) step 1.
The local direction vector n that formula (1) is obtained by Step 2iBeing standardized, its formula is:
Wherein,Computing formula be:
Step 3 gives three variable (Uis,Uap,Ulr) store x respectively, the fiber information in tri-directions of y, z, wherein, Uis
For x-axis direction fiber is counted, UapFor y-axis direction fiber is counted, UlrFor z-axis direction fiber is entered
Row counting.Additionally, given two parameters w1, w2(w2Much larger than w1) for rightTravel direction judge, its judge formula as:
Step 4 travels through all of fiber, uses formula (7), sentences every fiber all local direction vector travel direction
Fixed.Finally with (Uis,Uap,Ulr) the direction that referred to of maximum, as the Main way of current fibre.After traversal terminates, entirely
Brain fiber will be divided into three classes with three directions.
Step 5 sets threshold value deg, and deg belongs to (0, maxN), wherein, maxNRepresent maximum fiber nodes number.By to threshold
Value deg is adjusted, and screens the fiber in some direction.
The reference direction DUAL PROBLEMS OF VECTOR MAPPING that formula (6) is obtained by Step 6 is to RGB color model, and its formula is:
Wherein, Rmax=Gmax=Bmax=255.
Beneficial effects of the present invention: propose two kinds of different fiber systems of selection.Start with on the whole, by scatter matrix
It is dissolved in fiber selection, as a kind of foundation.Start with from local, according to the direction vector of each node of every fiber, right
Fiber selects.Two kinds of methods can select the most voluntarily, and unified target is to improve user's sense to fiber
Know.
Accompanying drawing explanation
Fig. 1 is the drafting design sketch of the full brain fiber of the present invention
Fig. 2 is that the scatter matrix value of calculation that utilizes of the present invention carries out the system diagram classified
Fig. 3 is that the scatter matrix that utilizes of the present invention carries out the design sketch screened
Fig. 4 is the flow chart of the present invention
Fig. 5 is that the partial vector that utilizes of the present invention carries out the design sketch screened
Detailed description of the invention:
The system interface of the present invention is to carry out front end by Qt to write, and data are processed and carried out by C++, and drafting is passed through
OpenGL completes.
The present invention is further described below in conjunction with the accompanying drawings.
With reference to Fig. 1~Fig. 5, a kind of interactive brain fiber selects and method for visualizing, specifically includes following steps:
Fig. 1 is to carry out a kind of drafting for full brain data by OpenGL.Can draw any given on the basis of thus
Brain fiber represented by data.However, it is possible to the fiber significantly seen in space is when quantity reaches certain quantity, can not
The meeting avoided produces and stops, the perception to it of user can drastically decline.Developer once used illumination, and color encodes, anti-
The operation such as sawtooth all fails to get a desired effect.It is therefore proposed that interact the method for visualizing of selection and obtained relatively
Good effect, improves the spatial perception of fiber.
Fig. 2 is make based on above-mentioned method one, and classify fiber based on space scatter matrix one is visual
The sectional drawing of change system.Fiber is carried out pretreatment, calculates every fiber scatter matrix in space, according to formula, permissible
Obtaining corresponding to every fiber and represent the value of scatter matrix, this value is among interval [-1.0,1.0], as classification
Foundation.First fiber data can be directed respectively into in upper left and 2, lower-left view, 2 accessory fibers can be obtained and draw
Result.Although the data of these 2 views are simultaneously directed, but it is separate.User can be simultaneously to the two
View interacts and is independent of each other.But also can select freely according to fiber scatter matrix obtained by calculating, from
And obtain the result of different choice simultaneously.By merging button, the result that two select can be merged, obtain effect more
Good merging figure.Finally utilize opacity and through the scheme of colour selected, i.e. can get final merging figure.Merge figure sky
Between perception substantially get a promotion, not only reduce stop and by contrast, allow structure all the more clear of brain fiber.
Fig. 3 is i.e. the concrete stage diagram that brain fiber carries out according to different scatter matrixes classifying.First, we utilize biography
The scheme of colour of system, i.e. RGB color matching represents direction and matches colors.By figure it is recognised that we are fixed viewpoint when, utilize
The value interval of different scatter matrixes can obtain sorted data.Such as, cl value the closer to 1 when, fiber obtains whole
Before and after body trend is closer in space, distribution proportion shared by (based on screen orientation) namely redness gets more and more.Other
Situation is the most in like manner.
Fig. 4 realizes process by what the form of flow chart illustrated fiber system of selection based on scatter matrix.First obtain
After obtaining data, every fiber is made up of several nodes, so needing the direction calculating between each node of every fiber
Vector and form a direction vector matrix.After this, calculate based on obtained direction vector matrix and scatter matrix
Formula can obtain scatter matrix.Owing to direction vector has 3 values, so the scatter matrix obtained is the matrix of 3*3, the most just
It is to have said 3 eigenvalues.For carrying out the foundation cl judged after utilizing these 3 eigenvalues can obtain us.Cl be through
A calculated specific properties, joins in the middle of original data.Again by setting threshold value, can be to original fiber
Select.
Fig. 5 carries out the design sketch selected by local direction vector.Feature maximum compared with scatter matrix is exactly easy,
Need not fiber data is calculated.Because its effect is based on a summation of local direction, so effect is the most coarse,
Result is relatively simple.User can be according to the x formulated, and tri-required these fibers selected of direction definition of y, z should arrive
Degree, be defined as deg.The value of deg is the biggest the most obvious with regard to representing the feature in the direction to be obtained.
A kind of interactive brain fiber of the present invention selects and method for visualizing, comprises the steps:
1), import initial data, data are modeled, follow the tracks of out the path of fiber;
2), due to the self attributes of fiber data, all fibres path is the most non-isometric, for the spy that fiber is different in size
Property, fiber selection mode is divided into two classes by us, and a class is fiber system of selection based on scatter matrix, and the method pays close attention to list
The overall direction attribute of root fiber, does not consider the length of fiber;Another kind of, it is fiber selecting party based on local direction vector
Method, the method is paid close attention to the local direction attribute of fiber, is taken into account fibre length simultaneously;
2.1) fiber based on scatter matrix selects;
According to the direction vector of adjacent node on fiber path, calculate the scatter matrix S of every fiber path;Spread square
Battle array eigenvalue can describe the directional information of this fiber, then constructs machine direction parameter according to the eigenvalue of scatter matrix, from
And the fiber of different directions is selected;;
Step 21 calculates the local direction vector n between brain fiber adjacent nodei, its formula is:
ni=(xi-xi+1,yi-yi+1,zi-zi+1) (1)
Wherein, (xi,yi,zi) and (xi+1,yi+1,zi+1) represent the xyz space coordinates of i-th and i+1 node respectively;
Meanwhile, if a total of N number of node on a fiber, then need to calculate the direction vector between an all above node of fiber
(n0,n1,n2,......nN-2,nN-1), and thus constitute the matrix n of a direction vector;
Step2 2 calculates the scatter matrix S of every fiber;Its formula is as follows:
Wherein, niRepresent the direction vector of i-th point,Representing the transposition of the direction vector of i-th point, N represents current
The nodes of fiber;
After Step 23 obtains scatter matrix, calculate three eigenvalue β of scatter matrix1,β2,β3, each brain fiber dissipates
Three eigenvalues of cloth matrix can describe the xyz directional information of this fiber;Owing to the eigenvalue of scatter matrix may be plural number,
So, β herein1,β2,β3Represent the real part of three eigenvalues of each fiber correspondence scatter matrix S respectively;
Step 24 repeats step 1), step 2) and step 3), until calculating the characteristic of correspondence value of all fibres;
Step2 5 is calculated the discriminant parameter C corresponding to scatter matrixl, its computing formula is as follows:
Wherein, ClSpan be (-1,1), for describing the general direction information of current fibre;
Step 26 is by ClValue falls within threshold interval (Clstart,Clend) fiber take out, wherein, (Clstart,Clend) belong to
(-1,1), ClstartRepresent taken ClInterval minima, ClendRepresent taken ClInterval maximum;The choosing of different directions fiber
Select, can be by the interval (C of regulationlstart,Clend) realize;
2.2) fiber based on local direction vector selects:
Calculate the direction vector of adjacent node on fiber path, direction vector carried out unitization, by the direction to
Machine direction is judged by three space coordinatess of amount, brain machine direction is divided three classes;Direction initialization length threshold, passes through
The mode of regulation threshold value, selects the fiber in some direction;
3), fiber is color coded, makes the color of fiber change according to the change in its direction, show fiber
Direction tendency, so that nerve fiber is easier to perception at three dimensions;
4), extract and can describe the integrally-built fiber of cranial nerve fiber, then the fiber of different directions is recombinated,
Repaint the fiber in full brain field, with opacity, fiber is rendered by regulation color, simultaneously by rotation, scaling
The operation such as little carries out virtual interactive interface to fiber, preferably represents the spatial relationship of brain fiber;
Step4 1 is with step step2 1;
The local direction vector n that formula (1) is obtained by Step4 2iBeing standardized, its formula is:
Wherein,Computing formula be:
Step 43 gives three variable (Uis,Uap,Ulr) store x respectively, the fiber information in tri-directions of y, z, wherein, Uis
For x-axis direction fiber is counted, UapFor y-axis direction fiber is counted, UlrFor z-axis direction fiber is entered
Row counting;Additionally, given two parameters w1, w2(w2Much larger than w1) for rightTravel direction judge, its judge formula as:
Step44 travels through all of fiber, uses formula (7), sentences every fiber all local direction vector travel direction
Fixed;Finally with (Uis,Uap,Ulr) the direction that referred to of maximum, as the Main way of current fibre;After traversal terminates, entirely
Brain fiber will be divided into three classes with three directions;
Step 45 sets threshold value deg, and deg belongs to (0, maxN), wherein, maxNRepresent maximum fiber nodes number;By right
Threshold value deg is adjusted, and screens the fiber in some direction;
The reference direction DUAL PROBLEMS OF VECTOR MAPPING that formula (6) is obtained by Step 46 is to RGB color model, and its formula is:
Wherein, Rmax=Gmax=Bmax=255.