Disclosure of Invention
The invention aims to provide a method, a device and a medium for simultaneously detecting magnetic resonance gradient delay and gradient switching rate, which are used for at least solving the technical problems that gradient values need to be respectively converted on a plurality of gradient axes for testing, the operation steps are complicated and the time consumption is long in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a first aspect provides a method for simultaneous detection of magnetic resonance gradient lag and gradient switching rate, comprising:
setting gradient detection parameters, wherein the gradient detection parameters at least comprise a group of test gradient values and a plurality of gradient axes to be tested;
scanning and detecting each gradient axis to be detected based on a preset pulse sequence to obtain a group of echo data corresponding to each gradient value to be detected;
performing inverse Fourier transform on the echo data to obtain first-order phase data, and respectively calculating gradient delay time and gradient switching rate of the system according to the first-order phase data;
the preset pulse sequence comprises at least one radio frequency pulse RF, n +1 signal acquisition windows and 2 (n + 1) gradient waveforms A pre ,A 0 ,A re0 ,A 1 ,A re1 ,...,A re(n-1) ,A n (ii) a Wherein, the center of the jth signal acquisition window corresponds to the center of the 2 jth gradient waveform, the start time of the 1 st gradient waveform is the end time of the radio frequency pulse RF, and the areas of the 1 st gradient waveform and the 2 nd gradient waveform satisfy A pre =A 0 A gradient waveform from the 3 rd gradient waveform to the 2 (n + 1) th gradient waveform having an area satisfying A re(j-1) =(A j-1 +A j )/2),j=1,2,...,n。
In one possible design, the set of test gradient values includes G 1 ,G 2 ,...,G m And G is 1 <G 2 <...<G m ,G m Representing the amplitude of the test gradient, wherein the multiple gradient axes to be tested comprise a gradient X axis to be tested, a gradient Y axis to be tested and a gradient Z axis to be tested;
the gradient detection parameters further comprise an initial gradient delay time TDelay 0 Initial gradient switching rate S 0 And a gradient edge climbing time range of a preset pulse sequence, wherein the maximum climbing time of the gradient edge is T max =G m /S 0 Gradient along minimum climb time of T min =G 1 /S 0 。
In one possible design, the gradient edge climbing time of the first 3 gradient waveforms is greater than that corresponding to the maximum switching rate, and from the 4 th gradient waveform, the gradient edge climbing time satisfies the following condition:
T lj =T rj ; (1)
T rel(j-1) =T r(j-1) ; (2)
T rer(j-1) =T lj ; (3)
T lj =T l(j-1) -Δt; (4)
wherein, T lj And T rj Left and right gradient edge climb times, k =4,6.., 2 (n + 1), T, representing the kth gradient waveform, respectively l(j-1) And T r(j-1) Left and right gradient edge climb times, T, representing the k-2 th gradient waveform rel(j-1) And T rer(j-1) Left and right gradient edge climb times representing the k-1 th or g-th gradient waveform, respectively, g =3,5,. 2 (n + 1) -1, Δ t representing the time of the gradient edge between adjacent gradient waveforms.
In one possible design, the left gradient of the 4 th gradient waveform follows the climb time T l1 Gradient edge climbing time T corresponding to gradient switching rate greater than maximum gradient switching rate max Left gradient of the 2 (n + 1) th gradient waveform along the climb time T ln Gradient edge climbing time T corresponding to gradient switching rate smaller than maximum gradient switching rate min 。
In one possible design, the method includes performing inverse fourier transform on echo data to obtain first-order phase data, and calculating gradient delay time and gradient switching rate of the system according to the first-order phase data, including:
each group of echo data echo 0i ,...,echo ni Obtaining a group of first-order phase data ph after inverse Fourier transform 0i ,...,ph ni Wherein i ∈ [1, m ]]M represents the total number of the test gradient values;
and calculating the gradient delay time corresponding to each test gradient value according to each group of first-order phase data, wherein the calculation formula is as follows:
TDelay i =ph 0i /2/pi×NoRd×DW; (5)
wherein pi represents a circumference ratio pi, noRd represents sampling points, and DW represents sampling interval time;
obtaining the gradient delay time of the system according to the average value of the gradient delay times:
TDelay=mean(TDelay 1 ,...,TDelay m ); (6)
obtaining a sudden change value ph in a group of first-order phase data by adopting difference or fitting calculation xi And according to the mutation value ph xi Calculating to obtain a corresponding gradient switching rate:
S i =G i /T lx ; (7)
wherein G is i Representing the current test gradient value, T lx Indicates the mutation value ph xi A corresponding limiting gradient climb time;
obtaining the gradient switching rate of the system according to the average value of a plurality of gradient switching rates:
S=mean(S 1 ,...,S m ) (8)。
in one possible design, after the gradient delay time and the gradient switching rate of the system are respectively calculated from the first-order phase data, the method further includes:
respectively calculating the iterative deviations of the gradient delay time and the gradient switching rate of the system:
δTDelay=abs(TDelay-TDelay 0 ); (9)
δS=abs(S-S 0 ); (10)
wherein δ TDelay represents an iterative deviation of gradient delay time, δ S represents an iterative deviation of gradient switching rate;
updating the initial gradient delay time to TDelay 0 = TDelay, and updates the initial gradient switching rate to S 0 =S。
In one possible design, after updating the initial gradient delay time and the initial gradient switching rate, the method further includes:
judging whether the iteration is ended, if so, ending the iteration loop, wherein the judgment conditions are as follows:
δTDelay<δTDelay thre &&δS<δS thre ; (11)
wherein, delta TDelay thre Iterative threshold, δ S, representing gradient delay time thre An iteration threshold representing the gradient switching rate.
In one possible design, the radio frequency pulse comprises a soft pulse or a hard pulse.
A second aspect provides a magnetic resonance gradient delay and gradient switching rate simultaneous detection apparatus comprising:
the parameter setting module is used for setting gradient detection parameters, wherein the gradient detection parameters at least comprise a group of test gradient values and a plurality of gradient axes to be detected;
the scanning detection module is used for carrying out scanning detection on each gradient axis to be detected based on a preset pulse sequence to obtain a group of echo data corresponding to each test gradient value;
the index calculation module is used for performing inverse Fourier transform on the echo data to obtain first-order phase data, and calculating gradient delay time and gradient switching rate of the system according to the first-order phase data;
the preset pulse sequence comprises at least one radio frequency pulse RF, n +1 signal acquisition windows and 2 (n + 1) gradient waveforms A pre ,A 0 ,A re0 ,A 1 ,A re 1,...,A re(n-1) ,A n (ii) a Wherein, the center of the jth signal acquisition window corresponds to the center of the 2 jth gradient waveform, the start time of the 1 st gradient waveform is the end time of the radio frequency pulse RF, and the areas of the 1 st gradient waveform and the 2 nd gradient waveform satisfy A pre =A 0 A 3 rd gradient waveform to a 2 nd (n + 1) th gradient waveform have an area satisfying A re(j-1) =(A j-1 +A j )/2),j=1,2,...,n。
A third aspect provides a computer readable storage medium having stored thereon instructions for performing a simultaneous magnetic resonance gradient delay and gradient switching rate detection method as described in any one of the possible designs of the first aspect when the instructions are run on a computer.
A fourth aspect provides a computer device comprising a memory, a processor and a transceiver communicatively connected in sequence, wherein the memory is used for storing a computer program, the transceiver is used for transceiving a message, and the processor is used for reading the computer program and executing the magnetic resonance gradient delay and gradient switching rate simultaneous detection method as described in any one of the possible designs of the first aspect.
A fifth aspect provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform a method of simultaneous detection of magnetic resonance gradient delay and gradient switching rate as set out in any one of the possible designs of the first aspect.
Compared with the prior art, the invention has the beneficial effects that:
the method comprises the steps of setting a group of test gradient values and a plurality of gradient axes to be tested, and performing scanning detection on each gradient axis to be tested based on a preset pulse sequence to obtain a group of echo data corresponding to each test gradient value; then, the echo data is subjected to inverse Fourier transform to obtain first-order phase data, and the gradient delay time and the gradient switching rate of the system are respectively calculated according to the first-order phase data, so that the gradient value of the system is detected while the gradient delay time is corrected without changing the test gradient value for each test axis, and the test time of the system is greatly saved; and a plurality of gradient delay times and a plurality of gradient switching rates are correspondingly obtained by setting a plurality of test gradient values, so that the gradient delay time and the gradient switching rate of the system are obtained according to the mean value of the gradient delay times and the mean value of the gradient switching rates, and the authenticity and the accuracy of a detection result are effectively improved.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly described below with reference to the accompanying drawings and the embodiments or the description of the prior art, it is obvious that the following description of the structure of the drawings is only some embodiments of the present invention, and it is also possible for those skilled in the art to obtain other drawings based on the drawings without creative efforts. It should be noted that the description of the embodiments is provided to help understanding of the present invention, and the present invention is not limited thereto.
Examples
As shown in fig. 1, before detecting the gradient delay and the gradient switching rate, a pulse sequence for scanning the acquired signal needs to be set, and in the embodiment of the present application, fig. 1 shows a timing chart of the pulse sequence of the embodiment of the present application. Specifically, the pulse sequence in the embodiment of the present application includes at least one radio frequency pulse RF, n +1 signal acquisition windows, and 2 (n + 1) gradient waveforms a pre ,A 0 ,A re0 ,A 1 ,A re 1,...,A re(n-1) ,A n (ii) a Wherein, the center of the jth signal acquisition window corresponds to the center of the 2 jth gradient waveform, the start time of the 1 st gradient waveform is the end time of the radio frequency pulse RF, and the areas of the 1 st gradient waveform and the 2 nd gradient waveform satisfy A pre =A 0 A gradient waveform from the 3 rd gradient waveform to the 2 (n + 1) th gradient waveform having an area satisfying A re(j-1) =(A j-1 +A j )/2),j=1,2,...,n。
It should be noted that the radio frequency pulse may be a hard pulse or a soft pulse, and when the soft pulse is selected, the slice selection gradient may be increased on the gradient axis. Wherein the 1 st signal acquisition window echo 0 Center corresponds to 2 nd gradient waveform A 0 Central, 2 nd acquisition window echo 1 The center corresponds to the 4 th gradient A 1 Center, and so on, the (n + 1) th collection window echo n The center corresponds to the 2 (n + 1) th gradient A n A center. Wherein, the 1 st gradient waveform starts when the radio frequency pulse ends, and the subsequent gradients are sequentially sequenced; the area of the 1 st gradient waveform is A pre The area of the 2 nd gradient waveform is A 0 The following formula is satisfied: a. The pre =A 0 2; wherein the 3 rd gradient waveform has an area of A re0 4 th gradient waveThe area of the shape is A 1 The area of the 5 th gradient waveform is A re1 The area of the 6 th gradient waveform is A 2 By analogy, the area of the 2 (j + 1) th gradient waveform is A j The area of the 2 (j + 1) -1 st gradient waveform is A re(j-1) J =1, 2.. Times.n, and satisfies the following formula: a. The re(j-1) =(A j-1 +A j )/2。
Referring to fig. 2-3 in combination, the flowchart of the method for simultaneously detecting a gradient delay and a gradient switching rate of magnetic resonance provided by the embodiment of the present application includes, but is not limited to, steps S1 to S3:
s1, setting gradient detection parameters, wherein the gradient detection parameters at least comprise a group of test gradient values and a plurality of gradient axes to be tested;
in step S1, specifically, setting gradient detection parameters, including:
301: setting the initial gradient delay time TDelay 0 And initial gradient switching rate S 0 Preferably, the embodiment of the present application delays the initial gradient by the time TDelay 0 Set to 0, initial gradient switching rate S 0 Setting as a system default or recommended value;
302: setting a set of test gradient values G 1 <G 2 <...<G m ,G m Representing a test gradient magnitude;
303: setting a plurality of gradient axes to be tested, including a gradient X axis to be tested, a gradient Y axis to be tested and a gradient Z axis to be tested, specifically setting the sequence for testing each gradient axis, so that a preset pulse sequence scans and detects each gradient axis to be tested in sequence according to the test sequence;
304: setting a gradient edge climbing time range of a preset pulse sequence, wherein the maximum climbing time of the gradient edge is T max =G m /S 0 Gradient along minimum climb time of T min =G 1 /S 0 (ii) a In the embodiment of the present application, it is preferable that the left gradient of the 4 th gradient waveform is along the climbing time T l1 Gradient edge climbing time T corresponding to gradient switching rate greater than maximum gradient switching rate max Left gradient of the 2 (n + 1) th gradient waveform along the climb time T ln Gradient edge climbing time T corresponding to gradient switching rate smaller than maximum gradient switching rate min More preferably, T l1 =1.2×T max ,T ln =0.8×T min 。
Wherein, the left gradient of the 4 th gradient waveform is along the climbing time T l1 Is set to be greater than the gradient edge climbing time T corresponding to the maximum gradient switching rate max Left gradient of the 2 (n + 1) th gradient waveform along the climb time T ln Gradient edge climbing time T corresponding to gradient switching rate smaller than maximum gradient switching rate min The principle of (A) is as follows: the 4 th gradient is used for testing the switching rate, so that the gradient of each gradient is required to be gradually shortened along the climbing time (namely the following formula (4)), the switching rate is gradually increased until the maximum switching rate is finally exceeded, and finally the limit switching rate of the system can be measured by the arrangement. Tmax and Tmin are the upper and lower limits of the test gradient value G1 \8230andGm, and ensure that the switching rate can be met in all gradient value tests from low to high until the maximum switching rate is exceeded.
As shown in fig. 4, in a specific embodiment 304, the gradient along the climbing time of the first 3 gradient waveforms is greater than the gradient along the climbing time corresponding to the maximum switching rate, from the 4 th gradient waveform, the gradient waveforms are set as triangular waveforms, and the gradient along the climbing time satisfies the following conditions:
T lj =T rj ; (1)
T rel(j-1) =T r(j-1) ; (2)
T rer(j-1) =T lj ; (3)
T lj =T l(j-1) -Δt; (4)
wherein, T lj And T rj Left and right gradient edge climb times, k =4,6.., 2 (n + 1), T, representing the kth gradient waveform, respectively l(j-1) And T r(j-1) Left and right gradient edge climb times, T, representing the k-2 gradient waveforms rel(j-1) And T rer(j-1) The left gradient along the climbing time and the right gradient along the climbing time of the kth-1 or the g-th gradient waveform respectively, and g =3,51, Δ t represents the time difference of the gradient edge between adjacent gradient waveforms, corresponding to the detection precision of the gradient switching rate, and theoretically, the smaller Δ t is, the more accurate the detected gradient switching rate is.
The reason why the gradient edge rising time of the first 3 gradient waveforms is set to be greater than the gradient edge rising time corresponding to the maximum switching rate and the gradient edge rising time from the 4 th gradient waveform is set to satisfy the above condition is that: since Tmax = Gm/S0, where Gm is the maximum gradient value of the test, if the rising time of the first 3 gradient waveforms is set to be less than Tmax, when the Gm gradient value is tested, the actually output switching rate exceeds the system switching rate, and at this time, the gradient waveforms are distorted by the system limitation, so that the gradient area cannot meet the system requirement, the gradient delay calculation has a deviation, and therefore, the gradient is set to be used for testing the switching rate from the 4 th gradient waveform, so that the gradient of each gradient needs to be gradually shortened along the rising time (i.e., formula (4)), at this time, the switching rate gradually increases until the maximum switching rate is finally exceeded, and finally, the limit switching rate of the system can be measured by the above setting.
S2, scanning and detecting each gradient axis to be detected based on a preset pulse sequence to obtain a group of echo data corresponding to each test gradient value, and the method specifically comprises the following steps:
305: based on the pulse sequence shown in fig. 1, a set of echo data corresponding to each test gradient value is acquired as follows:
echo 01 、echo 11 、...、echo n1
…
s3, performing inverse Fourier transform on the echo data to obtain first-order phase data, and respectively calculating gradient delay time and gradient switching rate of the system according to the first-order phase data;
in step S3, inverse fourier transform is performed on the echo data to obtain first-order phase data, and gradient delay time and gradient switching rate of the system are respectively calculated according to the first-order phase data, including:
306: each group of echo data echo 0i ,...,echo ni Performing inverse Fourier transform;
307: calculating first-order phase data ph after inverse Fourier transform of each echo data 0i ,...,ph ni Wherein i ∈ [1, m ]]And m represents the total number of the tested gradient values, and is as follows:
ph 01 、ph 11 、...、ph u1
…
308: and calculating the gradient delay time corresponding to each tested gradient value according to each group of first-order phase data, wherein the calculation formula is as follows:
TDelay i =ph 0i /2/pi×NoRd×DW; (5)
wherein pi is a circumferential rate pi, noRd represents the number of sampling points, and DW represents sampling interval time;
then, the gradient delay time corresponding to a set of test gradient values can be expressed as follows:
TDelay 1 =ph 01 /2/pi*NoRd*DW
…TDelay m =ph 0m /2/pi*NoRd*DW;
309: obtaining the gradient delay time of the system according to the average value of the gradient delay times:
TDelay=mean(TDelayl,...,TDelaym); (6)
310: obtaining a set of abrupt change values ph in first-order phase data by adopting difference or fitting calculation xi And according to the mutation value ph xi Calculating to obtain a corresponding gradient switching rate:
S i =G i /T lx : (7)
wherein, G i Representing the current test gradient value, T lx Representing the mutation value ph xi A corresponding limiting gradient climb time;
for example: when the test gradient value is G m Then, the method of fitting or difference is adopted to find ph 0m ,...,ph nm The mutation value ph in (1) xm Description in echo x When the gradient switching rate reaches the limit, the corresponding limit gradient climbing time T lx Then the gradient switching rate is S m =G m /T lx 。
311: obtaining the gradient switching rate of the system according to the average value of a plurality of gradient switching rates:
S=mean(S 1 ,...,S m ) (8)。
it should be noted that, in the embodiment of the present application, the testing of three gradient axes is respectively completed through steps 304 to 311 in a circulating manner, after the scanning detection and index calculation on one gradient axis to be tested are finished, it is determined through step 312 whether all the gradient axis tests are completed, and if not, after a new gradient axis to be tested is set, steps 304 to 311 are repeated until all the gradient axis tests are completed; of course, it is understood that, in the embodiment of the present application, a cycle of gradient axis switching may also be directly added in the sequence, and the test of three gradient axes is completed by one scan, so that the cycle of the external step 312 is not required.
Preferably, in a possible design, after the gradient delay time and the gradient switching rate of the system are respectively calculated according to the first-order phase data, the method further comprises:
313: respectively calculating the iterative deviations of the gradient delay time and the gradient switching rate of the system:
δTDelay=abs(TDelay-TDelay 0 ); (9)
δS=abs(S-S 0 ); (10)
wherein δ TDelay represents an iterative deviation of gradient delay time, δ S represents an iterative deviation of gradient switching rate;
314: updating the initial gradient delay time to TDelay 0 = TDelay, and updates the initial gradient switching rate to S 0 =S。
Preferably, in one possible design, after updating the initial gradient delay time and the initial gradient switching rate, the method further includes:
315: judging whether the iteration is ended, if so, ending the iteration loop, wherein the judgment conditions are as follows:
δTDelay<δTDelay thre &&δS<δS thre ; (11)
wherein, delta TDelay thre Iterative threshold, δ S, representing gradient delay time thre An iteration threshold representing a gradient switching rate;
otherwise, repeating steps 303-314 continues to iterate, so that the accuracy of the gradient delay and gradient switching rate test can be further improved by iteration in the gradient delay time correction process.
Based on the above disclosure, in the embodiment of the application, a group of test gradient values and a plurality of gradient axes to be tested are set, and each gradient axis to be tested is scanned and detected based on a preset pulse sequence, so as to obtain a group of echo data corresponding to each test gradient value; then, the echo data is subjected to inverse Fourier transform to obtain first-order phase data, and the gradient delay time and the gradient switching rate of the system are respectively calculated according to the first-order phase data, so that the gradient value of the system is detected while the gradient delay time is corrected without changing the test gradient value for each test axis, and the test time of the system is greatly saved; and a plurality of gradient delay times and a plurality of gradient switching rates are correspondingly obtained by setting a plurality of test gradient values, so that the gradient delay time and the gradient switching rate of the system are obtained according to the mean value of the gradient delay times and the mean value of the gradient switching rates, and the authenticity and the accuracy of a detection result are effectively improved.
A second aspect provides a magnetic resonance gradient lag and gradient switching rate simultaneous detection apparatus comprising:
the parameter setting module is used for setting gradient detection parameters, wherein the gradient detection parameters at least comprise a group of test gradient values and a plurality of gradient axes to be detected;
the scanning detection module is used for carrying out scanning detection on each gradient axis to be detected based on a preset pulse sequence to obtain a group of echo data corresponding to each test gradient value;
the index calculation module is used for performing inverse Fourier transform on the echo data to obtain first-order phase data, and calculating gradient delay time and gradient switching rate of the system according to the first-order phase data;
the preset pulse sequence comprises at least one radio frequency pulse RF, n +1 signal acquisition windows and 2 (n + 1) gradient waveforms A pre ,A 0 ,A re0 ,A 1 ,A re 1,...,A re(n-1) ,A n (ii) a Wherein, the center of the jth signal acquisition window corresponds to the center of the 2 jth gradient waveform, the start time of the 1 st gradient waveform is the end time of the radio frequency pulse RF, and the areas of the 1 st gradient waveform and the 2 nd gradient waveform satisfy A pre =A 0 A 3 rd gradient waveform to a 2 nd (n + 1) th gradient waveform have an area satisfying A re(j-1) =(A j-1 +A j )/2),j=1,2,...,n。
A third aspect provides a computer readable storage medium having stored thereon instructions for performing a simultaneous magnetic resonance gradient delay and gradient switching rate detection method as described in any one of the possible designs of the first aspect when the instructions are run on a computer.
The computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, floppy disks, optical disks, hard disks, flash memories, flash disks and/or Memory sticks (Memory sticks), etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
For the working process, working details and technical effects of the foregoing computer-readable storage medium provided in the third aspect of this embodiment, reference may be made to the method described in the first aspect or any one of the possible designs of the first aspect, which is not described herein again.
A fourth aspect provides a computer device comprising a memory, a processor and a transceiver communicatively connected in sequence, wherein the memory is used for storing a computer program, the transceiver is used for transceiving a message, and the processor is used for reading the computer program and executing the magnetic resonance gradient delay and gradient switching rate simultaneous detection method as described in any one of the possible designs of the first aspect.
For example, the Memory may include, but is not limited to, a Random-Access Memory (RAM), a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a First-in First-out (FIFO), and/or a First-in Last-out (FILO), and the like; the processor may not be limited to the use of a microprocessor model number STM32F105 family; the transceiver may be, but is not limited to, a WiFi (wireless fidelity) wireless transceiver, a bluetooth wireless transceiver, a GPRS (General Packet Radio Service) wireless transceiver, and/or a ZigBee (ZigBee protocol, low power local area network protocol based on ieee802.15.4 standard) wireless transceiver, etc. In addition, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.
For the working process, working details and technical effects of the foregoing computer device provided in the fourth aspect of this embodiment, reference may be made to the method described in the first aspect or any one of the possible designs of the first aspect, which is not described herein again.
A fifth aspect provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform a method of simultaneous detection of magnetic resonance gradient delay and gradient switching rate as set out in any one of the possible designs of the first aspect.
For the working process, the working details and the technical effects of the computer program product containing the instructions provided in the fifth aspect of the present embodiment, reference may be made to the method described in the first aspect or any one of the possible designs of the first aspect, and details are not described herein again.
Finally, it should be noted that: the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.