CN107908363B - PET coincidence event screening method, system and device based on CUDA - Google Patents

PET coincidence event screening method, system and device based on CUDA Download PDF

Info

Publication number
CN107908363B
CN107908363B CN201711102890.7A CN201711102890A CN107908363B CN 107908363 B CN107908363 B CN 107908363B CN 201711102890 A CN201711102890 A CN 201711102890A CN 107908363 B CN107908363 B CN 107908363B
Authority
CN
China
Prior art keywords
event
cache
events
coincidence
screening
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711102890.7A
Other languages
Chinese (zh)
Other versions
CN107908363A (en
Inventor
徐驰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Raysolution Digital Medical Imaging Co ltd
Original Assignee
Raysolution Digital Medical Imaging Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Raysolution Digital Medical Imaging Co ltd filed Critical Raysolution Digital Medical Imaging Co ltd
Priority to CN201711102890.7A priority Critical patent/CN107908363B/en
Publication of CN107908363A publication Critical patent/CN107908363A/en
Application granted granted Critical
Publication of CN107908363B publication Critical patent/CN107908363B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices

Abstract

The invention is suitable for the technical field of medical treatment, and provides a method, a system and a device for screening PET coincidence events based on CUDA (compute unified device architecture), wherein the method comprises the following steps: writing a data packet sent by the acquisition detector into an original data cache of the memory, and copying original data in the original data cache of the memory into an original data cache of the video memory; analyzing original data in an original data cache of the video memory to generate each event, writing the generated event into an event cache of the video memory, performing coincidence screening on each event in the event cache of the video memory, and marking coincidence information of each event according to a coincidence screening result; and copying the event which is matched with the screening in the event cache of the video memory into the event cache of the memory, browsing the event cache in the memory, and storing the matched event according to the matched information. The storage space of the CPU and the calculation capacity of the GPU are fully and reasonably utilized, and the requirement that the performance requirement of the software screening meeting the event is high in the PET engineering realization process is met.

Description

PET coincidence event screening method, system and device based on CUDA
Technical Field
The invention belongs to the technical field of medical treatment, and particularly relates to a method, a system and a device for screening PET coincidence events based on CUDA.
Background
Positron Emission Tomography (PET) system is an advanced molecular imaging diagnostic device in the medical field today, and is also called nuclear medicine device because it uses radionuclides as tracers. The PET system is widely applied to early tumor focus detection, radiotherapy and chemotherapy recovery effect evaluation, and system disease detection such as cardiac and cerebral nerves, and has irreplaceable advantages in some diagnostic fields.
In principle, after the FDG label containing the positron nuclide is injected into a detected human body as a tracer, the tracer diffuses into various tissues along with blood and participates in the metabolic activity of the human body, the positron nuclide releases positrons to annihilate with negative electrons in the surrounding environment, a pair of gamma photons with equal energy and opposite propagation directions are generated, and the gamma photons detected by a detection device and identified as coming from the same positron annihilation event are called as a coincidence event. In order to improve the efficiency of PET scanning, it is necessary to screen all event data sent by the detector while acquiring the event data, and finally, save the event after coincidence.
In the technical scheme disclosed by the Chinese invention patent named as 'a hardware-based coincidence event determination method' (grant publication No. CN103336683B), 'a method and a device for determining random coincidence events and true coincidence events' (grant publication No. CN103559391B) and 'a coincidence event determination method and a device' (grant publication No. 103413051B), in the technical scheme disclosed by the prior art, high-speed scintillation pulses are processed by adopting a simulation or analog-digital mixing method, and the time information or the position information of detected photons cannot be directly acquired, for example, in the technical scheme disclosed by the 'coincidence event determination method and device', gamma photon pairs generated by annihilation events respectively form a coincidence line for spatial positions respectively reaching a detection device, and the positions of the gamma photon pairs are determined to be coincident by the length of the coincidence line, the coincidence determination process is complex and inaccurate.
Furthermore, when the coincidence event is completed by software, the communication link between the detection device and the computer software is under high pressure and the cost for realizing the communication link is high when the event information which needs to be uploaded to the processing software is high. In addition, the above coincidence event determination method needs to complete the processing procedures such as ordering of a huge amount of event occurrence time information and determination of time and space coincidence in a serial manner in a short time, the pressure of processing software is very large, the processing time is long, and meanwhile, the coincidence event determination efficiency is low, so that the prior art adopts hardware-based determination of coincidence events. The cost required for judging by adopting hardware is high, the maintenance process of the hardware is complex, and the judgment rule can not be adjusted in real time according to the requirement.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a system and a device for screening PET coincidence events based on CUDA, which can overcome at least part of defects in the prior art.
The embodiment of the invention relates to a CUDA-based PET coincidence event screening method, which comprises the following steps: step S1, writing a data packet sent by the acquisition detector into an original data cache of the memory, and copying original data in the original data cache of the memory into an original data cache of the video memory;
step S2, analyzing the original data in the original data cache of the video memory to generate each event, writing the generated event into the event cache of the video memory, performing coincidence screening on each event in the event cache of the video memory, and marking coincidence information of the event according to a coincidence screening result;
and step S3, copying the event which is matched with the screening in the event cache of the video memory into the event cache of the memory, browsing the event cache in the memory, and storing the matched event according to the matched information.
The method for screening the PET coincidence events based on the CUDA is related to the embodiment one, wherein the coincidence information comprises whether the PET coincidence events are pairing events and index numbers of pairing object events;
whether it is a pairing event means whether the event is paired with another of the events to constitute the coincident event;
the index number of the counterpart event indicates the index number of the event that constitutes a coincidence event with the event.
As a method for screening PET coincidence events based on CUDA related to an embodiment, the number of original data caches and event caches in the memory is at least two;
preferably, the step S1 includes: writing the acquired data packet into an original data cache of the memory, writing the next received data packet into a next original data cache of the memory after the original data cache of the memory is full, and copying the original data in the full original data cache of the memory into the video memory;
preferably, in the step S3, the event that is matched with the screening in the event cache of the video memory is copied to an event cache of the memory, and then the event cache of the memory is traversed, and the matched event is stored according to the matching information, so as to obtain matched event information.
Preferably, the number of the original data cache and the event cache in the memory is not less than three;
preferably, the original data cache and the event cache in the memory are respectively provided with numbers; the data packets collected in step S1 are sequentially written into the original data caches of the respective memories according to the serial number sequence of the original data caches of the memories; the events meeting the screening in step S3 are sequentially copied to the event caches of the respective memories according to the serial number sequence of the event caches of the memories;
preferably, the original data cache and the event cache in the memory are respectively provided with a flag bit, the flag bit of the original data cache indicates that the final state of the data transmission direction in the original data cache is writing or reading, and the flag bit of the event cache indicates whether the process of saving the corresponding event through browsing is finished or not; in step S1, the collected data packets are sequentially and randomly written into any original data cache of the memory whose flag bits are read; the events that have been subjected to the screening in step S3 are sequentially and randomly copied to any event cache of the memory whose flag bits are complete.
Preferably, the number of the original data cache and the event cache in the video memory is one;
preferably, in the step S2, the event generated by parsing is written into a single event cache of the video memory, a coincidence screening is performed on each event in the single event cache of the video memory, and a result is written in the coincidence information of each event; after all the events in the single event cache of the video memory are processed, copying the events in the single event cache of the video memory to the event cache of the memory.
Preferably, before the step S1, the method further includes: defining an event object, comprising: time information, energy information, and location information;
in step S2, the event is subjected to coincidence screening according to the time information, the energy information, and the location information of the event.
Preferably, the process of performing coincidence screening on each event in step S2 includes:
step S201, calculating energy information of each event, and sequencing the events according to time;
step S202, carrying out position and time coincidence judgment on the ith event and the jth event, and carrying out energy screening on two paired events with coincident positions and time according to the energy information of the events; when any energy screening of two paired events with coincident positions and time is not coincident, position and time coincidence judgment is carried out on the ith event and the jth event after i and j are re-determined; when the energy screening of two pairing events with both coincident positions and time are coincident, marking the coincident information of the two pairing events;
i and j are positive integers;
preferably, the step S202 includes:
step S20201, judge whether the position and time of the ith and jth said incident accord with, no, carry out step S20202, yes, carry out step S20203;
step S20207 after step S20202, i ═ j, j ═ j + 1;
step S20203, sequentially judging whether the ith event and the jth event accord with energy screening, and executing step S20204 when the ith event and the jth event both accord with energy screening; when the ith event does not accord with the energy screening, executing step S20205; when the jth event does not accord with the energy screening, executing step S20206;
step S20204, marking the ith and jth events as pairing events, marking the index numbers of the pairing object events, and executing step S20207 after i ═ j +1 and j ═ j + 1;
step S20207 after step S20205, i +1, j + 1;
step S20207 is executed after step S20206, j + 1;
step S20207, determining whether all the events have completed the position and time coincidence determination, yes, end, no, executing step S20201.
Preferably, the process of performing coincidence screening on each event in step S2 includes:
step S201', calculating energy information of each event, and sequencing the events according to time;
step S202', sequentially judging the position coincidence and the time coincidence of each event, and marking the coincidence information of the paired events;
step S203', energy screening is carried out on the events in sequence according to the energy information of the events, and the paired events which are not matched with the energy screening and are paired with the energy screening are discarded;
preferably, the step S202' includes:
step S20201', judging whether the position and time of the i' th event are consistent with those of the i '+1 event, if not, executing step S20202'; yes, go to step S20203';
i' is a positive integer;
after step S20202', i ' +1, step S20204' is executed;
step S20203', marking the i ' th event and the i ' +1 th event as pairing events and marking the index numbers of the pairing object events; after i '+2, step S20204';
step S20204' determines whether all the events have been subjected to the position and time coincidence determination, if yes, step S204' is executed, and if not, step S20201' is executed.
Preferably, the process of performing coincidence screening on each event in step S2 includes:
step S201' setting time periods, and setting the time periods of the events according to the time of the events, wherein the range of each time period is not larger than the range of a time window with the time conforming to the screening;
step S202' of judging the position coincidence of the events in one time period and marking the coincidence information of the events with the coincident position;
step S203", calculating the energy information of each event, sequentially performing energy screening on the events according to the energy information of the events, and discarding the events which are not in accordance with the energy screening and the paired events matched with the events;
preferably, the step S202 ″ includes:
step S20201", judge whether the position of the i" th said event and the i "+1 said event is in line, no, carry out step S20202"; yes, go to step S20203 ";
i' is a positive integer;
after step S20202 ", i" + 1", step S20204" is performed;
step S20203", marking the i" th and i "+1 th events as pairing events, and marking the index numbers of the pairing object events; after i "+2, step S20204";
step S20204 "determines whether or not all the events have completed the position coincidence determination, if yes, step S203" is executed, and if no, step S20201 "is executed.
In the step S202, the step S202' and the step S202 ″, the position coincidence determination is performed on the event according to the IP address of the event;
in the step S202 and the step S202', time coincidence determination is performed on the event according to whether the time of the event is within a time window;
preferably, in step S202 and step S202', the selection of the range of the time window is set to perform real coincidence event screening or random coincidence event screening.
The invention also provides a system for screening the PET coincidence events based on the CUDA, which comprises a memory and a video memory, wherein the memory comprises at least one first original data cache and at least one first event cache, and the video memory comprises at least one second original data cache and at least one second event cache;
after the first original data cache receives a data packet sent by a detector, copying original data into the second original data cache;
the second original data cache analyzes original data to generate each event, and the generated events are copied to the second event cache;
the second event cache performs coincidence screening on each event, marks coincidence information of the events according to a coincidence screening result, and copies the events to the first event cache after the coincidence screening of all the events is completed;
and the first event cache stores the coincidence events according to the coincidence information.
As a second system for screening PET coincidence events based on CUDA provided in the second embodiment of the present invention, the number of the first original data cache and the first event cache is at least two, and the number of the second original data cache and the second event cache is one;
when the data packet sent by the detector is received, after one first original data cache is fully written, the next received data packet is written into the next first original data cache, and the fully written original data in the first original data cache is copied into the second original data cache;
and after the second event cache finishes screening the coincidence of all the events, copying the events to the first event cache.
Preferably, the memory further comprises a raw data storage judging module and an event storage judging module;
preferably, each of the first original data cache and the first event cache respectively includes a number recording unit, and the number recording unit records a number of the corresponding first original data cache or the corresponding first event cache;
when the memory receives the data packets sent by the detector, the original data storage judging module sequentially writes the acquired data packets into the first original data caches according to the sequence of the numbers recorded by the number recording unit of each first original data cache;
when the second event cache copies the data which meets the screening to the first event cache, the event storage judging unit sequentially copies the events to each first event cache according to the sequence of the serial numbers recorded by the serial number recording unit of each first event cache;
preferably, each of the first original data cache and the first event cache respectively includes a data flag unit, the data flag unit of the first original data cache records that the last state of the data transmission direction of the first original data cache is writing or reading, and the data flag unit of the first event cache records whether the first event cache completes the process of saving the coincidence event through browsing;
the original data storage judging module randomly writes the acquired data packet into any one of the first original data caches recorded as read-out by the data marking unit;
the event storage judging unit randomly copies the event to any first event cache recorded as completed by the data marking unit.
The invention also provides a device for screening PET coincidence events based on CUDA, which comprises:
a processor;
a memory for storing a plurality of instructions adapted to be loaded by the processor and to perform a method of CUDA-based PET coincidence event screening as previously described.
The method, the system and the device for screening the PET coincidence events based on the CUDA have the advantages that:
according to the method for screening the PET coincidence events based on the CUDA, provided by the embodiment of the invention, according to the structure that the CUDA uses a GPU to carry out general parallel computation, the method is specially designed for intensive and highly parallel computation, and has the characteristic of stronger capacity in the aspect of floating point operation, original data cache and event cache spaces are respectively arranged in a memory and a video memory to respectively store original data and events, the memory copies the original data into the video memory after acquiring the original data, the events are coincided and screened in the video memory, and then the screened events are stored into the memory, so that the storage space of the CPU and the computing capacity of the GPU are fully and reasonably utilized, the requirement that the time data rate sent by a detector is high (generally about 1-3 Gbps) in the implementation process of PET engineering and the performance requirement of software screening coincidence events is higher is met; in the whole screening process, the cache space is applied earlier, only a data copying process exists between the video memory and the memory, only the processes of the initial data writing and the final data acquisition exist the memory allocation and release processes, and the whole system is high in operation efficiency and speed.
The software is adopted to screen the PET coincidence events, the calculation rate and accuracy are high, the hardware maintenance cost is low, the threshold data which is subjected to coincidence screening calculation can be adjusted according to requirements or different test conditions, and feedback optimization can be performed according to the result in a specific test process.
According to the method for screening the PET coincidence events based on the CUDA, the memory applies for a plurality of original data caches and a plurality of event caches, the video memory applies for a single original data cache and a single event cache, the original data cache of the video memory carries out coincidence screening on the original data in one original data cache of the memory at a time, the size of the original data cache of one memory can be set according to the computing capacity of the video memory, and the computing capacity of the video memory is utilized more reasonably, fully and efficiently; and the copying process of the data between each original data cache and the event cache can be carried out simultaneously, so that the time consumed by each copying process is greatly reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart of a method for screening PET coincidence events based on CUDA according to an embodiment of the present invention;
FIG. 2 is a flow chart of a first embodiment of a method for screening software-based coincidence events provided by the present invention;
FIG. 3 is a flow chart of a second embodiment of a method for screening software-based coincidence events according to the present invention;
FIG. 4 is a flow chart of a third embodiment of a method for screening software-based coincidence events according to the present invention;
fig. 5 is a schematic structural diagram of a system for screening PET coincidence events based on CUDA according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
In the method for screening PET coincidence events based on CUDA of the present invention, coincidence events are screened by a memory and a video memory, wherein the memory and the video memory respectively include an original data cache and an event cache, as shown in fig. 1, a flowchart of the method for screening PET coincidence events provided by the present invention is shown in fig. 1, and as can be seen from fig. 1, the method includes the following steps:
step S1, writing the data packet sent by the acquisition detector into the original data cache of the memory, and copying the original data in the original data cache of the memory into the original data cache of the video memory.
The cache space is applied earlier, the memory allocation and release exist only in the process of writing data into the memory, and the process of copying the data from the memory to the video memory only exists, so that the data processing speed is increased.
And step S2, analyzing the original data in the original data cache of the video memory to generate each event, writing the generated event into the event cache of the video memory, performing coincidence screening on each event in the event cache of the video memory, and marking coincidence information of the event according to the coincidence screening result. Further, the matching information includes whether the matching event is a matching event and an index number of the matching object event, whether the matching event indicates whether the event is matched with another event to form a matching event, that is, the matching event indicates two matching events which are matched with each other; the index number of the counterpart event indicates the index number of the event that constitutes a coincidence event with the event.
The PET coincidence events are screened by adopting software in the video memory, the calculation rate and accuracy are high, the hardware maintenance cost is low, the threshold data for coincidence screening calculation can be adjusted according to requirements or different test conditions, and feedback optimization can be performed according to results in a specific test process.
And step S3, copying the screened event in the event cache of the video memory to the event cache of the memory, browsing the event cache in the memory, and storing the screened event according to the coincidence information.
The distribution and release of the memory exist only in the last data acquisition process, and the process of copying the data from the processed data of the video memory to the memory exists only, so that the data processing speed is accelerated.
The method for screening the PET coincidence events based on the CUDA provided by the embodiment of the invention is designed for intensive and highly parallelized calculation according to the framework of general parallel calculation carried out by the GPU used for the CUDA and has the characteristic of stronger capability in the aspect of floating point operation, the original data cache and the event cache space are respectively arranged in the memory and the video memory to respectively store original data and events, the memory copies the original data into the video memory after acquiring the original data, the coincidence screening is carried out on the events in the video memory, the screened events are stored into the memory, the storage space of the CPU and the calculation capability of the GPU are fully and reasonably utilized, the requirement that the time data rate sent by a detector is high (generally about 1-3 Gbps) in the realization process of PET engineering is met, the requirement that the performance requirement of software screening coincidence events is higher, and the cache space is already applied in the early stage in the whole screening process, only the process of data copying exists between the video memory and the memory, and only the process of the initial data writing and the final data acquisition exists in the process of memory allocation and release.
The software is adopted for screening the PET coincidence events, the calculation rate and accuracy are high, the hardware maintenance cost is low, the threshold data for carrying out coincidence screening calculation can be adjusted according to requirements or different test conditions, and feedback optimization can be carried out according to results in a specific test process.
Example one
In the embodiment, the number of the original data cache and the event cache in the memory is at least two, and the number of the original data cache and the event cache in the video memory is one, and specifically, the process includes:
defining an event object, comprising: time information, energy information, and location information.
Step S1, writing the data packet sent by the acquisition detector into the original data cache of the memory, and copying the original data in the original data cache of the memory into the original data cache of the video memory.
Specifically, the method for acquiring the network data packet sent by the detector by using the event loop mechanism and the single thread comprises the following steps: writing the collected data packet into an original data cache of the memory, when the original data cache of the memory is full, writing the next received data packet into the next original data cache of the memory, and copying the original data in the full original data cache of the memory into the display memory.
In one method, the writing sequence of the data of each original data cache of the memory can be determined by setting a number for the original data cache of the memory.
And sequentially writing the acquired data packets into the original data caches of the memories according to the number sequence of the original data caches of the memories, namely writing the next received data packet into the original data cache with the number of n +1 in the memory after the original data cache with the number of n in the memory is fully written.
In another method, the writing sequence of the data of each original data cache of the memory can be determined by the original data cache flag bit in the memory.
The flag bit of the original data cache of the memory indicates that the final state of the data transmission direction in the original data cache of the memory is writing or reading, when data is written in the original data cache of the memory, the flag bit is changed into writing, and when data is read out from the original data cache of the memory, the flag bit is changed into reading.
And sequentially and randomly writing the acquired data packets into any original data cache of the memory with the read flag bits. When the flag bit of the original data cache of the memory is read, the process of the last data transmission of the original data cache of the memory is to copy the original data into the original data cache of the display memory, and at this time, the data packet sent by the acquisition detector can be written into the original data cache of which any flag bit is read.
And step S2, analyzing the original data in the original data cache of the video memory to generate each event, writing the generated event into the event cache of the video memory, performing coincidence screening on each event in the event cache of the video memory, and marking coincidence information of the event according to the coincidence screening result.
Specifically, the original data is analyzed in a single original data cache of the video memory, the energy is calculated at the same time, and the event generated by the analysis is written into the single event cache of the video memory.
In a single event cache in the video memory, event coincidence screening is carried out according to the time information, the energy information and the position information of the event, and a screening result is written in the coincidence information of each event. The coincidence information comprises whether the event is a pairing event and an index number of the pairing object event, whether the event is the pairing event represents whether the event is paired with another event to form the coincidence event, namely the coincidence event represents two paired events which are paired with each other; the index number of the counterpart event indicates the index number of the event that constitutes a coincidence event with the event.
After all events in the single event cache of the video memory are processed, the events in the single event cache of the video memory are copied to one event cache of the memory.
Step S3, copying the screened event in the event cache of the video memory to an event cache of the memory, then browsing the event cache of the memory, and storing the screened event according to the matching information.
In one method, the writing sequence of the data of each event cache of the memory may be determined by setting a number to the event cache of the memory.
And the events which are matched with the screening are sequentially copied into each event cache of the memory according to the serial number sequence of the event cache of the memory, namely, after the event cache with the serial number of n in the memory is fully written, the next received events which are matched with the screening are copied into the event cache with the serial number of n +1 in the memory.
In another method, the writing order of the data of each event cache of the memory may be determined by the event cache flag bit in the memory.
The flag bit of the event cache of the memory indicates whether the process of saving the conforming event through browsing is finished or not, when the process of saving the conforming event through browsing is finished, the flag bit of the event cache of the memory is modified to be finished, and when data copy enters the event cache of the memory, the flag bit of the event cache of the memory is modified to be unfinished.
And the events which are matched with the screening are sequentially and randomly copied into any event cache of the memory with the flag bit being finished. When the flag bit of the event cache of the memory is finished, the process that the event stored in the event cache of the memory finishes browsing and storing the conforming event is indicated, and at the moment, the event which finishes conforming and screening in the event cache of the video memory can be copied to the event cache of the memory of which any flag bit is finished.
According to the method for screening the PET coincidence events based on the CUDA, the memory applies for a plurality of original data caches and a plurality of event caches, the video memory applies for a single original data cache and a single event cache, the original data cache of the video memory carries out coincidence screening on the original data in one original data cache of the memory at a time, the size of the original data cache of one memory can be set according to the computing capacity of the video memory, and the computing capacity of the video memory is utilized more reasonably, fully and efficiently; and the copying process of the data between each original data cache and the event cache can be carried out simultaneously, so that the time consumed by each copying process is greatly reduced.
The invention provides a method, a system and a device for screening a PET coincidence event based on CUDA (compute unified device architecture). The PET is an all-digital PET, a detector of the all-digital PET comprises crystal strips and silicon photomultipliers which are coupled one by one, the number of each crystal strip corresponds to the position information of the crystal strip, the IP (Internet protocol) address of the detector corresponding to each crystal strip can represent the detector to acquire the position information of an event object, and the whole system can acquire the position information of a signal received by the detector more accurately and rapidly. The all-digital PET further comprises a global clock system based on a high-precision clock reference source, and the event object contains time information comprising a coarse time and eight fine times according to a clock signal generated by a pulse signal. The coarse time is determined by the pulse signal with the larger period, and the fine time is determined by the pulse signal with the smaller period based on the time of eight sampling points of the MVT sampling method.
Example two
The second embodiment of the present invention is the first embodiment of the screening method for software-based coincidence events provided by the present invention, and as shown in fig. 2, is a flowchart of the first embodiment of the screening method for software-based coincidence events provided by the present invention, and as can be seen from fig. 2, the embodiment of the present invention includes:
step S201, calculating energy information of each event, and sorting the events according to time.
According to the screening method of the coincidence events based on the software, provided by the invention, the time information of the events comprises the coarse time (4 bytes) and the eight fine times (2 bytes), the storage size of the time information is greatly reduced, and before the sorting is carried out according to the time of the events, a reference time is set according to the coarse time, so that the calculation amount of the whole sorting is further reduced.
Step S202, judging the coincidence of the position and the time of the ith event and the jth event, and screening the energy of two paired events with coincident positions and time according to the energy information of the events; when any energy screening of two paired events with coincident positions and time is not coincident, position and time coincidence judgment is carried out on the ith event and the jth event after i and j are re-determined; and marking the coincidence information of the two pairing events when the energy screens of the two pairing events with coincident positions and time are coincident.
i and j are positive integers, and j has an initial value greater than 1. Preferably, i has an initial value of 1 and j has an initial value of 2.
And judging whether the event accords with the energy screening, namely judging whether the energy information of the event is in the range of the energy window.
And the position coincidence judgment is carried out on the event according to the IP address of the event, the IP of the detector represents the position of the corresponding crystal strip, the range of the effective detection area is smaller than that of the detector ring, and for a detector of a certain IP, the event can be matched by a detector which is not separated from the detector by a certain value. In the present embodiment of the invention, the PET includes two rings for a total of 176 detectors, and the positions of two events having an IP interval greater than 20 are coincident, as calculated from the extent of the active area and the size of the detector ring.
According to the method, the time coincidence judgment is carried out on the event according to whether the time of the event is in a time window, due to the fact that the paths reaching the detectors are different due to the characteristics of physical attenuation and the like of photons, the time reaching the two detectors is also different, whether the time of the two events is matched or not is judged, namely whether the two events are in the time window or not is judged, and the real coincidence event screening or the random coincidence event screening can be selected according to the range of the set time window.
Preferably, step S202 includes:
step S20201, determine whether the position and time of the ith and jth events match, no, execute step S20202, yes, execute step S20203.
In the specific operation, the coincidence of the position or time of the ith event and the jth event can be selected at will, for example, the coincidence of the position is performed first, and the operation of judging coincidence of time may not be performed when the position coincidence judgment is not coincident.
Step S20207 is executed after step S20202, i equals j, and j equals j + 1.
When the position and time of the ith event and the jth event are judged to be inconsistent, the ith event with a smaller sequence number is abandoned, and the jth event with a larger sequence number is taken as a starting point to judge the coincidence of the jth event and the next event.
Step S20203, sequentially judging whether the ith event and the jth event accord with energy screening, and executing step S20204 when the ith event and the jth event both accord with the energy screening; when the ith event does not accord with the energy screening, executing step S20205; when the jth event does not meet the energy screening, step S20206 is performed.
And when the ith event and the jth event are judged to be not in accordance with the energy screening, judging whether the jth event is in accordance with the energy screening.
In step S20204, after the i-th and j-th events are marked as pairing events and the index numbers of the pairing object events are marked, step S20207 is executed after i +1 and j + 1.
The index number of the paired object event may be marked only for any one of the ith and jth events, or may be marked for both the ith and jth events to index each other. And after judging that the ith event and the jth event are coincident events, taking the jth +1 event as a starting point, and judging that the jth +1 event is coincident with the next event.
Step S20207 is executed after step S20205, i +1 and j + 1.
And when judging that the ith event does not accord with the energy screening, taking the (i + 1) th event as a starting point, and judging the coincidence between the (i + 1) th event and the next event.
Step S20207 is executed after j +1 is reached in step S20206.
And when judging that the jth event does not accord with the energy screening, namely whether the ith event is taken as a starting point or not, carrying out coincidence judgment on the (i + 1) th event and the next event of the jth event.
In step S20202, step S20205, and step S20206, the event determined to be inconsistent may be marked, in the embodiment provided by the present invention, the event is marked as inconsistent by default in the initialization process, and therefore is not marked again; or the event marked as the pairing event can be searched in the subsequent browsing process without making the non-conformity mark.
Step S20207, determining whether all the events have completed the position and time coincidence determination, yes, end, no, step S20201 is executed.
And when all the events are matched with each other in position and time, the whole matching judgment process is completed, and the whole process is finished. When the position and time do not match any event, step S20201 is executed again, and the match determination of the position and time is restarted by using the newly obtained i and j.
In the embodiment of the invention, the information of each energy is calculated before the position and time coincidence screening, the calculation capability of each time interval of the memory is fully utilized, the time consumed by the subsequent coincidence screening is reduced, and the process of the whole coincidence screening method is accelerated.
The coincidence screening is sequentially performed according to the sequence after the time information of each event is sequenced, the event pairing times are greatly reduced on the premise that the number of finally obtained coincidence events is ensured, and the data calculation amount is greatly reduced. Judging whether the energy screening of the events is in accordance with the energy screening of the events immediately after the positions and the time of the two events are in accordance with each other, only discarding the event which is not in accordance with the energy screening, and then performing the coincidence judgment on the event which is not in accordance with the position and the time of the event with the energy screening and the subsequent events, so that the event loss is reduced, and the finally obtained data volume of the paired events is ensured.
Aiming at the full-digital PET, the screening of the coincidence events based on software is realized, the screening threshold value can be flexibly set according to the requirement or feedback, and the range selection of a time window can be adjusted to carry out real coincidence screening or random coincidence screening. The data based on screening is intuitive and available, and the calculation process is simple.
EXAMPLE III
The third embodiment of the present invention is a second embodiment of the screening method for software-based coincidence events provided by the present invention, and as shown in fig. 3, is a flowchart of the second embodiment of the screening method for software-based coincidence events provided by the present invention, as can be seen from fig. 3, the embodiment of the present invention includes:
step S201', energy information of each event is calculated, and the events are sorted according to time.
And step S202', sequentially judging the position coincidence and the time coincidence of each event, and marking the coincidence information of the paired events.
And the position coincidence judgment is carried out on the event according to the IP address of the event, the IP of the detector represents the position of the corresponding crystal strip, the range of the effective detection area is smaller than that of the detector ring, and for a detector of a certain IP, the event can be matched by a detector which is not separated from the detector by a certain value. In the present embodiment of the invention, the PET includes two rings for a total of 176 detectors, and the positions of two events having an IP interval greater than 20 are coincident, as calculated from the extent of the active area and the size of the detector ring.
According to the method, the time coincidence judgment is carried out on the event according to whether the time of the event is in a time window, due to the fact that the paths reaching the detectors are different due to the characteristics of physical attenuation and the like of photons, the time reaching the two detectors is also different, whether the time of the two events is matched or not is judged, namely whether the two events are in the time window or not is judged, and the real coincidence event screening or the random coincidence event screening can be selected according to the range of the set time window.
Preferably, step S202' includes:
step S20201', judging whether the position and time of the i' th event are consistent with those of the i '+1 event, if not, executing step S20202'; yes, step S20203' is performed.
i 'is a positive integer, preferably, i' has an initial value of 1.
In the specific operation, the position or time coincidence of the i 'th event and the i' +1 th event can be selected arbitrarily, for example, the position coincidence is performed first, and the time coincidence determination operation may not be performed when the position coincidence determination is not coincident.
After step S20202', i ' +1, step S20204' is executed.
When the position and time of the i ' th event and the i ' +1 th event are judged to be not in accordance, the i ' th event with the smaller sequence number is abandoned, and the i ' +1 th event with the larger sequence number is taken as a starting point to judge the coincidence of the i ' +1 th event and the next event.
Step S20203', marking the i ' th event and the i ' +1 th event as pairing events and marking the index numbers of the pairing object events; after i '+2, step S20204' is executed.
The index number of the event to be paired may be marked only for any of the i 'th and i' +1 th events, or may be marked for the i 'th and i' +1 th events at the same time. After the i 'th event and the i' +1 th event are judged to be coincident events, namely the i '+2 th event is taken as a starting point, and the coincidence judgment is carried out on the i' +2 th event and the next event.
Step S20204' determines whether all the events have been subjected to the position and time coincidence determination, if yes, step S203' is executed, and if not, step S20201' is executed.
When any event does not satisfy the position and time, step S20201 'is executed again, and the coincidence determination of the position and time is restarted using the newly obtained i'.
And step S203', sequentially performing energy screening on the events according to the energy information of the events, and discarding the events which are not in accordance with the energy screening and the paired events matched with the events.
Judging whether the event is in accordance with the energy screening, namely judging whether the energy information of the event is in the range of an energy window, and when judging that any one event is not in accordance with the energy screening, discarding the event corresponding to the index number of the event to be paired, namely when judging that the energy is not in accordance, discarding two paired events in pair, and finally obtaining the coincidence event which is mutually indexed.
In the embodiment, the information of each energy is calculated before the position and time coincidence screening, the calculation capability of each time period of the memory is fully utilized, the time consumed by subsequent coincidence screening is reduced, and the process of the whole coincidence screening method is accelerated.
The coincidence screening is sequentially performed according to the sequence after the time information of each event is sequenced, the event pairing times are greatly reduced on the premise that the number of finally obtained coincidence events is ensured, and the data calculation amount is greatly reduced.
And judging whether the positions and the time of the two events are in accordance with each other to form a pairing event, judging whether the energy screening of the two events in the pairing event is in accordance with each other, and giving up the two events contained in the pairing event when judging that any one event in the pairing event is not in accordance with the energy screening, so that the steps required by the whole event pairing process are reduced, and the processing time is shortened.
Example four
The fourth embodiment of the present invention is a third embodiment of the screening method for software-based coincidence events provided by the present invention, and as shown in fig. 4, is a flowchart of the third embodiment of the screening method for software-based coincidence events provided by the present invention, as can be seen from fig. 4, the embodiment of the present invention includes:
step S201' sets time periods, and puts the events into the time periods according to the time of each event, wherein the range of each time period is not larger than the range of the time window which is matched with the screening.
The event is judged to be time-coincident according to whether the time of the event is in a time window, due to the fact that the paths reaching the detectors are different due to the characteristics of physical attenuation and the like of photons, the time reaching the two detectors is also different, whether the time of the two events is matched or not is judged, namely whether the two events are in the time window or not is judged.
And step S202' of judging the position coincidence of the events in a time period and marking coincidence information of the events with the positions.
And the position coincidence judgment is carried out on the event according to the IP address of the event, the IP of the detector represents the position of the corresponding crystal strip, the range of the effective detection area is smaller than that of the detector ring, and for a detector of a certain IP, the event can be matched by a detector which is not separated from the detector by a certain value. In the present embodiment of the invention, the PET includes two rings for a total of 176 detectors, and the positions of two events having an IP interval greater than 20 are coincident, as calculated from the extent of the active area and the size of the detector ring.
Preferably, the method for judging the position coincidence includes:
step S20201", determine whether the position of the i" th event matches the position of the i "+1 th event, no, execute step S20202"; yes, step S20203 "is performed.
i "is a positive integer, and preferably, the initial value of i" is 1.
After step S20202 ", i" + 1", step S20204" is executed.
When the position of the ith event is judged to be not in accordance with the position of the ith event, the ith event with a smaller sequence number is abandoned, and the coincidence judgment is carried out on the ith +1 event and the next event by taking the ith +1 event with a larger sequence number as a starting point.
Step S20203", marking the i 'th and i' +1 th events as pairing events, and marking the index numbers of the pairing object events; after i "+ 2", step S20204 "is performed.
The index number of the event to be paired may be marked only for any one of the i "th and i" +1 st events, or may be marked for the i "th and i" +1 st events at the same time. After the ith 'event and the ith' +1 event are judged to be coincidence events, namely the ith '+2 event is taken as a starting point, and the coincidence judgment is carried out on the ith' +2 event and the next event.
Step S20204 "determines whether or not all the events have completed the position matching determination, if yes, step S203" is executed, and if no, step S20201 "is executed.
If the position coincidence judgment is not completed in any event, step S20201 is executed again, and the position coincidence judgment is restarted with the newly obtained i ″.
And step S203', calculating the energy information of each event, sequentially performing energy screening on the events according to the energy information of the events, and discarding the events which are not in accordance with the energy screening and paired events matched with the events.
Judging whether the event accords with energy screening, namely judging whether the energy information of the event is in the range of an energy window, and when judging that any one event does not accord with the energy screening, discarding the event corresponding to the index number of the event to be paired, namely when judging that the energy screening does not accord with the event, discarding two paired events in pair, and finally obtaining the coincidence event which is mutually indexed.
In the embodiment of the invention, time periods are set, and the events are put into the time periods according to the time of the events, wherein the range of each time period is not larger than the range of the time window for time screening, so that the time screening is met between any two events of each time period. The subsequent time screening and sequencing process is not needed.
And judging whether the positions and the time of the two events are in accordance with each other to form a pairing event, judging whether the energy screening of the two events in the pairing event is in accordance with each other, and giving up the two events contained in the pairing event when judging that any one event in the pairing event is not in accordance with the energy screening, so that the steps required by the whole event pairing process are reduced, and the processing time is shortened.
And after the position and time accord with the screening, calculating the information of each energy, fully utilizing the calculation capability of each time period of the memory, reducing the time consumed by the subsequent accord with the screening, and accelerating the process of the whole accord with the screening method.
EXAMPLE five
Fifth embodiment of the present invention is a system for screening PET coincidence events based on CUDA, a schematic structural diagram of the system is shown in fig. 5, and as can be seen from fig. 5, the system includes a memory and a video memory, where the memory includes at least one first original data cache and at least one first event cache, and the video memory includes at least one second original data cache and at least one second event cache.
After the first original data cache receives the data packet sent by the detector, the original data is copied to the second original data cache.
And the second original data cache analyzes the original data to generate each event, and copies the generated event to the second event cache.
And the second event cache performs coincidence screening on each event, marks coincidence information of the events according to a coincidence screening result, and copies the events to the first event cache after the coincidence screening of all the events is completed.
The first event cache stores the coincidence events according to the coincidence information.
Further, the matching information includes whether the matching event is a matching event and an index number of the matching object event, whether the matching event indicates whether the event is matched with another event to form a matching event, that is, the matching event indicates two matching events which are matched with each other; the index number of the counterpart event indicates the index number of the event that constitutes a coincidence event with the event.
Preferably, the number of the first original data buffer and the first event buffer is at least two, and the number of the second original data buffer and the second event buffer is one.
When a data packet sent by a detector is received, after a first original data cache is fully written, the next received data packet is written into the next first original data cache, and the original data in the fully written first original data cache is copied into a second original data cache.
And after the second event cache finishes the coincidence screening of all the events, copying the events to a first event cache.
Furthermore, the memory further comprises an original data storage judging module and an event storage judging module, so as to determine the sequence of writing or copying the data packets or the events into the first original data cache or the first event cache.
Preferably, each of the first original data cache and the first event cache respectively includes a number recording unit, and the number recording unit records a number of the corresponding first original data cache or the corresponding first event cache.
When the memory receives the data packets sent by the detector, the original data storage judging module sequentially writes the acquired data packets into each first original data cache according to the sequence of the numbers recorded by the number recording unit of each first original data cache. That is, after the first original data cache numbered n is full, the next received data packet is written into the first original data cache numbered n +1 in the memory.
When the second event cache copies the data which meets the screening to the first event cache, the event storage judging unit sequentially copies the events to each first event cache according to the sequence of the serial numbers of the records of the serial number recording unit of each first event cache. That is, after the first event cache with the number n is full, the next received event which is matched with the screening is copied to the first event cache with the number n +1 in the memory.
Preferably, each of the first original data cache and the first event cache includes a data flag unit.
The data mark unit of the first original data cache records the final state of the data transmission direction of the first original data cache as writing or reading, when data is written in the first original data cache, the state recorded by the data mark unit is changed into writing, and when data is read in the original data cache of the memory, the state recorded by the data mark unit is changed into reading.
The data mark unit of the first event cache records whether the first event cache finishes the process of saving the coincidence event through browsing, when the first event cache finishes the process of saving the coincidence event through browsing, the state recorded by the data mark unit is modified to be finished, and when data copy enters the event cache of the memory, the state recorded by the data mark unit is modified to be unfinished.
And the original data storage judging module randomly writes the acquired data packet into the data mark unit and records the data packet into any read first original data cache.
The event storage judging unit randomly copies the event to any first event cache recorded as completed by the data marking unit.
The embodiment of the present application further provides a device for screening PET coincidence events based on CUDA, including: a processor and a memory. The memory is configured to store a plurality of instructions adapted to be loaded by the processor and to perform all the steps of the method for CUDA-based PET coincidence event screening, as described in detail in the above method embodiments.
In one embodiment, the processor is operable to perform the following steps:
s1, acquiring a data packet sent by a detector, writing the data packet into an original data cache of an internal memory, and copying original data in the original data cache of the internal memory into an original data cache of a video memory;
s2, analyzing the original data in the original data cache of the video memory to generate each event, writing the generated event into the event cache of the video memory, performing coincidence screening on each event in the event cache of the video memory, and marking coincidence information of the event according to a coincidence screening result;
s3, copying the event which is matched with the screening in the event cache of the video memory to the event cache of the memory, browsing the event cache in the memory, and storing the matched event according to the matched information.
The invention discloses a device for screening PET coincidence events based on CUDA, which respectively stores original data and events by respectively arranging original data cache and event cache spaces in a memory and a video memory, copies the original data to the video memory after the memory acquires the original data, the event is subjected to coincidence screening in the video memory, and then the screened event is stored in the memory, so that the storage space of a CPU and the computing capacity of a GPU are fully and reasonably utilized, the requirement that the time data rate sent by a detector is high (generally about 1-3 Gbps) in the PET engineering realization process is met, for the requirement that the performance requirement of the software screening is higher in accordance with the event, in the whole screening process, the cache space is applied at the early stage, only a data copying process exists between the video memory and the memory, and only the processes of the initial data writing and the final data acquisition exist in the memory allocation and release processes.
It will be further understood by those skilled in the art that all or part of the steps in the method for implementing the above embodiments may be implemented by relevant hardware instructed by a program, and the program may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (18)

1. A method for CUDA-based PET coincidence event screening, the method comprising:
step S1, writing a data packet sent by the acquisition detector into an original data cache of the memory, and copying original data in the original data cache of the memory into an original data cache of the video memory;
step S2, analyzing the original data in the original data cache of the video memory to generate each event, writing the generated event into the event cache of the video memory, performing coincidence screening on each event in the event cache of the video memory, and marking coincidence information of the event according to a coincidence screening result;
step S3, copying the event which is matched with the screening in the event cache of the video memory to the event cache of the memory, browsing the event cache in the memory, storing the matched event according to the matched information,
performing coincidence screening on each event in the event cache of the video memory comprises performing position and time coincidence judgment and energy screening on each event, and performing position coincidence judgment on each event comprises: and determining the IP address interval of each event according to the range of the effective detection area and the number of detectors contained in the PET, and performing position coincidence judgment on each event according to the determined IP address interval.
2. The method of claim 1, wherein the compliance information includes whether it is a pairing event and an index number of a pairing object event;
whether it is a pairing event means whether the event is paired with another of the events to constitute the coincident event;
the index number of the counterpart event indicates the index number of the event that constitutes a coincidence event with the event.
3. The method of claim 1, wherein the number of raw data caches and event caches in the memory is at least two;
the step S1 includes: writing the acquired data packet into an original data cache of the memory, writing the next received data packet into a next original data cache of the memory after the original data cache of the memory is full, and copying the original data in the full original data cache of the memory into the video memory;
in step S3, the event that matches the screening in the event cache of the video memory is copied to an event cache of the memory, and then an event cache of the memory is traversed, and the event that matches is stored according to the matching information, so as to obtain the event information that matches.
4. The method of claim 3,
the original data cache and the event cache in the memory are respectively provided with numbers; in step S1, sequentially writing the acquired data packets into each original data cache of the memory according to the serial number sequence of the original data caches of the memory; the events meeting the screening in step S3 are sequentially copied to each event cache of the memory according to the sequence of the numbers of the event caches of the memory;
the original data cache and the event cache in the memory are respectively provided with a flag bit, the flag bit of the original data cache indicates that the final state of the data transmission direction in the original data cache is writing or reading, and the flag bit of the event cache indicates whether the process of saving the corresponding event through browsing is finished or not; in step S1, the collected data packets are sequentially and randomly written into any original data cache of the memory whose flag bits are read; the events that have been subjected to the screening in step S3 are sequentially and randomly copied to any event cache of the memory whose flag bits are complete.
5. The method of claim 1, wherein the number of the original data buffer and the event buffer in the video memory is one;
the step S2 writes the events generated by parsing into a single event cache of the video memory, performs coincidence screening on each event in the single event cache of the video memory, and writes a result in the coincidence information of each event; after all the events in the single event cache of the video memory are processed, copying the events in the single event cache of the video memory to the event cache of the memory.
6. The method of claim 1, further comprising, before the step S1: defining an event object, comprising: time information, energy information, and location information;
in step S2, the event is subjected to coincidence screening according to the time information, the energy information, and the location information of the event.
7. The method according to any one of claims 1 to 6, wherein the step S2 of performing coincidence screening on each of the events comprises:
step S201, calculating energy information of each event, and sequencing the events according to time;
step S202, carrying out position and time coincidence judgment on the ith event and the jth event, and carrying out energy screening on two paired events with coincident positions and time according to the energy information of the events; when any energy screening of two paired events with coincident positions and time is not coincident, position and time coincidence judgment is carried out on the ith event and the jth event after i and j are re-determined; when the energy screening of two pairing events with both coincident positions and time are coincident, marking the coincident information of the two pairing events;
i and j are positive integers.
8. The method of claim 7, wherein the step S202 comprises:
step S20201, judge whether the position and time of the ith and jth said incident accord with, no, carry out step S20202, yes, carry out step S20203;
step S20207 after step S20202, i ═ j, j ═ j + 1;
step S20203, sequentially judging whether the ith event and the jth event accord with energy screening, and executing step S20204 when the ith event and the jth event both accord with energy screening; when the ith event does not accord with the energy screening, executing step S20205; when the jth event does not accord with the energy screening, executing step S20206;
step S20204, marking the ith and jth events as pairing events, marking the index numbers of the pairing object events, and executing step S20207 after i ═ j +1 and j ═ j + 1;
step S20207 after step S20205, i +1, j + 1;
step S20207 is executed after step S20206, j + 1;
step S20207, determining whether all the events have completed the position and time coincidence determination, yes, end, no, executing step S20201.
9. The method according to any one of claims 1 to 6, wherein the step S2 of performing coincidence screening on each of the events comprises:
step S201', calculating energy information of each event, and sequencing the events according to time;
step S202', sequentially judging the position coincidence and the time coincidence of each event, and marking the coincidence information of the paired events;
and step S203', sequentially performing energy screening on the events according to the energy information of the events, and discarding the events which are not in accordance with the energy screening and the paired events matched with the events.
10. The method of claim 9, wherein the step S202' comprises:
step S20201', judging whether the position and time of the i' th event are consistent with those of the i '+1 event, if not, executing step S20202'; yes, go to step S20203';
i' is a positive integer;
after step S20202', i ' +1, step S20204' is executed;
step S20203', marking the i ' th event and the i ' +1 th event as pairing events and marking the index numbers of the pairing object events; after i '+2, step S20204';
step S20204' determines whether all the events have been subjected to the position and time coincidence determination, if yes, step S203' is executed, and if not, step S20201' is executed.
11. The method according to any one of claims 1 to 6, wherein the step S2 of performing coincidence screening on each of the events comprises:
step S201' setting time periods, and putting the events into the time periods according to the time of the events, wherein the range of each time period is not larger than the range of a time window which is screened according to the time;
step S202' of judging the position coincidence of the events in one time period and marking the coincidence information of the events with the coincident position;
and step S203', calculating the energy information of each event, sequentially performing energy screening on the events according to the energy information of the events, and discarding the events which are not in accordance with the energy screening and paired events matched with the events.
12. The method of claim 11, wherein the step S202 "comprises:
step S20201", judge whether the position of the i" th said event and the i "+1 said event is in line, no, carry out step S20202"; yes, go to step S20203 ";
i' is a positive integer;
after step S20202 ", i" + 1", step S20204" is performed;
step S20203", marking the i" th and i "+1 th events as pairing events, and marking the index numbers of the pairing object events; after i "+2, step S20204";
step S20204 "determines whether or not all the events have completed the position coincidence determination, if yes, step S203" is executed, and if no, step S20201 "is executed.
13. The method of claim 7,
in step S202, time coincidence determination is performed on the event according to whether the time of the event is within a time window, and real coincidence event screening or random coincidence event screening is performed by setting a range of the time window.
14. The method according to claim 9, wherein in step S202', the event is subjected to time coincidence judgment according to whether the time of the event is within a time window, and real coincidence event screening or random coincidence event screening is performed by setting a range of the time window.
15. A system for PET coincidence event screening based on CUDA is characterized by comprising a memory and a video memory, wherein the memory comprises at least one first original data cache and at least one first event cache, and the video memory comprises at least one second original data cache and at least one second event cache;
after the first original data cache receives a data packet sent by a detector, copying original data into the second original data cache;
the second original data cache analyzes original data to generate each event, and the generated events are copied to the second event cache;
the second event cache performs coincidence screening on each event, marks coincidence information of the events according to a coincidence screening result, and copies the events to the first event cache after the coincidence screening of all the events is completed;
the first event cache saves the coincidence event according to the coincidence information,
wherein the second event cache performing coincidence screening on each event comprises: the second event cache performs position and time coincidence judgment and energy screening on each event, and the second event cache performs position coincidence judgment on each event in the following manner: and determining the IP address interval of each event according to the range of the effective detection area and the number of detectors contained in the PET, and performing position coincidence judgment on each event according to the determined IP address interval.
16. The system for PET coincidence event screening of claim 15 wherein the number of said first raw data cache and said first event cache is at least two, and the number of said second raw data cache and said second event cache is one;
when the data packet sent by the detector is received, after one first original data cache is fully written, the next received data packet is written into the next first original data cache, and the fully written original data in the first original data cache is copied into the second original data cache;
and after the second event cache finishes screening the coincidence of all the events, copying the events to the first event cache.
17. The system for PET coincidence event screening of claim 16, wherein the memory further comprises a raw data storage decision module and an event storage decision module;
each first original data cache and each first event cache respectively comprise a number recording unit, and the number recording unit records the number of the corresponding first original data cache or the corresponding first event cache;
when the memory receives the data packets sent by the detector, the original data storage judging module sequentially writes the acquired data packets into the first original data caches according to the sequence of the numbers recorded by the number recording unit of each first original data cache;
when the second event cache copies the data which meets the screening to the first event cache, the event storage judging module sequentially copies the events to each first event cache according to the sequence of the serial numbers recorded by the serial number recording unit of each first event cache;
each of the first original data cache and the first event cache respectively comprises a data mark unit, the data mark unit of the first original data cache records that the last state of the data transmission direction of the first original data cache is writing or reading, and the data mark unit of the first event cache records whether the first event cache finishes the process of storing the corresponding event through browsing;
the original data storage judging module randomly writes the acquired data packet into any one of the first original data caches recorded as read-out by the data marking unit;
and the event storage judging module randomly copies the event to any first event cache recorded as completion by the data marking unit.
18. An apparatus for CUDA-based PET coincidence event screening, comprising:
a processor;
a memory for storing a plurality of instructions adapted to be loaded by a processor and to perform the method of any of claims 1-14.
CN201711102890.7A 2017-11-10 2017-11-10 PET coincidence event screening method, system and device based on CUDA Active CN107908363B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711102890.7A CN107908363B (en) 2017-11-10 2017-11-10 PET coincidence event screening method, system and device based on CUDA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711102890.7A CN107908363B (en) 2017-11-10 2017-11-10 PET coincidence event screening method, system and device based on CUDA

Publications (2)

Publication Number Publication Date
CN107908363A CN107908363A (en) 2018-04-13
CN107908363B true CN107908363B (en) 2021-12-07

Family

ID=61844561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711102890.7A Active CN107908363B (en) 2017-11-10 2017-11-10 PET coincidence event screening method, system and device based on CUDA

Country Status (1)

Country Link
CN (1) CN107908363B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI688955B (en) * 2019-03-20 2020-03-21 點序科技股份有限公司 Memory apparatus and accessing method for memory thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102933150A (en) * 2011-06-08 2013-02-13 株式会社东芝 Positron emission tomography method, positron emission tomography device and nontemporary computer-readable storage medium
CN103136724A (en) * 2011-11-30 2013-06-05 北大方正集团有限公司 Screening method and device
CN103324857A (en) * 2013-06-28 2013-09-25 沈阳东软医疗系统有限公司 Method and device for coincidence event judgment
CN105868123A (en) * 2016-04-07 2016-08-17 武汉数字派特科技有限公司 Concurrent data caching structure and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102483459B (en) * 2009-09-04 2016-08-24 株式会社岛津制作所 Nuclear medicine data processing method and nuclear medicine diagnostic apparatus
CN103914852B (en) * 2014-03-14 2018-03-30 兰州交通大学 DICOM medical images kinematic nonlinearity based on CUDA adjusts window method
CN104036137B (en) * 2014-06-11 2017-03-08 沈阳东软医疗系统有限公司 A kind of method and device removing random coincidence event
US9632186B2 (en) * 2015-05-28 2017-04-25 General Electric Company Systems and methods for sub-pixel location determination

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102933150A (en) * 2011-06-08 2013-02-13 株式会社东芝 Positron emission tomography method, positron emission tomography device and nontemporary computer-readable storage medium
CN103136724A (en) * 2011-11-30 2013-06-05 北大方正集团有限公司 Screening method and device
CN103324857A (en) * 2013-06-28 2013-09-25 沈阳东软医疗系统有限公司 Method and device for coincidence event judgment
CN105868123A (en) * 2016-04-07 2016-08-17 武汉数字派特科技有限公司 Concurrent data caching structure and method

Also Published As

Publication number Publication date
CN107908363A (en) 2018-04-13

Similar Documents

Publication Publication Date Title
Hesterman et al. Maximum-likelihood estimation with a contracting-grid search algorithm
WO2015010393A1 (en) On-line energy coincidence method and system for all-digital pet system
US9646120B1 (en) Method and system for trace compaction during emulation of a circuit design
Cheng et al. Applications of artificial intelligence in nuclear medicine image generation
JP2014149308A (en) Reverse data reconstruction for optimal time sampling of count in physiological list mode nuclear medical imaging
JP2007232548A (en) Nuclear medicine diagnosis system
US20180110482A1 (en) Determining response lines for image reconstruction
CN110415311B (en) PET image reconstruction method, system, readable storage medium and apparatus
CN104224219A (en) Conforming pair judging method and equipment
CN113641612A (en) Multichannel data real-time processing equipment
EP4289361A1 (en) Pet data correction method and apparatus, computer device and pet image reconstruction method
CN107908363B (en) PET coincidence event screening method, system and device based on CUDA
CN103559391A (en) Method and device for judging random coincidence events and true coincidence events
CN103559015B (en) One is hardware based meets event determination method and device
US10330802B2 (en) Determining a pair of compliance events
CN107798214B (en) Rapid processing method and device for screening coincidence events of all-digital PET (positron emission tomography)
CN107908361B (en) Coincidence event screening method and device for all-digital PET (positron emission tomography)
CN106859686B (en) Imaging method and imaging system
CN107908362A (en) For the method and device for meeting event screening of digital PET
CN104598356B (en) A kind of event ordering method and device
Martinez et al. High-speed data acquisition and digital signal Processing system for PET imaging techniques applied to mammography
CN107928692A (en) For the method and device for meeting event screening of digital PET
CN110232032B (en) Data acquisition system and method
US20040222379A1 (en) Event counter for an imaging device
Shi et al. GPU-based real-time software coincidence processing for digital PET system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant