Background technology
Pulse train refers to by the sequence having one fixed width, the sequence units such as radio-frequency pulse and/or gradient pulse of amplitude forms.In prior art, usually several radio-frequency pulses and/or gradient pulse are combined into multiple blocks that can reuse, described block comprises at least one sequence units, and described block forms pulse train according to specific order and hierarchical structure arrangement again.
Existence dependency relationship between each block of described pulse train.Described dependence refers to perform described pulse train, the interaction existed between each block, interactional relation.Such as, perform certain block in described pulse train and need to know signal intensity or the duration of another block.Dependence between described block is stronger, and the difficulty of implementation of pulse train will be larger, and maintenance cost also will be higher.
In order to the hierarchical relationship between each block of clear description pulse train, adopt tree structure to organize each block, each block becomes a node of tree structure, then adopts preorder traversal method to control the execution of each block.Pulse train as shown in Figure 1, comprise A, B, C, D tetra-blocks, when performing this pulse train according to preorder traversal method, defer to traversal principle from top to bottom, from left to right, the execution sequence of each block is: A->B->C->D.For more complicated pulse train, as shown in Figure 2, A, B, C, D, E, F, G seven blocks can be comprised, same, when performing according to preorder traversal method, execution sequence is: A->B->E->F-Gre atT.GreaT.GTG->C->D.
In the process of implementation, for the situation of Existence dependency relationship between each block, in the disposal route of prior art, for the execution of above-mentioned block, by traveling through all nodes successively until nodal information required for obtaining, or the nodal information needed is referred in self object.Although it is separate that the former can keep between each block, maintain the reusability of block, but add the number of times traveling through and search, reduce the efficiency that pulse train performs, the latter ensure that the execution efficiency of pulse train, but reduces reusability and the dirigibility of block.
Above-mentioned two kinds of ways of the prior art, or reduce the execution efficiency of pulse train, or reduce reusability and the dirigibility of block, effect is all undesirable.
For solving the problem, embodiments providing a kind of method that gating pulse sequence performs, in the implementation of pulse train, establishing an intermediary agency in advance, in described intermediary agency, contain the self information that all sequences module can provide.In a block implementation, can go to call the information of other block in intermediary agency as required, and do not need to travel through other all node or other node is referred in self object, not only maintain reusability and the dirigibility of block, also improve the execution efficiency of pulse train.
For enabling above-mentioned purpose of the present invention, feature and advantage more become apparent, and are described in detail specific embodiments of the invention below in conjunction with accompanying drawing.
Summary of the invention
The problem that the present invention solves to take into account the execution efficiency of pulse train and the reusability of block and dirigibility in prior art.
For solving the problem, a kind of method that the embodiment of the present invention provides gating pulse sequence to perform, described pulse train comprises several blocks, and described block comprises at least one sequence units, and described method comprises:
Receive the instruction that user performs described pulse train;
According to the instruction of described execution pulse train, according to putting in order of described block, call the information of the intermediary agency set up in advance as required, control described block successively and perform; Described intermediary agency, comprises the self information that each block provides.
Optionally, the described information calling the intermediary agency set up in advance as required comprises: when determining to perform described block and needing the information of other block, calls the information of other block described from described intermediary agency.
Optionally, the described information calling the intermediary agency set up in advance as required comprises: when determining to perform described block and needing the information of other block, if there is recurrence relation between described block and other block described, then call the described information that there is other block of recurrence relation; If there is not recurrence relation between described block and other block described, then there is not the information of other block of recurrence relation described in calling from described intermediary agency.
Optionally, each block described arranges according to tree structure, and each block is as a node of described tree structure.
Optionally, described intermediary agency comprises the index information of described each node of tree structure.
Optionally, the index information of each node described comprises: the mark of each node and for obtaining function corresponding to each nodal information.
Optionally, each nodal information described comprises following at least one: the state of activation of node, duration, signal intensity, result of calculation and energy.
Optionally, described is pointer function for obtaining function corresponding to each nodal information.
Embodiments of the invention additionally provide a kind of device controlling described pulse train and perform, and described pulse train comprises several blocks, and described block comprises at least one sequence units, and described device comprises:
Instruction reception unit, performs the instruction of described pulse train for receiving user;
Intermediary agency, comprises the self information that each block provides;
Perform control module, according to the instruction performing described pulse train, according to putting in order of described block, call the information in described intermediary agency as required, control the execution of described block successively.
Optionally, described execution control module comprises:
First judgment sub-unit, for according to the instruction performing described pulse train, according to putting in order of described block, judges to perform the information of described block the need of other block successively;
First performs subelement, when described first judgment sub-unit determine to perform described block need the information of other block time, described first performs subelement for calling the information of other block described from described intermediary agency, performs described block.
Optionally, described execution control module comprises:
Second judgment sub-unit, for the instruction according to the described pulse train of execution, according to putting in order of described block, judge successively to perform the information of described block the need of other block, and when determining to perform described block and needing the information of other block, judge whether there is recurrence relation between described block and other block described;
Second performs subelement, when described second judgment sub-unit determines that performing described block needs the information of other block and there is recurrence relation between described block and other block described, described second performs subelement for calling the described information that there is other block of recurrence relation, performs described block; When described second judgment sub-unit determines that performing described block needs the information of other block and there is not recurrence relation between described block and other block described, described second perform subelement be used for calling from described intermediary agency described in there is not the information of other block of recurrence relation, perform described block.
Optionally, described block arranges according to tree structure, and each block is as a node of described tree structure.
Optionally, described intermediary agency comprises the index information of described each node of tree structure.
Optionally, the index information of each node described comprises: the mark of each node and for obtaining function corresponding to each nodal information.
Optionally, each nodal information described comprises following at least one: the state of activation of node, duration, signal intensity, result of calculation and energy.
Compared with prior art, technical scheme of the present invention has the following advantages:
In embodiments of the invention, when performing pulse train, establish an intermediary agency in advance, described intermediary agency is the set of the self information that each block of pulse train can provide.When performing described block, if determine to perform the information that described block needs other block, the information calling other block described in described intermediary agency can be gone as required, and travel through remaining node without the need to repeating or required node is referred in self object, while maintenance block reusability and dirigibility, turn improve the execution efficiency of pulse train.
Further, the information of other block that described block needs can all obtain from intermediary agency, also can part obtain from intermediary agency, when there is recurrence relation in other block described and described block, not needing recalls information from intermediary agency, making described pulse train more flexible when performing.
Further, adopt tree structure to organize each block, the structure of tree can flexible customization or amendment, facilitates the expansion of described pulse train.
Further, by arranging index information in described intermediary agency, mapping relations being set up to the nodal information at described each block place and the function for obtaining each nodal information corresponding, conveniently can search the information of correlated series module, improve execution efficiency.
Embodiment
In real life, pulse train has a wide range of applications, especially in magnetic resonance imaging.Described pulse train is made up of several blocks, described block comprises at least one sequence units, when performing above-mentioned pulse train, certain block in described pulse train needs the information knowing other block, i.e. Existence dependency relationship between the block of pulse train.
As shown in Figure 2, each block of pulse train adopts tree structure to organize, its interior joint A is father node, Node B, C, D are the child nodes of A, node E, F, G are again the child nodes of Node B, in a particular application, may there is dependence as shown in Figure 3 between above-mentioned pulse train, namely the result of calculation of father node A relies on the result of calculation of other all node, and the result of calculation of Node B relies on again the result of calculation of node D.For the dependence between above-mentioned node, in prior art, the following two kinds method is usually adopted to control the execution of described pulse train:
Method 1: travel through all nodes successively, until the nodal information required for obtaining.Such as, during XM A, travel through whole tree, until obtain the information required for this node; When performing B node, can according to the method for preorder traversal, traverse node E, F, G, C, D successively.Inventor finds, the way of this circulation searching, although it is separate to keep between each block, maintains the reusability of block, adds the number of times traveling through and search, reduce the efficiency that pulse train performs.
Method 2: referred to by the nodal information with dependence in self object, avoids the circulation searching of pulse train when performing with this.Such as, nodal information required for it is referred to self object by node A, the information of the node D of needs is referred to self object by Node B, complicated adduction relationship between this node, make cannot keep separate between block corresponding to each node, also just reduce reusability and the dirigibility of each block.
Embodiment one
See Fig. 4, the method that the gating pulse sequence described in the present embodiment performs, described pulse train comprises several blocks, and described block comprises at least one sequence units, and described method comprises:
Step 1: receive the instruction that user performs described pulse train;
Step 2: according to the instruction of described pulse train, according to putting in order of described block, calls the information of the intermediary agency set up in advance as required, controls the execution of described block successively; Described intermediary agency comprises the self information that each block provides.
Described pulse train can comprise some blocks, each block at least comprises a sequence units, described sequence units can be at least one gradient pulse, also can be at least one radio-frequency pulse, described block can be the combination of at least one gradient pulse and at least one radio-frequency pulse.
Described intermediary agency sets up in advance, and it includes the self information of all sequences module, can be understood as described intermediary agency and the information of block is carried out encapsulating the class formed.Described intermediary agency can arrange a unified calling interface, described pulse train is when being performed, putting in order and the information of other block that described block needs according to block, by above-mentioned calling interface, call the information of other block described stored in intermediary agency.
Method in the present embodiment, in described step 2, when determining to perform described block and needing the information of other block, that is, between described block and other block during Existence dependency relationship, all information that can be set to described block needs all are called from intermediary agency, and also the partial information that can be set to described block needs is called from intermediary agency.
When the partial information that described block needs is called from intermediary agency, consider the execution efficiency of described pulse train, there is certain relation together and between the partial sequence module of its Existence dependency relationship in described block, certain relation described can be recurrence relation.Like this, in the block of above-mentioned and described block Existence dependency relationship, the information that there is the block of recurrence relation with described block does not just need to call from intermediary agency, and call from intermediary agency with the information that described block does not exist the block of recurrence relation, just better can improve the execution efficiency of pulse train.
Embodiment two
Present embodiments provide a kind of pulse train of magnetic resonance imaging arts, as shown in Figure 5, described pulse train comprises gradin-echo module (Gradient Echo kernel, GRE kernel), i.e. node 109, described gradin-echo module for generation of magnetic resonance signal, and then excites magnetic resonance equipment, obtains the magnetic resonance image (MRI) of tissue.Described pulse train also comprises other general block, as inversion recovery module (IR), i.e. node 107, free time packing module (FilltimeLeaf), i.e. node 108, forms described pulse train 10 jointly with node 101, node 102, node 103, node 104, node 105 and node 106.
Each block of pulse train 10 can be organized according to certain level and subordinate relation, is convenient to the execution of pulse train.Such as, each block can adopt tree structure to go to organize each block, and Binary Heap structure also can be adopted to go to organize each block, and those skilled in the art can select according to actual needs voluntarily.In the present embodiment, in order to make the institutional framework of pulse train can customize flexibly, revise and expand, tree structure is adopted to organize each block of described pulse train 10.
Described intermediary agency 20 includes the self information that all nodes can provide, the information that described all nodes can provide comprise each node mark (ID) and for obtaining function corresponding to each nodal information.The information of each node described can be at least one in the state of activation of each node, duration, signal intensity, result of calculation and energy.
Such as, the ID of node 107 and the function F for obtaining node 107 state of activation can be comprised in described intermediary agency 20
1(x), for obtaining the function T of node 107 duration
1(x), for obtaining the function N of node 107 energy
1(x); The ID of node 108 and the function F for obtaining node 108 state of activation
2(x), for obtaining the function T of node 108 duration
2(x), for obtaining the function N of node 108 energy
2(x); The ID of node 109 and the function F for obtaining node 109 state of activation
3(x), for obtaining the function T of node 109 duration
3(x), for obtaining the function N of node 109 energy
3(x).Above-mentioned can be pointer function for obtaining function corresponding to each nodal information, in the present embodiment, for convenience of description, adopts above-mentioned form to represent each function.
In order to convenient information searching, described intermediary agency 20 comprises the index information of described each node of tree structure, described index information can being arranged to concordance list, the ID of each node can being found according to described index information and for obtaining function corresponding to each node.
When performing described pulse train 10, if node 103 needs the state of activation information of node 107, and the state of activation information of node 107 depends on the energy information of node 109, described pulse train is performed according to the method for preorder traversal, when performing described node 103, required information can be called from intermediary agency.
Concrete, described node 103 first finds the ID of node 107 in the index information of intermediary agency, the more corresponding function F found for obtaining node 107 state of activation
1x (), performs the state of activation information that described function removes to obtain node 107, and by the result feedback of acquisition to intermediary agency.In the process of state of activation obtaining node 107, because the state of activation information of node 107 depends on again the energy information of node 109, so node 107 first finds the ID of node 109 in intermediary agency according to index information, then correspondence finds the function N of node 109 for getter energy information
3x (), goes to perform described function N
3x (), by the result feedback of acquisition to intermediary agency.Like this, after node 107 obtains the energy information of node 109 from intermediary agency, by the state of activation information feed back of self to intermediary agency, make node 103 can obtain the information of needs, complete the execution of described node 103.
If the execution of node 103 depends on the state of activation information of node 105 and the Duration Information of node 109, according to the feature of tree structure, node 103 is father nodes of node 105, there is recurrence relation between node 103 and node 105.So node 103 is in the process performed, and directly can call the information of node 105, the energy information for node 109 then needs to go to call according to above-mentioned similar method from intermediary agency.No matter be call information in need from intermediary agency, or the information that invoke section needs from intermediary agency, as long as the execution efficiency of pulse train can be improved.
Embodiment three
See Fig. 6, the present embodiment additionally provides a kind of device controlling described pulse train and perform, and described pulse train comprises several blocks, and described block comprises at least one sequence units, and described device comprises:
Instruction reception unit 110, for receiving the instruction performing described pulse train;
Intermediary agency 20, comprises the self information that each block provides;
Perform control module 120, according to the instruction performing described pulse train, according to putting in order of described block, call the information in described intermediary agency 20 as required, control the execution of described block successively.
Each block in described pulse train arranges according to certain level and subordinate relation, and described execution control module 120 performs described pulse train successively according to above-mentioned putting in order.Owing to often there is dependence between block, when the execution control module 120 described in the present embodiment performs described pulse train, the information in intermediary agency 20 can called as required is to complete the execution of each block.Described intermediary agency 20 can arrange the external calling interface of a unification, and described execution control module 120 can be mutual by carrying out between above-mentioned calling interface and intermediary agency.
In concrete enforcement, described execution control module can comprise:
First judgment sub-unit 121, for according to the instruction performing described pulse train, according to putting in order of described block, judges to perform the information of described block the need of other block successively;
Second performs subelement 122, when described first judgment sub-unit 121 determine to perform described block need the information of other block time, described first performs subelement 122 for calling the information of other block described from described intermediary agency, performs described block.
Described execution control module can also comprise:
Second judgment sub-unit, for the instruction according to the described pulse train of execution, according to putting in order of described block, judge successively to perform the information of described block the need of other block, and when determining to perform described block and needing the information of other block, judge whether there is recurrence relation between described block and other block described;
Second performs subelement, when described second judgment sub-unit determines that performing described block needs the information of other block and there is recurrence relation between described block and other block described, described second performs subelement for calling the described information that there is other block of recurrence relation, performs described block; When described second judgment sub-unit determines that performing described block needs the information of other block and there is not recurrence relation between described block and other block described, described second perform subelement be used for calling from described intermediary agency described in there is not the information of other block of recurrence relation, perform described block.
Corresponding to the method controlling described pulse train in the present embodiment and perform, tree structure can be adopted to organize block in described pulse train, and each block is a node of described tree structure.
In concrete enforcement, described intermediary agency 20 can comprise the index information of described each node of tree structure, can set up concordance list according to described index information.Described index information can comprise described each block of pulse train node ID and for obtaining function corresponding to each nodal information.Easy-to-look-up and described block the relevant information of other block of dependence can be had by index information.
The information of each node described comprises at least one in following information: the state of activation of node, duration, signal intensity, result of calculation and energy.The described function for obtaining each nodal information can be pointer function.
Pulse train 10 as described in Figure 4, in implementation, rely on the Duration Information of node 108 for node 104 and described execution control module 120 comprises the first judgment sub-unit 121 and first performs subelement 122, the embodiment of the device of application described in the present embodiment is as follows:
When instruction reception unit 110 receives the instruction performing described pulse train, notify that described execution control module 120 starts to perform described pulse train;
First judgment sub-unit 121 of described execution control module 120, according to the instruction performing described pulse train, performs each node according to preorder traversal method, when performing node 104, determines that XM 104 depends on the Duration Information of node 108;
First of described execution control module 120 performs subelement 122 according to the judged result of described first judgment sub-unit, the ID of described node 108 and the function for obtaining described node 108 duration is found by the index information of intermediary agency, perform described for obtaining the function of duration, by the result feedback that obtains to intermediary agency 20, like this, described node 104 just can obtain relevant information from intermediary agency, and then completes the execution of node 104.
It should be noted that, described node 104 can depend on an information of node 108, also can depend on multiple information of node 108.When depending on multiple information of node 108, described function can be performed as stated above to obtain relevant result simultaneously, completing the execution of node 103 with this.
Although the present invention discloses as above, the present invention is not defined in this.Any those skilled in the art, without departing from the spirit and scope of the present invention, all can make various changes or modifications, and therefore protection scope of the present invention should be as the criterion with claim limited range.