Disclosure of Invention
Aiming at the defects in the problems, the invention provides a medical image sketching method and system based on a tablet personal computer.
The invention provides a medical image sketching method based on a tablet computer, which comprises the following steps:
the touch screen acquires a click movement event;
judging whether the click movement event is a touch pen click movement or a finger click movement;
if the touch control pen is used for clicking and moving, entering a drawing mode:
recording track points acquired in the moving process of the touch pen, sequentially connecting a click starting point and the acquired track points into a curve, and connecting an end point and a starting point of the track after the movement is stopped;
if the finger is clicked to move, entering an erasing mode:
drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle;
and erasing the track points falling into the erasing ring.
As a further improvement of the present invention, the determining that the click movement event is a stylus click movement or a finger click movement includes:
for the iPad:
if the touch screen detects a pressure value and the pressure value is greater than 0, judging that the touch pen clicks and moves; otherwise, judging that the finger clicks to move;
for Surface tablet:
if the touch screen detects that a type parameter is generated, judging that the touch pen clicks to move; otherwise, judging that the finger clicks to move.
As a further improvement of the invention, the radius of the erasing ring is 15 pixel values, and the erasing ring consists of 45 points which are uniformly distributed.
As a further improvement of the invention, after erasing the track points falling within the erase circle:
the end point and the start point of the delineation are connected by a dashed line.
A second objective of the present invention is to provide a medical image delineation method based on a tablet computer, which includes:
a drawing button and an erasing button are arranged on the touch screen;
judging to click the drawing button or the erasing button;
if the sketching button is clicked, entering a sketching mode:
recording track points acquired in the moving process of the touch pen, sequentially connecting a click starting point and the acquired track points into a curve, and connecting an end point and a starting point of the track after the movement is stopped;
if the erasing button is clicked, entering an erasing mode:
drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle;
and erasing the track points falling into the erasing ring.
As a further improvement of the present invention, the radius of the erasing ring is 15 pixel values, and the erasing ring is composed of 45 points which are uniformly distributed.
As a further improvement of the invention, after erasing the track points falling within the erase circle:
the end point and the start point of the delineation are connected by a dashed line.
A third objective of the present invention is to provide a medical image sketching system based on a tablet computer, which includes:
the touch screen is used for acquiring a click movement event;
the judging module is used for judging whether the click movement event is a touch pen click movement or a finger click movement; if the touch control pen is in click movement, entering a drawing mode; if the finger is clicked to move, entering an erasing mode;
the drawing module is used for recording track points acquired in the moving process of the touch control pen, sequentially connecting the click starting point and the acquired track points into a curve, and connecting the ending point and the starting point of the track after the movement is stopped;
the erasing module is used for drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle; and erasing the track points falling into the erasing ring, and connecting the end point and the starting point of the drawing by using a dotted line.
As a further improvement of the present invention, the determining module is configured to:
for iPad:
if the touch screen detects a pressure value and the pressure value is greater than 0, judging that the touch pen clicks and moves; otherwise, judging that the finger clicks to move;
for Surface tablet:
if the touch screen detects that a type parameter is generated, judging that the touch pen clicks and moves; otherwise, judging that the finger clicks to move.
A fourth objective of the present invention is to provide a medical image delineation system based on a tablet computer, comprising:
the touch screen is provided with a drawing button and an erasing button, and if the drawing button is clicked, a drawing mode is entered; if the erasing button is clicked, entering an erasing mode;
the drawing module is used for recording track points acquired in the moving process of the touch control pen, sequentially connecting the click starting point and the acquired track points into a curve, and connecting the ending point and the starting point of the track after the movement is stopped;
the erasing module is used for drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle; and erasing the track points falling into the erasing ring, and connecting the end point and the starting point of the drawing by using a dotted line.
Compared with the prior art, the invention has the beneficial effects that:
according to the invention, the touch characteristic of the touch screen of the tablet computer and the convenience of the touch pen in drawing operation are fully utilized, so that the drawing efficiency of a user can be greatly improved; the touch pen is used for drawing, and the finger is used for erasing and modifying the drawing, so that the touch pen is very close to the action of drawing on paper by human, and the operation is visual and convenient.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
The invention is described in further detail below with reference to the attached drawing figures:
as shown in fig. 1, the present invention provides a medical image sketching method based on a tablet computer, comprising:
s1, acquiring a click movement event by a touch screen of the tablet computer;
s2, judging that the click movement event is a touch pen click movement or a finger click movement; the specific judging method comprises the following steps:
for iPad:
if the touch screen detects a pressure value and the pressure value is greater than 0, judging that the touch pen clicks and moves; otherwise, judging that the finger clicks to move;
for Surface tablet:
if the touch screen detects that a type parameter is generated, judging that the touch pen clicks to move; otherwise, judging that the finger clicks to move;
s3, if the touch pen is clicked to move, entering a drawing mode;
s4, recording track points obtained in the moving process of the touch pen, sequentially connecting the click starting point and the obtained track points into a curve, and connecting the ending point and the starting point of the track after the movement is stopped, so as to form a closed sketching area;
s5, if the finger is clicked to move, entering an erasing mode;
s6, drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle; the method specifically comprises the following steps:
acquiring the current screen position P1(a, b) touched by a finger, and drawing an erasing ring by taking a point P1 as a circle center and 15 pixel values as a radius;
all the points on the erase ring can be found by the following formula. Assuming that P (x, y) is a point on a circle, and the connecting line of the point and the circle center P1(a, b) forms an included angle i with the connecting line of the axis;
the x coordinate of P (x, y) can then be found using the following equation:
x=a+15*Math.cos((i*Math.PI)/180),
the y coordinate of P (x, y) can be found by the following equation:
y=b+15*Math.sin((i*Math.PI)/180)。
for convenience and simplification of calculation, the invention only takes one point every 8 degrees, and calculates the points on the circles; i.e. the erasure ring consists of 45 dots which are evenly distributed.
S7, judging whether each point on the drawn curve is in the erasing ring; if so, erasing the trace point; and connecting the end point and the start point of the drawing by a dotted line, which indicates that the part needs to be drawn again.
As shown in fig. 2, the present invention further provides a medical image sketching method based on a tablet computer, including:
s1, a drawing button and an erasing button are arranged on the touch screen, and the touch screen acquires a click event;
s2, judging whether a drawing button is clicked or an erasing button is clicked;
s3, if the drawing button is clicked, entering a drawing mode:
s4, recording track points obtained in the moving process of the touch pen, sequentially connecting the click starting point and the obtained track points into a curve, and connecting the ending point and the starting point of the track after the movement is stopped, so that a closed delineation area is formed;
s5, if the erasing button is clicked, entering an erasing mode:
s6, drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle; the method specifically comprises the following steps:
acquiring a current screen position P1(a, b) touched by a finger, and drawing an erasing ring by taking a P1 point as a circle center and 15 pixel values as a radius;
all the points on the erase ring can be found by the following formula. Assuming that P (x, y) is a point on a circle, and the connecting line of the point and the circle center P1(a, b) forms an included angle i with the connecting line of the axis;
the x coordinate of P (x, y) can then be found using the following equation:
x=a+15*Math.cos((i*Math.PI)/180),
the y coordinate of P (x, y) can be found by the following equation:
y=b+15*Math.sin((i*Math.PI)/180)。
for convenience and simplification of calculation, the invention only takes one point every 8 degrees, and calculates the points on the circles; i.e. the erasure ring consists of 45 dots which are evenly distributed.
S7, judging whether each point on the drawn curve is in the erasing ring; if so, erasing the trace point; and connecting the end point and the start point of the drawing by a dotted line, which indicates that the part needs to be drawn again.
As shown in fig. 3, the present invention provides a medical image sketching system based on a tablet computer, comprising:
thetouch screen 1 is used for acquiring a click movement event;
the judgingmodule 2 is used for judging whether the click movement event is a touch pen click movement or a finger click movement; if the touch control pen is in click movement, entering a drawing mode; if the finger is clicked to move, entering an erasing mode; the specific judgment method comprises the following steps:
for the iPad:
if the touch screen detects a pressure sensing value and the pressure sensing value is greater than 0, the touch screen judges that the touch pen is clicked and moved; otherwise, judging that the finger clicks to move;
for Surface tablet:
if the touch screen detects that a type parameter is generated, judging that the touch pen clicks and moves; otherwise, judging that the finger clicks to move;
thedrawing module 3 is used for recording track points acquired in the moving process of the touch pen, sequentially connecting the click starting point and the acquired track points into a curve, and connecting the ending point and the starting point of the track after the movement is stopped, so that a closed drawing area is formed;
the erasingmodule 4 is used for drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle; judging whether each point on the drawn curve is in the erasing ring; if so, erasing the trace point; connecting the end point and the starting point of the drawing by using a dotted line to indicate that the part needs to be drawn again; the method for drawing the erasing ring specifically comprises the following steps:
acquiring a current screen position P1(a, b) touched by a finger, and drawing an erasing ring by taking a P1 point as a circle center and 15 pixel values as a radius;
all the points on the erase ring can be found by the following formula. Assuming that P (x, y) is a point on a circle, and the connecting line of the point and the circle center P1(a, b) forms an included angle i with the connecting line of the axis;
the x coordinate of P (x, y) can then be found using the following equation:
x=a+15*Math.cos((i*Math.PI)/180),
the y coordinate of P (x, y) can be found by the following equation:
y=b+15*Math.sin((i*Math.PI)/180)。
for convenience and simplification of calculation, the invention only takes one point every 8 degrees, and calculates the points on the circles; i.e. the erasure ring consists of 45 dots which are evenly distributed.
As shown in fig. 4, the present invention further provides a medical image sketching system based on a tablet computer, including:
the touch screen 1 ' is provided with a delineation button 2 ' and an erasing button 3 ', and if the delineation button is clicked, the touch screen enters a delineation mode; if the erasing button is clicked, entering an erasing mode;
the drawing module 4' is used for recording track points acquired in the moving process of the touch pen, sequentially connecting the click starting point and the acquired track points into a curve, and connecting the ending point and the starting point of the track after the movement is stopped, so that a closed drawing area is formed;
the erasing module 5' is used for drawing an erasing ring by taking the current screen position touched by the finger as the center of a circle; judging whether each point on the drawn curve is in the erasing ring; if so, erasing the trace point; connecting the end point and the starting point of the drawing by using a dotted line to indicate that the part needs to be drawn again; the method for drawing the erasing ring specifically comprises the following steps:
acquiring a current screen position P1(a, b) touched by a finger, and drawing an erasing ring by taking a P1 point as a circle center and 15 pixel values as a radius;
all the points on the erase ring can be found by the following formula. Assuming that P (x, y) is a point on a circle, and the connecting line of the point and the circle center P1(a, b) forms an included angle i with the connecting line of the axis;
the x coordinate of P (x, y) can then be found using the following equation:
x=a+15*Math.cos((i*Math.PI)/180),
the y coordinate of P (x, y) can be found by the following equation:
y=b+15*Math.sin((i*Math.PI)/180)。
for convenience and simplification of calculation, the invention only takes one point every 8 degrees, and calculates the points on the circles; i.e. the erasure ring consists of 45 dots which are evenly distributed.
The invention also provides a tablet computer, which comprises the medical image delineation system shown in fig. 3 or fig. 4, and can realize the medical image delineation method shown in fig. 1 or fig. 2.
The invention has the advantages that:
according to the invention, the touch characteristic of the touch screen of the tablet computer and the convenience of the touch pen in drawing operation are fully utilized, so that the drawing efficiency of a user can be greatly improved; the touch pen is used for drawing, and the finger is used for erasing and modifying the drawing, so that the touch pen is very close to the action of drawing on paper by human, and the operation is visual and convenient.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.