CN104580973A - Recording and playback method and device of virtual surgical simulation process - Google Patents
Recording and playback method and device of virtual surgical simulation process Download PDFInfo
- Publication number
- CN104580973A CN104580973A CN201410841513.5A CN201410841513A CN104580973A CN 104580973 A CN104580973 A CN 104580973A CN 201410841513 A CN201410841513 A CN 201410841513A CN 104580973 A CN104580973 A CN 104580973A
- Authority
- CN
- China
- Prior art keywords
- recording
- playback
- integer
- scene state
- fragment
- 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.)
- Granted
Links
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention provides a recording and playback method and a device of a virtual surgical simulation process. The method comprises the steps: event pre-classification: obtaining a plurality of operation signals in different surgery types, abstracting each operation signal into a response event, mapping the response events into an integer set comprising a plurality of integer identifications, and corresponding the response events to the integer identifications one to one; recording: storing an initial scene state, sequentially obtaining the operation signals of the current surgery type, inquiring and storing the integer identifications corresponding to the operation signals of the current surgery type respectively according to the obtained operation signals at the same time, and generating a recording segment according to the stored integer identifications and the initial scene state; and playback: obtaining the initial scene state, sequentially obtaining the integer identification in the recording segment according to a storage sequence, and responding and rendering according to the obtained integer identifications and the initial scene state at the same time to generate and display a new scene state.
Description
Technical field
The invention relates to a kind for the treatment of technology of virtual operation data, particularly, is about a kind of recording of virtual surgery simulation process, back method and device.
Background technology
Virtual operation utilizes medical image data, uses virtual reality technology to set up virtual environment in a computer, enable doctor carry out surgical planning, training by the information in virtual environment, and the technology of guided surgery in actual operation.Adopt virtual reality technology to carry out virtual surgical environment, medical personnel can be made to be immersed in virtual scene, perception learn various operation practical operation can be felt by vision, hearing, touch, experience and learn how to deal with the actual conditions in clinical operation.Which save the training expense of medical worker and time, the risk making unskilled persons carry out performing the operation reduces greatly, has special meaning to the uneven in development present situation improving the efficiency of medical education and training and quality and improve medical surgery level.
Current virtual operation process method for recording mainly contains following three kinds:
(1) film recording software.
The method, before carrying out sham operated process, is first opened the film recording softwares such as CamStudio, Camtasia Studio, is recorded whole screen.
The defect that the method exists is as follows: first, this method not only complex operation is complicated, do not meet user habit, too increase the dependence of virtual surgery simulation software to third party software (screen recording software) simultaneously, substantially increase complexity and the quantities of virtual surgery simulation environmental structure.Secondly, the method needs to take larger system resource to the recording of screen, can have an impact to the simulation process of virtual operation itself, is embodied in the significantly decline of simulation frame per second, greatly compromises the pseudo-experience of operation itself.Finally, the essence of the method extracts screenshot capture with certain frame per second from frame buffer zone and carries out video code conversion and export general video format (being generally avi form).Therefore adopt the method to the recording of sham operated process, be actually the recording of all changes on whole screen in surgical procedure, therefore can record a large amount of and that virtual operation interface is irrelevant redundant information.
(2) extract image from figure API (application programming interface) frame buffer zone to record.
Virtual operation, in order to the visual immersion of the validity and user that improve scene rendering, adopts figure API (OpenGL or DirectX) to carry out the drafting of surgical scene and model usually.In order to generate dynamic, continuous print picture effect, this type of figure API has former and later two frame buffer zones to carry out online (On-Screen) display respectively and plays up from screen (Off-Screen).The method extracts consecutive image with certain frequency from frame buffer zone, or carries out Video coding and carry out file format output, or is saved in hard disk when doing playback and uses (again showing the image of preservation with certain frame per second).
The drawback that the method exists is: the usual volume of original image of extraction is comparatively large, preserves if do not add process, very big to the consumption of memory space.Reduce image space by the mode of Real Time Compression to take, can have an impact to the real-time of virtual surgery simulation, cause the reduction of simulating frame per second.Reduce space hold by the mode reducing picture quality, image quality during playback can be reduced, cause the decline of Consumer's Experience.Therefore, the method can face the choice between image quality, memory space and simulation precision three usually, cannot be optimized simultaneously.
(3) rendering state by recording every frame is recorded.
Virtual operation scene is in render process, and the object in figure API and scene exists " rendering state " that change frame by frame, generally includes transformation matrix state, model deformation state etc.The method, by preserving the rendering state of every frame in render process, records every frame picture of simulation process indirectly.During playback, by recovering the rendering state of previously having preserved frame by frame, realize the picture playback of surgical procedure.
The method Problems existing mainly contains: its space hold and time efficiency are directly proportional to the complexity of virtual operation scene.The complexity of scene is higher, and dynamic model quantity is larger, and every frame needs the rendering state of preservation more, and shared system resource is larger.Therefore, the method limitation is comparatively large, is only applicable to the relatively simple application scenario of virtual operation scene.
Summary of the invention
The main purpose of the embodiment of the present invention is to provide a kind of recording of virtual surgery simulation process, back method and device, with realize with strong points, resource occupation is few, image quality good, occupy little space, the virtual surgery simulation process of irredundant data is recorded and replay procedure.
To achieve these goals, the embodiment of the present invention provides a kind of recording, back method of virtual surgery simulation process, recording, the back method of described virtual surgery simulation process comprise: event preclassification step: obtain the multiple operation signals in different type of surgery, by abstract for operation signal described in each be a response events, and described response events is mapped to one comprise multiple integer mark set of integers in, described response events and described integer identify one_to_one corresponding; Record step: storing initial scene state, obtain the multiple described operation signal of current procedure type successively, inquire about simultaneously and store the multiple integers corresponding respectively with the multiple described operation signal of described current procedure type identifying according to the described operation signal obtained; Generate according to the multiple integer mark stored and described initial scene state and record fragment; Replay procedure: obtain described initial scene state, obtains the multiple integer marks in described recording fragment successively, carries out responding, playing up simultaneously, generate and show new scene state according to the integer mark obtained and described initial scene state by storage order.
In one embodiment, above-mentioned recording step comprises: step a: timer is recorded in initialization, arranges the recording refreshing frequency of described recording timer and records trigger instants; Described recording timer is used for recording time fragment continuous print time discrete being become regular length, and the length of described recording time fragment is the recording fixed time interval between each recording trigger instants; Step b: receive recording signal at the beginning, records according to described recording start signal; Step c: the initial scene state described in storage is in a java standard library container, and described initial scene state comprises: model state when obtaining described initial scene state and rendering state; Steps d: the operation signal obtaining current recording trigger instants;
Step e: obtain integer mark corresponding to the operation signal of described current recording trigger instants from described integer Integrated query, and store the integer obtained and be identified in described java standard library container; Step f: record trigger instants at the next one of described recording timer, return the steps d ~ step f described in execution, until when the operation signal obtained in described steps d is for recording end signal, obtain the recording corresponding described set of integers of described recording end signal terminate integer mark from described integer Integrated query, and store described recordings end integer and be identified in described java standard library container; Step g: according to the multiple integer marks stored, recording terminates integer mark and described initial scene state generates described recording fragment.
In one embodiment, the recording frame per second of above-mentioned recording step and the relation of described recording refreshing frequency are represented by following formula: m/f=1000, and wherein, m is described recording frame per second, and f is described recording refreshing frequency.
In one embodiment, when there is no described operation signal at the recording trigger instants of described recording timer, described response events is null event, and described null event and the integer in described set of integers identify 0 corresponding.
In one embodiment, above-mentioned replay procedure comprises: step h: initialization playback timer, arranges playback refreshing frequency and the playback trigger instants of described playback timer; Described playback timer is used for playback duration fragment continuous print time discrete being become regular length, and the length of described playback duration fragment is the playback fixed time interval between each described playback trigger instants; Step I: receive playback signal at the beginning, carries out playback according to described beginning playback signal; Step j: scene state pop down when playback being started is saved in default stack data structures; Step k: the initial scene state described in obtaining from described java standard library container; Step l: at the current playback trigger instants of described playback timer, obtains the integer mark be stored in described java standard library container; Step m: judge whether the integer mark obtained in described step l is record to terminate integer mark; If not, response events corresponding to the integer mark obtained and treat that responding scene condition responsive generates responding scene state, and play up described responding scene state, generate and show described new scene state, described playback timer is updated to next playback trigger instants, described is treated that responding scene state updating is described new scene state, and returns the step l described in execution; If so, obtain from described stack data structures and playback described in showing time scene state; Wherein, at first playback trigger instants of described playback timer, described responding scene state for the treatment of is described initial scene state; Wherein, in described step l, at different playback trigger instants, by the storage order of integer mark in described recording fragment, obtain the integer mark described in successively.
In one embodiment, at a wherein playback trigger instants of described playback timer, the integer obtained in described step m is designated described integer when identifying 0, described in playing up wherein a playback trigger instants corresponding treat responding scene state, generate the new scene state that described null event is corresponding.
In one embodiment, when described playback fixed time interval equals described recording fixed time interval, in described replay procedure, with the recording fragment described in the speed playback identical with described recording step; When described playback fixed time interval is less than described recording fixed time interval, in described replay procedure, with the recording fragment described in the speed playback faster than described recording step; When described playback fixed time interval is greater than described recording fixed time interval, in described replay procedure, with the recording fragment described in the speed playback being slower than described recording step.
In one embodiment, when reading n described response events at each described playback fixed time interval, in described replay procedure, described recording fragment is put soon with n speed; When reading 1/n described response events at each described playback fixed time interval, in described replay procedure, put described recording fragment slowly with n speed, wherein, n is positive integer.
The embodiment of the present invention also provides a kind of recording, playback reproducer of virtual surgery simulation process, recording, the playback reproducer of described virtual surgery simulation process comprise: event is presorted unit, for obtaining the multiple operation signals in different type of surgery, by abstract for operation signal described in each be a response events, and described response events is mapped to one comprise multiple integer mark set of integers in, described response events and described integer identify one_to_one corresponding; Recording elements, for storing initial scene state, obtain the multiple described operation signal of current procedure type successively, inquire about simultaneously and store the multiple integers corresponding respectively with the multiple described operation signal of described current procedure type identifying according to the described operation signal obtained; Generate according to the multiple integer mark stored and described initial scene state and record fragment; Playback unit, for obtaining described initial scene state, obtain the multiple integer marks in described recording fragment by storage order successively, carry out responding, playing up according to the integer mark obtained and described initial scene state simultaneously, generate and show new scene state.
In one embodiment, above-mentioned recording elements comprises: record initialization module, records timer for initialization, arranges the recording refreshing frequency of described recording timer and records trigger instants; Described recording timer is used for recording time fragment continuous print time discrete being become regular length, and the length of described recording time fragment is the recording fixed time interval between each recording trigger instants; Recording module, for receiving recording signal at the beginning, recording according to described recording start signal; Initial scene state-storage module, for storing described initial scene state in a java standard library container, described initial scene state comprises: model state when obtaining described initial scene state and rendering state; Operation signal acquisition module, for obtaining the operation signal of current recording trigger instants; Integer identifier acquisition module, for obtaining integer mark corresponding to the operation signal of described current recording trigger instants from described integer Integrated query, and stores the integer obtained and is identified in described java standard library container; Record and terminate integer identifier acquisition module, operation signal for obtaining in described integer identifier acquisition module is when recording end signal, obtain the recording corresponding described set of integers of described recording end signal terminate integer mark from described integer Integrated query, and store described recordings end integer and be identified in described java standard library container; Record fragment generation module, for generating described recording fragment according to the multiple integer marks stored, recording end integer mark and described initial scene state.
In one embodiment, the recording frame per second of above-mentioned recording elements and the relation of described recording refreshing frequency are represented by following formula: m/f=1000, and wherein, m is described recording frame per second, and f is described recording refreshing frequency.
In one embodiment, when there is no described operation signal at the recording trigger instants of described recording timer, described response events is null event, and described null event and the integer in described set of integers identify 0 corresponding.
In one embodiment, above-mentioned playback unit comprises: playback initialization module, for initialization playback timer, arranges playback refreshing frequency and the playback trigger instants of described playback timer; Described playback timer is used for playback duration fragment continuous print time discrete being become regular length, and the length of described playback duration fragment is the playback fixed time interval between each described playback trigger instants; Playback module, for receiving playback signal at the beginning, carries out playback according to described beginning playback signal; Scene state memory module during playback, scene state pop down during for playback being started is saved to default stack data structures; Initial scene state acquisition module, for the initial scene state from described java standard library container described in acquisition; Integer identifier acquisition module, for the current playback trigger instants at described playback timer, obtains the integer mark be stored in described java standard library container; Wherein, at different playback trigger instants, integer identifier acquisition module, by the storage order of integer mark in described recording fragment, obtains the integer mark described in successively; New scene state generation module, for judging whether the integer mark that described new scene state generation module obtains is record to terminate integer mark; If not, response events corresponding to the integer mark obtained and treat that responding scene condition responsive generates responding scene state, and play up described responding scene state, generate and show described new scene state, described playback timer is updated to next playback trigger instants, described is treated that responding scene state updating is described new scene state, again triggers described integer identifier acquisition module; Scene state display module when if so, then triggering playback; Wherein, at first playback trigger instants of described playback timer, described responding scene state for the treatment of is described initial scene state; Scene state display module during playback, for obtain from described stack data structures and playback described in showing time scene state.
In one embodiment, above-mentioned new scene state generation module also for: when obtain integer be designated described integer identify 0 time, play up current scene state, generate the new scene state that described null event is corresponding.
In one embodiment, when described playback fixed time interval equals described recording fixed time interval, described playback unit is to record recording fragment described in the identical speed playback of the speed of described recording fragment with described recording elements; When described playback fixed time interval is less than described recording fixed time interval, described playback unit is with the recording fragment described in the speed playback of recording described recording fragment faster than described recording elements; When described playback fixed time interval is greater than described recording fixed time interval, described playback unit is with the recording fragment described in the speed playback being slower than described recording elements and recording described recording fragment.
In one embodiment, when reading n described response events at each described playback fixed time interval, described playback unit puts described recording fragment soon with n speed; When reading 1/n described response events at each described playback fixed time interval, described playback unit puts described recording fragment slowly with n speed, and wherein, n is positive integer.
The beneficial effect of the embodiment of the present invention is, by the present invention, can realize with strong points, resource occupation is few, image quality good, occupy little space, the virtual surgery simulation process of irredundant data is recorded and replay procedure.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the recording of virtual surgery simulation process according to the embodiment of the present invention, the flow chart of back method;
Fig. 2 is the flow chart of the recording step 2 according to the embodiment of the present invention;
Fig. 3 is the flow chart of the replay procedure 3 according to the embodiment of the present invention;
Fig. 4 is the recording of virtual surgery simulation process according to the embodiment of the present invention, the structural representation of playback reproducer;
Fig. 5 is the structural representation of the recording elements 5 according to the embodiment of the present invention;
Fig. 6 is the structural representation of the playback unit 6 according to the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of recording of virtual surgery simulation process, back method and device.Below in conjunction with accompanying drawing, the present invention is described in detail.
The embodiment of the present invention provides a kind of recording, back method of virtual surgery simulation process, and as shown in Figure 1, recording, the back method of this virtual surgery simulation process comprise:
Event preclassification step 1: obtain the multiple operation signals in different type of surgery, by abstract for each operation signal be a response events, and response events is mapped to one comprise multiple integer mark set of integers in, response events and integer identify one_to_one corresponding (S1).
Record step 2: storing initial scene state, obtain multiple operation signals of current procedure type successively, inquire about simultaneously and store the multiple integers corresponding respectively with multiple operation signals of current procedure type identifying according to the operation signal obtained; Generate according to the multiple integer mark stored and initial scene state and record fragment (S2).
Replay procedure 3: obtain initial scene state, obtains the multiple integer marks recorded in fragment successively by storage order, carry out responding, playing up, generate and show new scene state (S3) according to the multiple integer mark obtained and initial scene state.
The recording of the virtual surgery simulation process of the embodiment of the present invention, back method, conventional data type identification (such as integer mark) is mapped as by abstract for the response events corresponding to the various operation signals produced in virtual surgery simulation process, to the time sequencing that each response events occurs in recording process, the integer mark corresponding to response events stores, and generates and records fragment.In replayed section, read the integer mark stored by the sequential stored, and again respond, show the new scene state corresponding to each integer mark, thus realize the playback to recording fragment.Realized recording and the playback of virtual surgery simulation process by the recording of the virtual surgery simulation process of the embodiment of the present invention, back method, the recording and the replayed section that run the virtual surgery simulation process that resource occupation is few, memory space takies less, processing speed is fast can be realized.
Below in conjunction with example, the recording of virtual surgery simulation process of the embodiment of the present invention, the process of back method are specifically described.
The simulation process of virtual operation, the virtual operation instrument model being actually operator's operation apparatus and computer simulation carries out mutual process.In actual applications, the simulation process of various dissimilar virtual operation is presented by computer.In embodiments of the present invention, be described for cardiovascular and cerebrovascular intervene operation simulation process, but the present invention is not limited to this.In cardiovascular and cerebrovascular intervene operation simulation process, operator operates the operating theater instruments such as conduit and seal wire, and the virtual operation instrument model of computer for controlling simulation, the 3D human vas presented with computer simulation and organ model carry out real-time, interactive.
Particularly, operator can be comprised to the lifting of C-arm and rotation, to the rotation of the operating theater instruments such as catheter guide wire and the operation of the multiple analog such as translation and opacifying injection, stentplacement, balloon expandable in cardiovascular and cerebrovascular intervene operation simulation process.These operations are virtual operation implementer and analogue system carries out mutual response events, and these response events correspond to corresponding operation signal respectively.The source of the operation signal in virtual surgery simulation process mainly contains the operation signal that guide wire motion catches the virtual operation instrument that the motion sensor such as inductor, C-arm operation sensor captures, and passes through the operation signal etc. for assigning instruction of such as keyboard, the input of mouse peripheral apparatus.For motion sensor, by adopting the signal value of the way access motion sensor of timing inquiry and being converted into the displacement of virtual operation instrument.For the operation signal such as keyboard, mouse, MFC (Microsoft Foundation class libraries) software frame is processed this operation signal by message maps and message queue mechanism.That is, record in all signal source spots and allly can carry out mutual operation signal in virtual surgery simulation process.
Multiple different operation signal all can be comprised in various dissimilar virtual operation, and all corresponding response events of each operation signal, and the person of sending of each operation signal is different, in the recording, back method of the virtual surgery simulation process of the embodiment of the present invention, be that what likely to occur in the simulation process by virtual operation can operation response signal abstraction be response events, and this response events is mapped to one comprises integer 0-E
maxset of integers in, use E
max+ 1 integer identifies as the integer of each response events.In addition, a kind of special event is had in all response events, this special event operator do not carry out with computer or virtual operation instrument model any mutual time occur, now operation signal can't be produced, response events corresponding to this kind of special event is called null event, and this null event and the integer in set of integers identify 0 corresponding.
In above-mentioned event preclassification step 1, the multiple operation in dissimilar virtual surgery simulation process is arranged, is mapped in the middle of a set of integers.For follow-up recording process provides unified recordable integer data format type, it is less that the type takies byte number, saves memory space.
During concrete enforcement, as shown in Figure 2, above-mentioned recording step 2 can comprise following steps:
Step 201: timer is recorded in initialization, arranges the recording refreshing frequency of this recording timer and records trigger instants (S201).When virtual operation starts, first record timer by initialization, arrange and record refreshing frequency and record trigger instants.This recording timer is used for recording time fragment continuous print time discrete being become regular length, and the length of this recording time fragment is the recording fixed time interval between each recording trigger instants.
Because recording process occurs in the render process of every frame picture, the frame per second therefore recorded is identical with simulating the frame per second played up.Recording frame per second m with the relation recording timer timing value t is: m=1000/t, and the relation recording frame per second m and recording refreshing frequency f is: m/f=1000.
In order to the visual Flow Experience of real-time and operator ensureing virtual surgery simulation process, the value recording timer timing value t is no more than 33 milliseconds usually, and namely the refreshing frequency of analog picture is at more than 30Hz.This means that all interactive simulation operations and render process must complete in t millisecond.
Step 202: receive recording signal at the beginning, carries out recording (S202) according to this recording start signal.Complete after recording the arranging of timer, receive the recording start signal that operator sends, and carry out the recording of the simulation process of virtual operation according to this recording start signal.
Step 203: storing initial scene state is in a java standard library container (S203).When receiving the recording start signal of operator, first preserve in initial scene state to java standard library container (vector) (such as: C++ java standard library container) of current time.This initial scene state mainly comprises two parts content, and Part I is model state, i.e. the position of human organ model (internal organ, blood vessel etc.) and operating theater instruments model (conduit, seal wire, balloon-stent etc.) and deformed state; Part II is rendering state, namely relevant to the real-time rendering of threedimensional model state, comprises transformation matrix of coordinates, material, texture etc.
Step 204: the operation signal (S204) obtaining current recording trigger instants.After recording process starts, recording the trigger instants of timer, from external sensor, (the receivable signal of this external sensor device had both comprised operation signal corresponding to operating theater instruments model, also the operation signal of mouse, keyboard etc. is comprised) read the different various different operation signals of operative process reading, such as: the displacement signal etc. of operating theater instruments.
Step 205: obtain integer mark corresponding to the operation signal of current recording trigger instants from integer Integrated query, and store in the java standard library container that the integer that obtains is identified in (S205).This displacement signal is converted into abstract after virtual operation response events after, from above-mentioned integer Integrated query and obtain corresponding to this response events integer mark.The mapping relations identified due to integer in response events and set of integers actual in above-mentioned event preclassification step 1 one_to_one corresponding produce, be inquire about according to this displacement signal and read corresponding integer mark in recording process, and the integer read mark is kept among above-mentioned java standard library container.
Step 206: recording the next trigger instants of timer, again obtain the operation signal in virtual surgery simulation process, inquire about and obtain this operation signal corresponding integer mark in set of integers, and this integer mark is saved in above-mentioned java standard library container (S206).
According to above-mentioned step 204 ~ step 206, recording each trigger instants of timer, obtain an operation signal in virtual surgery simulation process respectively, and while getting this operation signal, namely obtain integer mark corresponding to this operation signal from above-mentioned integer Integrated query, and to be saved in above-mentioned java standard library container.
And when the operation signal obtained in above-mentioned steps 204 is for recording end signal, obtain the recording corresponding set of integers of this recording end signal terminate integer mark from above-mentioned integer Integrated query, and store this recording and terminate integer and be identified in above-mentioned java standard library container.The same corresponding response events of this recording end signal, namely record End Event, this recording End Event and the recording in above-mentioned set of integers terminate integer and identify corresponding, and this recording terminates the end mark of integer mark as this recording process.
Step 207: according to the multiple integer marks stored, recording terminates integer mark and initial scene state generates recording fragment (S207).After the above-mentioned recording of acquisition terminates integer mark, stop recording all response events, and integer corresponding with the response events recorded in recording process for the scene state preserved when recording and start is identified to form together and records fragment and preserve, so that follow-up replayed section uses.
More than be the recording step 2 in the recording of the virtual surgery simulation process of the embodiment of the present invention, back method, by this recording step 2, stored record starts the unique scene state recording that moment, and follow-up each record the mark of the integer corresponding to operation signal of trigger instants.Visible, the space shared by the content that this recording process records is less, is also convenient to inquiry and obtains.
As shown in Figure 3, above-mentioned replay procedure 3 mainly comprises following steps:
Step 301: initialization playback timer, arranges playback refreshing frequency and the playback trigger instants (S301) of this playback timer.This playback timer is used for playback duration fragment continuous print time discrete being become regular length, and the length of playback duration fragment is the playback fixed time interval between each playback trigger instants.
Step 302: receive playback signal at the beginning, starts playback signal carry out playback (S302) according to this.After being provided with playback timer, receiving the beginning playback signal that operator sends, and start according to this playback that playback signal carries out the simulation process of virtual operation.
Step 303: scene state pop down when playback being started is saved to (S303) in default stack data structures.When the beginning playback signal sent according to operator starts playback, first scene state is now carried out pop down preservation in a data stack structure pre-set.
Step 304: obtain initial scene state (S304) from java standard library container.After the scene state starting the playback moment is carried out pop down preservation, read the initial scene state preserved in above-mentioned recording step 2, and be set to initial scene state when playback starts.
Step 305: at the current playback trigger instants of playback timer, obtains integer mark (S305) be stored in java standard library container;
Step 306: judge whether the integer mark obtained in described step 305 is record to terminate integer mark; If not, response events corresponding to the integer mark obtained and treat that responding scene condition responsive generates responding scene state, and play up described responding scene state, generate and show described new scene state, described playback timer is updated to next playback trigger instants, described is treated that responding scene state updating is described new scene state, returns the step 305 described in execution; If so, obtain from described stack data structures and playback described in showing time scene state (S306).
In actual playback process, at first trigger instants t1 of playback timer, identify according to each integer in recording step 2 order be stored in java standard library container, from the recording fragment being stored in java standard library container, read an integer mark.After reading this integer mark, judge whether this integer mark is that above-mentioned recording terminates integer mark.If this integer mark is not record to terminate integer mark, then the kind identified according to this integer responds above-mentioned initial scene state again.Particularly, be the message map mechanism triggering MFC, (in fact response function herein realizes by one section of responder to call corresponding response function.In virtual surgery simulation process, for each operation of virtual operation model, mouse or keyboard, one section of corresponding program all can be had to carry out process to this operation and to calculate.Such as, receive extraneous seal wire translation signal, will call especially for that section of program of process seal wire translation according to this signal, thus operations different to external world processes calculating targetedly) according to the type that integer identifies corresponding response events, scene state is responded.Then, scene state after response is played up again, after having played up, generate and show the new scene state of response events corresponding to integer mark being combined with reading, now, the all working of the current trigger instants t1 of this playback timer completes, and enters loitering phase, waits for the next playback trigger instants of playback timer.
At the next playback trigger instants t2 of playback timer, the scene state that playback trigger instants t1 generates is updated to the current scene state of playback trigger instants t2, and return the above-mentioned step 305 of execution, according to each integer being identified in above-mentioned recording step 2 order be stored in java standard library container, from the recording fragment of java standard library container storage, read next integer mark.After reading integer mark, perform above-mentioned steps 306, judge whether this integer mark is that above-mentioned recording terminates integer mark.If this integer mark is not record to terminate integer mark, the kind then identified according to this integer responds the new scene state generated at playback trigger instants t1, and the scene after response is played up again, generate and show the scene state in conjunction with the response events corresponding to the integer mark of playback trigger instants t2 acquisition, and waiting for the next playback trigger instants of playback timer.
After generating the new scene state being combined with the integer mark that playback trigger instants t2 obtains, at the next playback trigger instants t3 of playback timer, the scene state that playback trigger instants t2 generates is updated to the current scene state of playback trigger instants t3, and return the above-mentioned step 305 of execution, by the storage order recording integer mark in fragment, obtain the next integer mark be stored in java standard library container.After reading integer mark, perform above-mentioned steps 306, judge whether this integer mark is that above-mentioned recording terminates integer mark.If this integer mark is not record to terminate integer mark, then according to playback trigger instants t3 obtain integer mark corresponding to response events and playback trigger instants t2 generate new scene state carry out responding and playing up, thus generate and show the new scene state corresponding to playback trigger instants t3, and wait for the next playback trigger instants t4 of playback timer.So repeat above-mentioned step 305 and step 306, thus generate and show the scene state corresponding to each playback trigger instants t1 ~ tn, until at some playback trigger instants, the integer obtained in determining step 305 in above-mentioned steps 306 is designated above-mentioned recording and terminates integer mark.
When the integer obtained in above-mentioned steps 305 be designated record terminate integer mark time, obtain from above-mentioned stack data structures and showing playback time scene state.At each trigger instants of playback timer, from java standard library container, all get an integer identify row relax of going forward side by side.When obtain integer be designated above-mentioned recording terminate integer mark time, show that the playback of current recording fragment is complete, be pressed into the scene state of stack top time now obtaining playback by Pop operations from above-mentioned stack data structures and recover, hereto, the playback to above-mentioned recording fragment is completed.
Known by above-mentioned description, because the denotable data area of different types of data is different, the recording of the virtual surgery simulation process of the embodiment of the present invention, back method can according to the differences of response events quantity in the event stage of presorting, be mapped to character type, short, without multiple different data types such as symbol shaping, long shapings.This adjustment can have an impact to the size recording fragment, the data type bit wide be mapped to is less, simulation fragment takes up room less, thus realize with strong points, resource occupation is few, image quality good, occupy little space, the virtual surgery simulation process of irredundant data is recorded and replayed section.
In one embodiment, when in above-mentioned steps 305 obtain integer be designated integer identify 0 time, illustrate that the response events of current playback trigger instants is null event, namely represent and recording recording trigger instants corresponding in step 2, external sensor and MFC do not receive the operation signal of operator, therefore, do not have response events to need to process, only need again to play up whole scene.
In one embodiment, when the playback timer interval of replay procedure 3 equals the recording timer interval recording step 2, replay procedure 3 with record the speed that step 2 records the speed of this recording fragment identical and play this recording fragment.And, by arranging the timer interval different from recording step 2 in replay procedure 3, can carry out playback to be different from the speed recording frame per second: when the playback timer interval of replay procedure 3 is less than the recording timer interval recording step 2, replay procedure 3 plays this recording fragment fast with the speed recording this recording fragment faster than recording step 2; When the timer interval of replay procedure 3 is greater than the timer interval recording step 2, replay procedure 3 is recorded the speed that step 2 records this recording fragment put this recording fragment slowly to be slower than.
In another embodiment, by adjusting the event number that each timer interval reads, also can realize being different from the speed recording frame per second and playing, thus realizing fast-forward functionality.Suppose that reading 2 events at each timer interval simulates, so during playback, the display result of one frame is equivalent to two frames when recording, thus achieves the broadcasting of 2 speeds.Therefore, if each timer interval reads n event, so replay procedure 3 just achieves the fast-forward play of n speed.When reading 1/n described response events at each playback fixed time interval, in replay procedure 3, put described recording fragment slowly with n speed, wherein, above-mentioned n is positive integer.
In practical application, in recording step 2, by setting different timing values for recording timer, the recording of different frame per second can be realized.Such as, when timing value is 16 milliseconds, the video record of 60 frames/second can be realized, when timing value is 33 milliseconds, the video record of 30 frames/second can be realized.
Be below to adopt in background technology mentioned film recording software, figure API frame buffer zone sectional drawing respectively, undertaken recording by the rendering state recording every frame and the recording of virtual surgery simulation process of the embodiment of the present invention, back method, the recording process experiment of the reality of carrying out under identical environment, experimental result is as shown in following table one:
Table one
As shown in Table 1, adopt the recording of virtual surgery simulation process of the embodiment of the present invention, experimental result that back method carries out recording playing up in frame per second without any reduction.EMS memory occupation is extremely low compared to the three kinds of methods mentioned in background technology, also substantially negligible to the lifting taken of CPU.Because API frame buffer zone screenshot method and rendering state recording method all need recording result to be saved in internal memory temporarily, then transfer to hard disk, so the EMS memory occupation of these two kinds of methods is larger.As can be seen from experimental result, adopt the recording of virtual surgery simulation process of the embodiment of the present invention, recording that back method carries out virtual surgery simulation process and playback have the significant advantage that resource occupation is few, space hold is low, do not affect original analog process.
In playback, recording, the back method of the virtual surgery simulation process of the embodiment of the present invention without any loss, can carry out playback with the resolution of the speed of 60 frames/second and 1920 × 1080 in image quality.And can be arranged by playback parameter, carry out F.F. and put slowly.Playback result is identical with original analog.
In sum, by recording, the back method of the virtual surgery simulation process of the embodiment of the present invention, the simulation process recording of high-resolution, high image quality, high frame per second can have been taken with minimum system resource, record the information obtained irredundant, occupying little space, can play without the need to carrying out format conversion at once.
The embodiment of the present invention also provides a kind of recording, playback reproducer of virtual surgery simulation process, and as shown in Figure 4, recording, the playback reproducer of this virtual surgery simulation process comprise: event is presorted unit 4, recording elements 5 and playback unit 6.Below in conjunction with example, presort unit 4, recording elements 5 and playback unit 6 of event is described in detail respectively.
The simulation process of virtual operation, the virtual operation instrument model being actually operator's operation apparatus and computer simulation carries out mutual process.In actual applications, the simulation process of various dissimilar virtual operation is presented by computer.In embodiments of the present invention, be described for cardiovascular and cerebrovascular intervene operation simulation process, but the present invention is not limited to this.In cardiovascular and cerebrovascular intervene operation simulation process, operator operates the operating theater instruments such as conduit and seal wire, and the virtual operation instrument model of computer for controlling simulation, the 3D human vas presented with computer simulation and organ model carry out real-time, interactive.
Particularly, operator can be comprised to the lifting of C-arm and rotation, to the rotation of the operating theater instruments such as catheter guide wire and the operation of the multiple analog such as translation and opacifying injection, stentplacement, balloon expandable in cardiovascular and cerebrovascular intervene operation simulation process.These operations are virtual operation implementer and analogue system carries out mutual response events, and these response events correspond to corresponding operation signal respectively.The source of the operation signal in virtual surgery simulation process mainly contains the operation signal that guide wire motion catches the virtual operation instrument that the motion sensor such as inductor, C-arm operation sensor captures, and passes through the operation signal etc. for assigning instruction of such as keyboard, the input of mouse peripheral apparatus.For motion sensor, by adopting the signal value of the way access motion sensor of timing inquiry and being converted into the displacement of virtual operation instrument.For the operation signal such as keyboard, mouse, MFC (Microsoft Foundation class libraries) software frame is processed this operation signal by message maps and message queue mechanism.That is, record in all signal source spots and allly can carry out mutual operation signal in virtual surgery simulation process.
Multiple different operation signal all can be comprised in various dissimilar virtual operation, and all corresponding response events of each operation signal, and the person of sending of each operation signal is different, at recording, the playback reproducer of the virtual surgery simulation process of the embodiment of the present invention, be that what likely to occur in the simulation process by virtual operation can operation response signal abstraction be response events, and this response events is mapped to one comprises integer 0-E
maxset of integers in, use E
max+ 1 integer identifies as the integer of each response events.In addition, a kind of special event is had in all response events, this special event operator do not carry out with computer or virtual operation instrument model any mutual time occur, now operation signal can't be produced, response events corresponding to this kind of special event is called null event, and this null event and the integer in set of integers identify 0 corresponding.
Above-mentioned event presorts unit 4 for the multiple operation in dissimilar virtual surgery simulation process being arranged, and is mapped in the middle of a set of integers.For follow-up recording process provides unified recordable integer data format type, it is less that the type takies byte number, saves memory space.
During concrete enforcement, as shown in Figure 5, above-mentioned recording elements 5 mainly consists of the following components: record initialization module 51, record module 52, initially scene state-storage module 53, operation signal acquisition module 54, integer identifier acquisition module 55, recording terminate integer identifier acquisition module 56 and record fragment generation module 57.
Above-mentioned recording initialization module 51 records timer for initialization, arranges the recording refreshing frequency of this recording timer and records trigger instants.When virtual operation starts, first record timer by initialization, arrange and record refreshing frequency and record trigger instants.This recording timer is used for recording time fragment continuous print time discrete being become regular length, and the length of this recording time fragment is the recording fixed time interval between each recording trigger instants.
Because recording process occurs in the render process of every frame picture, the frame per second therefore recorded is identical with simulating the frame per second played up.Recording frame per second m with the relation recording timer timing value t is: m=1000/t, and the relation recording frame per second m and recording refreshing frequency f is: m/f=1000.
In order to the visual Flow Experience of real-time and operator ensureing virtual surgery simulation process, the value recording timer timing value t is no more than 33 milliseconds usually, and namely the refreshing frequency of analog picture is at more than 30Hz.This means that all interactive simulation operations and render process must complete in t millisecond.
Recording module 52 for receiving recording signal at the beginning, recording according to this recording start signal.Complete after recording the arranging of timer, receive the recording start signal that operator sends, and carry out the recording of the simulation process of virtual operation according to this recording start signal.
Initial scene state-storage module 53 for storing initial scene state in a java standard library container.When receiving the recording start signal of operator, first preserve in initial scene state to java standard library container (vector) (such as: C++ java standard library container) of current time.This initial scene state mainly comprises two parts content, and Part I is model state, i.e. the position of human organ model (internal organ, blood vessel etc.) and operating theater instruments model (conduit, seal wire, balloon-stent etc.) and deformed state; Part II is rendering state, namely relevant to the real-time rendering of threedimensional model state, comprises transformation matrix of coordinates, material, texture etc.
Operation signal acquisition module 54 is for obtaining the operation signal of current recording trigger instants.After recording process starts, recording the trigger instants of timer, from external sensor, (the receivable signal of this external sensor device had both comprised operation signal corresponding to operating theater instruments model, also the operation signal of mouse, keyboard etc. is comprised) read the different various different operation signals of operative process reading, such as: the displacement signal etc. of operating theater instruments.
Integer identifier acquisition module 55 for obtaining integer mark corresponding to the operation signal of current recording trigger instants from integer Integrated query, and stores in the java standard library container that the integer that obtains is identified in.This displacement signal is converted into abstract after virtual operation response events after, from above-mentioned integer Integrated query and obtain corresponding to this response events integer mark.The mapping relations identified due to integer in response events and set of integers are actual to be produced by above-mentioned event unit 4 one_to_one corresponding of presorting, be inquire about according to this displacement signal and read corresponding integer mark in recording process, and the integer read mark is kept among above-mentioned java standard library container.
Record and terminate integer identifier acquisition module 56 for the next trigger instants at recording timer, again obtain the operation signal in virtual surgery simulation process, inquire about and obtain this operation signal corresponding integer mark in set of integers, and this integer mark is saved in above-mentioned C++ java standard library container.Recording each trigger instants of timer, obtain an operation signal in virtual surgery simulation process respectively, and while getting this operation signal, namely obtain integer mark corresponding to this operation signal from above-mentioned integer Integrated query, and to be saved in above-mentioned java standard library container.
And when the operation signal that aforesaid operations signal acquisition module 54 obtains is for recording end signal, obtain the recording corresponding set of integers of this recording end signal terminate integer mark from above-mentioned integer Integrated query, and store this recording and terminate integer and be identified in above-mentioned java standard library container.The same corresponding response events of this recording end signal, namely record End Event, this recording End Event and the recording in above-mentioned set of integers terminate integer and identify corresponding, and this recording terminates the end mark of integer mark as this recording process.
Record fragment generation module 57 for generating described recording fragment according to the multiple integer marks stored, recording end integer mark and described initial scene state.After the above-mentioned recording of acquisition terminates integer mark, stop recording all response events, and integer corresponding with the response events recorded in recording process for the scene state preserved when recording and start is identified to form together and records fragment and preserve, so that follow-up replayed section uses.
More than be the recording elements 5 in the recording of the virtual surgery simulation process of the embodiment of the present invention, playback reproducer, start by this recording elements 5 stored record the unique scene state recording that moment, and follow-up each record the mark of the integer corresponding to operation signal of trigger instants.Visible, the space shared by the content that this recording process records is less, is also convenient to inquiry and obtains.
As shown in Figure 6, above-mentioned playback unit 6 mainly consists of the following components: scene state memory module 63 when playback initialization module 61, playback module 62, playback, initial scene state acquisition module 64, integer identifier acquisition module 65, new scene state generation module 66 and playback time scene state display module 67.
Above-mentioned playback initialization module 61, for initialization playback timer, arranges playback refreshing frequency and the playback trigger instants of this playback timer.This playback timer is used for playback duration fragment continuous print time discrete being become regular length, and the length of playback duration fragment is the playback fixed time interval between each playback trigger instants.
Playback module 62, for receiving playback signal at the beginning, starts playback signal carry out playback according to this.After being provided with playback timer, receiving the beginning playback signal that operator sends, and start according to this playback that playback signal carries out the simulation process of virtual operation.
Scene state pop down when scene state memory module 63 is for starting playback during playback is saved in default stack data structures.When the beginning playback signal sent according to operator starts playback, first scene state is now carried out pop down preservation in a data stack structure pre-set.
Initial scene state acquisition module 64 for obtaining initial scene state from java standard library container.After the scene state starting the playback moment is carried out pop down preservation, read the initial scene state that above-mentioned recording elements 5 is preserved, and be set to initial scene state when playback starts.
Integer identifier acquisition module 65, for by the storage order recording integer mark in fragment, at the current playback trigger instants of playback timer, obtains the integer mark be stored in java standard library container.
Whether new scene state generation module 66 is record to terminate integer mark for the integer mark judging described new scene state generation module and obtain; If not, response events corresponding to the integer mark obtained and treat that responding scene condition responsive generates responding scene state, and play up described responding scene state, generate and show described new scene state, described playback timer is updated to next playback trigger instants, described is treated that responding scene state updating is described new scene state, again triggers integer identifier acquisition module 65; Scene state display module 67 when if so, then triggering playback.Below the relation between integer identifier acquisition module 65 and new scene state generation module 66 and embody rule are elaborated.
In actual playback process, at first trigger instants t1 of playback timer, integer identifier acquisition module 65, according in recording elements 5 recording process, each integer being identified the order be stored in java standard library container, reads an integer mark from the recording fragment being stored in java standard library container.After integer identifier acquisition module 65 reads this integer mark, new scene state generation module 66 judges whether this integer mark is that above-mentioned recording terminates integer mark.If this integer mark is not record to terminate integer mark, then the kind identified according to this integer responds above-mentioned initial scene state again.Particularly, be the message map mechanism triggering MFC, (in fact response function herein realizes by one section of responder to call corresponding response function.In virtual surgery simulation process, for each operation of virtual operation model, mouse or keyboard, one section of corresponding program all can be had to carry out process to this operation and to calculate.Such as, receive extraneous seal wire translation signal, will call especially for that section of program of process seal wire translation according to this signal, thus operations different to external world processes calculating targetedly) according to the type that integer identifies corresponding response events, scene state is responded.Then, scene state after response is played up again, after having played up, generate and show the new scene state of response events corresponding to integer mark being combined with reading, now, the all working of the current trigger instants t1 of this playback timer completes, and enters loitering phase, waits for the next playback trigger instants of playback timer.
At the next playback trigger instants t2 of playback timer, the scene state that playback trigger instants t1 generates is updated to the current scene state of playback trigger instants t2 by new scene state generation module 66, and triggers above-mentioned integer identifier acquisition module 65.By this integer identifier acquisition module 65, according to above-mentioned recording elements 5, each integer is identified the order be stored in java standard library container, from the recording fragment of java standard library container storage, read next integer mark.After integer identifier acquisition module 65 reads this integer mark, new scene state generation module 66 judges whether this integer mark is that above-mentioned recording terminates integer mark.If this integer mark is not record to terminate integer mark, the kind then identified according to this integer responds the new scene state that playback trigger instants t1 generates, and the scene after response is played up again, generate and show the scene state in conjunction with the response events corresponding to the integer mark of playback trigger instants t2 acquisition, and waiting for the next playback trigger instants of playback timer.
After generating the scene state being combined with the integer mark that playback trigger instants t2 obtains, at the next playback trigger instants t3 of playback timer, the new scene state that playback trigger instants t2 generates is updated to current scene state by new scene state generation module 66, and triggers above-mentioned integer identifier acquisition module 65.By this integer identifier acquisition module 65, by the storage order recording integer mark in fragment, obtain the next integer mark be stored in java standard library container.After integer identifier acquisition module 65 reads this integer mark, new scene state generation module 66 judges whether this integer mark is that above-mentioned recording terminates integer mark.If this integer mark is not record to terminate integer mark, then according to playback trigger instants t3 obtain integer mark corresponding to response events and playback trigger instants t2 generate new scene state carry out responding and playing up, thus generate and show the new scene state corresponding to playback trigger instants t3, and wait for the next playback trigger instants t4 of playback timer, by that analogy, by above-mentioned integer identifier acquisition module 65 and new scene state generation module 66, at each playback trigger instants of playback timer, generate respectively and show the scene state corresponding to each playback trigger instants t1 ~ tn, until at some playback trigger instants, above-mentioned new scene state generation module 66 judges that the integer that integer identifier acquisition module 65 obtains is designated recording end integer mark.
When new scene state generation module 66 judges that the integer that integer identifier acquisition module 65 obtains is designated recording end integer mark, scene state display module 67 when triggering above-mentioned playback, during this playback scene state display module 67 for obtain from stack data structures and showing playback time scene state.At each trigger instants of playback timer, from java standard library container, all get an integer identify row relax of going forward side by side.When obtain integer be designated above-mentioned recording terminate integer mark time, show that the playback of current recording fragment is complete, be pressed into the scene state of stack top time now obtaining playback by Pop operations from above-mentioned stack data structures and recover, hereto, the playback to above-mentioned recording fragment is completed.
Known by above-mentioned description, because the denotable data area of different types of data is different, the recording of the virtual surgery simulation process of the embodiment of the present invention, playback reproducer can according to the differences of response events quantity in the event stage of presorting, be mapped to character type, short, without multiple different data types such as symbol shaping, long shapings.This adjustment can have an impact to the size recording fragment, the data type bit wide be mapped to is less, simulation fragment takes up room less, thus realize with strong points, resource occupation is few, image quality good, occupy little space, the virtual surgery simulation process of irredundant data is recorded and replayed section.
In one embodiment, when the integer that above-mentioned new scene state generation module 66 obtains be designated above-mentioned integer identify 0 time, illustrate that the response events of current playback trigger instants is null event, namely the recording trigger instants corresponding when recording elements 5 is recorded is represented, external sensor and MFC do not receive the operation signal of operator, therefore, do not have response events to need to process, only need again to play up whole scene.
In one embodiment, when the playback timer interval arranged in playback unit 6 equals the recording timer interval arranged in recording elements 5, playback unit 6 is to play this recording fragment with the speed that recording elements 5 records the speed of this recording fragment identical.And, by arranging the timer interval different from recording elements 5 in playback unit 6, playback can be carried out: when the playback timer interval of playback unit 6 is less than the recording timer interval of recording elements 5, playback unit 6 plays this recording fragment with the speed recording this recording fragment faster than recording elements 5 to be different from the speed recording frame per second; When the timer interval of playback unit 6 is greater than the timer interval of recording elements 5, playback unit 6 plays this recording fragment with the speed being slower than recording elements 5 and recording this recording fragment.
In another embodiment, by adjusting the event number that each timer interval reads, also can realize being different from the speed recording frame per second and playing, thus realizing fast-forward functionality.Suppose that reading 2 events at each timer interval simulates, so during playback, the display result of one frame is equivalent to two frames when recording, thus achieves the broadcasting of 2 speeds.Therefore, if each timer interval reads n event, so playback unit 6 just achieves the fast-forward play of n speed.When reading 1/n described response events at each playback fixed time interval, playback unit 6 puts described recording fragment slowly with n speed, and wherein, above-mentioned n is positive integer.
In practical application, recording elements 5, by setting different timing values for recording timer, can realize the recording of different frame per second.Such as, when timing value is 16 milliseconds, the video record of 60 frames/second can be realized, when timing value is 33 milliseconds, the video record of 30 frames/second can be realized.
One of ordinary skill in the art will appreciate that the hardware that all or part of step realized in above-described embodiment method can carry out instruction relevant by program has come, this program can be stored in a computer read/write memory medium, such as ROM/RAM, magnetic disc, CD etc.
Above-described specific embodiment; object of the present invention, technical scheme and beneficial effect are further described; be understood that; the foregoing is only specific embodiments of the invention; the protection range be not intended to limit the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (16)
1. the recording of virtual surgery simulation process, a back method, it is characterized in that, recording, the back method of described virtual surgery simulation process comprise:
Event preclassification step: obtain the multiple operation signals in different type of surgery, by abstract for operation signal described in each be a response events, and described response events is mapped to one comprise multiple integer mark set of integers in, described response events and described integer identify one_to_one corresponding;
Record step: storing initial scene state, obtain the multiple described operation signal of current procedure type successively, inquire about simultaneously and store the multiple integers corresponding respectively with the multiple described operation signal of described current procedure type identifying according to the described operation signal obtained; Generate according to the multiple integer mark stored and described initial scene state and record fragment;
Replay procedure: obtain described initial scene state, obtains the multiple integer marks in described recording fragment successively, carries out responding, playing up, generate and show new scene state according to the multiple integer marks obtained and described initial scene state by storage order.
2. the recording of virtual surgery simulation process according to claim 1, back method, it is characterized in that, described recording step comprises:
Step a: timer is recorded in initialization, arranges the recording refreshing frequency of described recording timer and records trigger instants; Described recording timer is used for recording time fragment continuous print time discrete being become regular length, and the length of described recording time fragment is the recording fixed time interval between each recording trigger instants;
Step b: receive recording signal at the beginning, records according to described recording start signal;
Step c: the initial scene state described in storage is in a java standard library container, and described initial scene state comprises: model state when obtaining described initial scene state and rendering state;
Steps d: the operation signal obtaining current recording trigger instants;
Step e: obtain integer mark corresponding to the operation signal of described current recording trigger instants from described integer Integrated query, and store the integer obtained and be identified in described java standard library container;
Step f: record trigger instants at the next one of described recording timer, return the steps d ~ step f described in execution, until when the operation signal obtained in described steps d is for recording end signal, obtain the recording corresponding described set of integers of described recording end signal terminate integer mark from described integer Integrated query, and store described recordings end integer and be identified in described java standard library container;
Step g: according to the multiple integer marks stored, recording terminates integer mark and described initial scene state generates described recording fragment.
3. the recording of virtual surgery simulation process according to claim 2, back method, it is characterized in that, the recording frame per second of described recording step and the relation of described recording refreshing frequency are represented by following formula: m/f=1000, wherein, m is described recording frame per second, and f is described recording refreshing frequency.
4. the recording of virtual surgery simulation process according to claim 2, back method, it is characterized in that, when there is no described operation signal at the recording trigger instants of described recording timer, described response events is null event, and described null event and the integer in described set of integers identify 0 corresponding.
5., according to recording, the back method of virtual surgery simulation process according to claim 4, it is characterized in that, described replay procedure comprises:
Step h: initialization playback timer, arranges playback refreshing frequency and the playback trigger instants of described playback timer; Described playback timer is used for playback duration fragment continuous print time discrete being become regular length, and the length of described playback duration fragment is the playback fixed time interval between each described playback trigger instants;
Step I: receive playback signal at the beginning, carries out playback according to described beginning playback signal;
Step j: scene state pop down when playback being started is saved in default stack data structures;
Step k: the initial scene state described in obtaining from described java standard library container;
Step l: at the current playback trigger instants of described playback timer, obtains the integer mark be stored in described java standard library container;
Step m: judge whether the integer mark obtained in described step l is record to terminate integer mark; If not, response events corresponding to the integer mark obtained and treat that responding scene condition responsive generates responding scene state, and play up described responding scene state, generate and show described new scene state, described playback timer is updated to next playback trigger instants, described is treated that responding scene state updating is described new scene state, and returns the step l described in execution; If so, obtain from described stack data structures and playback described in showing time scene state; Wherein, at first playback trigger instants of described playback timer, described responding scene state for the treatment of is described initial scene state;
Wherein, in described step l, at different playback trigger instants, by the storage order of integer mark in described recording fragment, obtain the integer mark described in successively.
6. the recording of virtual surgery simulation process according to claim 5, back method, it is characterized in that, at a wherein playback trigger instants of described playback timer, the integer obtained in described step m is designated described integer when identifying 0, described in playing up wherein a playback trigger instants corresponding treat responding scene state, generate the new scene state that described null event is corresponding.
7. the recording of virtual surgery simulation process according to claim 6, back method, is characterized in that:
When described playback fixed time interval equals described recording fixed time interval, in described replay procedure, with the recording fragment described in the speed playback identical with described recording step;
When described playback fixed time interval is less than described recording fixed time interval, in described replay procedure, with the recording fragment described in the speed playback faster than described recording step;
When described playback fixed time interval is greater than described recording fixed time interval, in described replay procedure, with the recording fragment described in the speed playback being slower than described recording step.
8. the recording of virtual surgery simulation process according to claim 6, back method, is characterized in that, when reading n described response events at each described playback fixed time interval, in described replay procedure, puts described recording fragment soon with n speed; When reading 1/n described response events at each described playback fixed time interval, in described replay procedure, put described recording fragment slowly with n speed, wherein, n is positive integer.
9. the recording of virtual surgery simulation process, a playback reproducer, it is characterized in that, recording, the playback reproducer of described virtual surgery simulation process comprise:
Event is presorted unit, for obtaining the multiple operation signals in different type of surgery, by abstract for operation signal described in each be a response events, and described response events is mapped to one comprise multiple integer mark set of integers in, described response events and described integer identify one_to_one corresponding;
Recording elements, for storing initial scene state, obtain the multiple described operation signal of current procedure type successively, inquire about simultaneously and store the multiple integers corresponding respectively with the multiple described operation signal of described current procedure type identifying according to the described operation signal obtained; Generate according to the multiple integer mark stored and described initial scene state and record fragment;
Playback unit, for obtaining described initial scene state, obtain the multiple integer marks in described recording fragment by storage order successively, carry out responding, playing up according to the multiple integer marks obtained and described initial scene state, generate and show new scene state.
10. the recording of virtual surgery simulation process according to claim 9, playback reproducer, it is characterized in that, described recording elements comprises:
Record initialization module, record timer for initialization, the recording refreshing frequency of described recording timer is set and records trigger instants; Described recording timer is used for recording time fragment continuous print time discrete being become regular length, and the length of described recording time fragment is the recording fixed time interval between each recording trigger instants;
Recording module, for receiving recording signal at the beginning, recording according to described recording start signal;
Initial scene state-storage module, for storing described initial scene state in a java standard library container, described initial scene state comprises: model state when obtaining described initial scene state and rendering state;
Operation signal acquisition module, for obtaining the operation signal of current recording trigger instants;
Integer identifier acquisition module, for obtaining integer mark corresponding to the operation signal of described current recording trigger instants from described integer Integrated query, and stores the integer obtained and is identified in described java standard library container;
Record and terminate integer identifier acquisition module, operation signal for obtaining in described integer identifier acquisition module is when recording end signal, obtain the recording corresponding described set of integers of described recording end signal terminate integer mark from described integer Integrated query, and store described recordings end integer and be identified in described java standard library container;
Record fragment generation module, for generating described recording fragment according to the multiple integer marks stored, recording end integer mark and described initial scene state.
The recording of 11. virtual surgery simulation processes according to claim 10, playback reproducer, it is characterized in that, the recording frame per second of described recording elements and the relation of described recording refreshing frequency are represented by following formula: m/f=1000, wherein, m is described recording frame per second, and f is described recording refreshing frequency.
The recording of 12. virtual surgery simulation processes according to claim 10, playback reproducer, it is characterized in that, when there is no described operation signal at the recording trigger instants of described recording timer, described response events is null event, and described null event and the integer in described set of integers identify 0 corresponding.
13. according to the recording of virtual surgery simulation process according to claim 12, playback reproducer, and it is characterized in that, described playback unit comprises:
Playback initialization module, for initialization playback timer, arranges playback refreshing frequency and the playback trigger instants of described playback timer; Described playback timer is used for playback duration fragment continuous print time discrete being become regular length, and the length of described playback duration fragment is the playback fixed time interval between each described playback trigger instants;
Playback module, for receiving playback signal at the beginning, carries out playback according to described beginning playback signal;
Scene state memory module during playback, scene state pop down during for playback being started is saved to default stack data structures;
Initial scene state acquisition module, for the initial scene state from described java standard library container described in acquisition;
Integer identifier acquisition module, for the current playback trigger instants at described playback timer, obtains the integer mark be stored in described java standard library container; Wherein, at different playback trigger instants, described integer identifier acquisition module, by the storage order of integer mark in described recording fragment, obtains the integer mark described in successively;
New scene state generation module, for judging whether the integer mark that described new scene state generation module obtains is record to terminate integer mark; If not, response events corresponding to the integer mark obtained and treat that responding scene condition responsive generates responding scene state, and play up described responding scene state, generate and show described new scene state, described playback timer is updated to next playback trigger instants, described is treated that responding scene state updating is described new scene state, again triggers described integer identifier acquisition module; Scene state display module when if so, then triggering playback; Wherein, at first playback trigger instants of described playback timer, described responding scene state for the treatment of is described initial scene state;
Scene state display module during playback, for obtain from described stack data structures and playback described in showing time scene state.
The recording of 14. virtual surgery simulation processes according to claim 13, playback reproducer, it is characterized in that, described new scene state generation module also for: when obtain integer be designated described integer identify 0 time, play up current scene state, generate the new scene state that described null event is corresponding.
The recording of 15. virtual surgery simulation processes according to claim 14, playback reproducer, is characterized in that:
When described playback fixed time interval equals described recording fixed time interval, described playback unit is to record recording fragment described in the identical speed playback of the speed of described recording fragment with described recording elements;
When described playback fixed time interval is less than described recording fixed time interval, described playback unit is with the recording fragment described in the speed playback of recording described recording fragment faster than described recording elements;
When described playback fixed time interval is greater than described recording fixed time interval, described playback unit is with the recording fragment described in the speed playback being slower than described recording elements and recording described recording fragment.
The recording of 16. virtual surgery simulation processes according to claim 14, playback reproducer, is characterized in that, when reading n described response events at each described playback fixed time interval, described playback unit puts described recording fragment soon with n speed; When reading 1/n described response events at each described playback fixed time interval, described playback unit puts described recording fragment slowly with n speed, and wherein, n is positive integer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410841513.5A CN104580973B (en) | 2014-12-30 | 2014-12-30 | A kind of recording, back method and the device of virtual surgery simulation process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410841513.5A CN104580973B (en) | 2014-12-30 | 2014-12-30 | A kind of recording, back method and the device of virtual surgery simulation process |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104580973A true CN104580973A (en) | 2015-04-29 |
CN104580973B CN104580973B (en) | 2018-03-23 |
Family
ID=53096055
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410841513.5A Active CN104580973B (en) | 2014-12-30 | 2014-12-30 | A kind of recording, back method and the device of virtual surgery simulation process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104580973B (en) |
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105825752A (en) * | 2016-04-22 | 2016-08-03 | 吉林大学 | Force feedback device-based virtual corneal surgery training system |
CN105933724A (en) * | 2016-05-23 | 2016-09-07 | 福建星网视易信息系统有限公司 | Video producing method, device and system |
CN105979187A (en) * | 2015-07-24 | 2016-09-28 | 乐视致新电子科技(天津)有限公司 | Data recording method and device |
CN107025165A (en) * | 2017-03-07 | 2017-08-08 | 腾讯科技(深圳)有限公司 | Game automated testing method and relevant apparatus |
CN108600668A (en) * | 2018-03-27 | 2018-09-28 | 维沃移动通信有限公司 | A kind of record screen frame per second method of adjustment and mobile terminal |
WO2018205809A1 (en) * | 2017-05-09 | 2018-11-15 | 腾讯科技(深圳)有限公司 | Virtual reality application data processing method, computer device and storage medium |
CN108922282A (en) * | 2018-08-09 | 2018-11-30 | 贵州华宁科技股份有限公司 | Multimedia simulation tutoring system |
CN109862378A (en) * | 2018-12-29 | 2019-06-07 | 广州中智达信科技有限公司 | A kind of operation record method and apparatus |
CN109907826A (en) * | 2019-04-12 | 2019-06-21 | 江西省人民医院 | Coronary artery disease Simulated therapy system based on 3D model and VR technology |
CN110265094A (en) * | 2019-06-10 | 2019-09-20 | 广东盛利医疗科技有限公司 | Operation record method, equipment and computer readable storage medium |
CN111539266A (en) * | 2020-04-02 | 2020-08-14 | 威迈(宁波)医疗科技有限公司 | Medical instrument identification device and method and blood vessel intervention training equipment |
CN112612580A (en) * | 2020-11-25 | 2021-04-06 | 北京思特奇信息技术股份有限公司 | Combined event triggering method and triggering system |
CN112881052A (en) * | 2021-01-14 | 2021-06-01 | 深圳市杉川机器人有限公司 | Method and device for constructing working scene of mobile robot |
CN113985815A (en) * | 2021-09-17 | 2022-01-28 | 上海三一重机股份有限公司 | Recording playback method, system, equipment and operation machine |
CN116017082A (en) * | 2022-12-31 | 2023-04-25 | 联想(北京)有限公司 | Information processing method and electronic equipment |
WO2023137747A1 (en) * | 2022-01-24 | 2023-07-27 | 上海莉莉丝科技股份有限公司 | Virtual scene playback method, medium, electronic device, and computer program product |
CN117936053A (en) * | 2024-03-21 | 2024-04-26 | 吉林大学第一医院 | Operation flow information management method based on digital operating room |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101520884A (en) * | 2008-02-29 | 2009-09-02 | 国际商业机器公司 | Method and system for obtaining and replaying events occurring in a virtual world |
US20100062405A1 (en) * | 2008-08-21 | 2010-03-11 | Lincoln Global, Inc. | System and method providing arc welding training in a real-time simulated virtual reality environment using real-time weld puddle feedback |
CN101739879A (en) * | 2009-12-22 | 2010-06-16 | 天津市天堰医教科技开发有限公司 | Real-time pose capture-based surgery simulation system, method and graph rendering module |
-
2014
- 2014-12-30 CN CN201410841513.5A patent/CN104580973B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101520884A (en) * | 2008-02-29 | 2009-09-02 | 国际商业机器公司 | Method and system for obtaining and replaying events occurring in a virtual world |
US20100062405A1 (en) * | 2008-08-21 | 2010-03-11 | Lincoln Global, Inc. | System and method providing arc welding training in a real-time simulated virtual reality environment using real-time weld puddle feedback |
CN101739879A (en) * | 2009-12-22 | 2010-06-16 | 天津市天堰医教科技开发有限公司 | Real-time pose capture-based surgery simulation system, method and graph rendering module |
Non-Patent Citations (2)
Title |
---|
周萌萌: "虚拟手术系统中行为引擎的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
唐忠: "医学手术仿真教学系统的设计与实现", 《桂林工学院学报》 * |
Cited By (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105979187A (en) * | 2015-07-24 | 2016-09-28 | 乐视致新电子科技(天津)有限公司 | Data recording method and device |
CN105825752A (en) * | 2016-04-22 | 2016-08-03 | 吉林大学 | Force feedback device-based virtual corneal surgery training system |
CN105933724A (en) * | 2016-05-23 | 2016-09-07 | 福建星网视易信息系统有限公司 | Video producing method, device and system |
CN107025165A (en) * | 2017-03-07 | 2017-08-08 | 腾讯科技(深圳)有限公司 | Game automated testing method and relevant apparatus |
CN108874267A (en) * | 2017-05-09 | 2018-11-23 | 腾讯科技(深圳)有限公司 | Virtual reality applications data processing method, computer equipment and storage medium |
WO2018205809A1 (en) * | 2017-05-09 | 2018-11-15 | 腾讯科技(深圳)有限公司 | Virtual reality application data processing method, computer device and storage medium |
CN108874267B (en) * | 2017-05-09 | 2022-12-09 | 腾讯科技(深圳)有限公司 | Virtual reality application data processing method, computer device and storage medium |
US11307891B2 (en) * | 2017-05-09 | 2022-04-19 | Tencent Technology (Shenzhen) Company Ltd | Virtual reality application data processing method, computer device and storage medium |
CN108600668A (en) * | 2018-03-27 | 2018-09-28 | 维沃移动通信有限公司 | A kind of record screen frame per second method of adjustment and mobile terminal |
CN108922282A (en) * | 2018-08-09 | 2018-11-30 | 贵州华宁科技股份有限公司 | Multimedia simulation tutoring system |
CN108922282B (en) * | 2018-08-09 | 2021-05-07 | 贵州华宁科技股份有限公司 | Multimedia simulation teaching system |
CN109862378B (en) * | 2018-12-29 | 2021-05-18 | 广州中智达信科技有限公司 | Operation recording method |
CN109862378A (en) * | 2018-12-29 | 2019-06-07 | 广州中智达信科技有限公司 | A kind of operation record method and apparatus |
CN109907826A (en) * | 2019-04-12 | 2019-06-21 | 江西省人民医院 | Coronary artery disease Simulated therapy system based on 3D model and VR technology |
CN110265094A (en) * | 2019-06-10 | 2019-09-20 | 广东盛利医疗科技有限公司 | Operation record method, equipment and computer readable storage medium |
CN111539266A (en) * | 2020-04-02 | 2020-08-14 | 威迈(宁波)医疗科技有限公司 | Medical instrument identification device and method and blood vessel intervention training equipment |
CN112612580A (en) * | 2020-11-25 | 2021-04-06 | 北京思特奇信息技术股份有限公司 | Combined event triggering method and triggering system |
CN112881052A (en) * | 2021-01-14 | 2021-06-01 | 深圳市杉川机器人有限公司 | Method and device for constructing working scene of mobile robot |
CN112881052B (en) * | 2021-01-14 | 2024-02-20 | 深圳市杉川机器人有限公司 | Method and device for constructing working scene of mobile robot |
CN113985815A (en) * | 2021-09-17 | 2022-01-28 | 上海三一重机股份有限公司 | Recording playback method, system, equipment and operation machine |
WO2023137747A1 (en) * | 2022-01-24 | 2023-07-27 | 上海莉莉丝科技股份有限公司 | Virtual scene playback method, medium, electronic device, and computer program product |
CN116017082A (en) * | 2022-12-31 | 2023-04-25 | 联想(北京)有限公司 | Information processing method and electronic equipment |
CN117936053A (en) * | 2024-03-21 | 2024-04-26 | 吉林大学第一医院 | Operation flow information management method based on digital operating room |
Also Published As
Publication number | Publication date |
---|---|
CN104580973B (en) | 2018-03-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104580973A (en) | Recording and playback method and device of virtual surgical simulation process | |
CN111899322B (en) | Video processing method, animation rendering SDK, equipment and computer storage medium | |
AU2009330607B2 (en) | System and methods for dynamically injecting expression information into an animated facial mesh | |
US6573915B1 (en) | Efficient capture of computer screens | |
DeCamp et al. | An immersive system for browsing and visualizing surveillance video | |
CN111182358B (en) | Video processing method, video playing method, device, equipment and storage medium | |
CN107909022B (en) | Video processing method and device, terminal equipment and storage medium | |
CN113923462A (en) | Video generation method, live broadcast processing method, video generation device, live broadcast processing device and readable medium | |
US20210166461A1 (en) | Avatar animation | |
CN109035415B (en) | Virtual model processing method, device, equipment and computer readable storage medium | |
JP2995745B2 (en) | Motion information extraction device | |
CN111862280A (en) | Virtual role control method, system, medium, and electronic device | |
CN113822972B (en) | Video-based processing method, device and readable medium | |
US5898429A (en) | System and method for labeling elements in animated movies using matte data | |
CN114143568A (en) | Method and equipment for determining augmented reality live image | |
CN117850799A (en) | Modeling network training method, modeling device and readable storage medium | |
JP3616241B2 (en) | Animation display method and computer-readable recording medium recording animation display program | |
WO2022198971A1 (en) | Virtual character action switching method and apparatus, and storage medium | |
CN112788390B (en) | Control method, device, equipment and storage medium based on man-machine interaction | |
CN113350780A (en) | Cloud game control method and device, electronic equipment and storage medium | |
CN106792219A (en) | A kind of live method and device reviewed | |
CN113556578A (en) | Video generation method, device, terminal and storage medium | |
WO2022172449A1 (en) | Learning device, moving image generating device, learned model generating method, moving image generating method and program | |
CN114741541B (en) | Method and device for interactive control of AI digital person to PPT based on templated editing | |
Davidsen et al. | Volumetric Capture and Replay in Virtual Reality–Entering the age of immersive and volumetric analysis in CSCL |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |