cancel
Showing results for 
Search instead for 
Did you mean: 

How to store the picture of body with selected joint

ahmed_tawfik
Participant
0 Kudos

i try to make patient app to store data of patients

I want to display image Swollen Joint Count (44 Joints)  )

in my app and let the user to select some joint on this image and the count of this selected  joints (display in the picture ) then i want to save it in my database with the selected joints which the user select it,

how can i do this ???

the patient may have more thane one picture

when i retrieve data i want to retrieve on picture only according to some criteria

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you are patient enough, paint the circles on top of the image in a datawindow.

Use modify to change colour at run time when the user clicks them.

All you need to store the database is the names/numbers of the circles selected.

When re-retrieving re-select them for display, printing etc.

ahmed_tawfik
Participant
0 Kudos

Hi Lars

Can you explain more ??

How can i paint the circle?

how can i modify the color  when user click it?

how can to determine which circle the user choose??

is there any demo example for similar approach?

Regards Ahmed

Former Member
0 Kudos

Hi Lars;

  You said => "If you are patient enough"

  OK ... now that's funny since Ahmed's building a patient system - LOL!  

            I love puns ... made my day!  

Regards .... Chris

Former Member
0 Kudos

I have started and attached a datawindow


It refers to the image hd_hglt.gif with no directory specified so you will need that available in the current directory or point it to the right place and name.

I have painted two circles. the pen style is currently red. You can change that.

To create more, just duplicate them and move them, resize and rename them.

In the clicked event dwo.name will tell you which circle was clicked

In source each circle is defined like this:

ellipse(band=detail x="1769" y="340" height="164" width="192"  name=c2 visible="1" brush.hatch="6" brush.color="16777215" pen.style="0" pen.width="14" pen.color="255"  background.mode="2" ba...

To toggle the pen colour between red and black:


string lsName

lsName = dwo.name

if describe ( lsName + '.pen.color' ) = '255' then

    Modify ( lsName + '.pen.color=0' )

else

    Modify ( lsName + '.pen.color=255' )

end if


HTH

Lars

ahmed_tawfik
Participant
0 Kudos

Hi Lars

thank you

it works

regards

Ahmed

ahmed_tawfik
Participant
0 Kudos

Hi Lars

you code is working

after select joints how can i save the picture modified in my database?

Regards Ahmed;

Former Member
0 Kudos

Personally I would not save the pictures at all. I would save the names or numbers of the selected joints as a string.

Above I called them c1, c2 etc.

So before saving, in a loop check if a joint is selected:

string lsSelected, lsName

long lRow, lJoints = 42 //???

for lRow = 1 to lJoints

     lsName = 'c' + string ( lRow)

     if describe ( lsName + '.pen.color' ) = '255' then

          lsSelected += lsName + ','

     end if

next

dw... setItem ( 1 , 'joints' , lsSelected )

Similarly when displaying from database

loop through and set the color='255' for the previously selected

Former Member
0 Kudos

Hi Ahmed;

  My application actually modifies the original image by calling the ImageMagicK open source software to render the changes to the displayed image.

  In your case though, I would assume that you want to preserve the original image but also, the workup on the image overlay which indicates what points on the joints the person reviewing wanted to emphasize.

  In your case, I would suggest Incorporating the image & workup overlay within a DataWindow. That way, you can save the whole workup in one easy step by saving the DW source code as a blob in your DB. Then to restore the entire image + workup, read the DW source back from the Blob & issue a Create () method to rebuild the DWO "exactly" what it looked like in the workup process. Also, this DW source approach would make the coding easy compared to restoring the original DW - then trying to restore all the overlay work drawing object, by drawing object!

Food for thought.

Regards ... Chris

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ahmed;

  That is easy ...

1) use a LOB data type for your picture column in a DB table.

2) use an UpdateBlob command in PB to add the picture to your DB LOB based column.

3) Use a SelectBlob command to read your picture into your PB application.

4) then use a Picture Control to display the image on your PB windows.

Note: if your on PB 12.5.x or higher ... have a look at the DataWindow's Table Blob feature. The DW can now automatically accomplish #2,#3, and #4 all in one object.

HTH

Regards ... Chris

ahmed_tawfik
Participant
0 Kudos

Hi Chris

I can put the image as BLOB datatype in the data base and i can open it in my app

but i want to edit this image when user selected the shaded joints and to store the number of joints he select ( when user select joint it was colored with red).

how to do this

Regards Ahmed

Former Member
0 Kudos

Hi Ahmed;

   Here is an example of an application system I wrote that stores images as blobs and then renders them in a DataWindow (or you could have used a Picture Control). The user can then flip, rotate, invert the image, OCR it and have the OCR point to something of interest - then finally, float a toolbar over the image where the user can mark various areas of the image and them process them (we use ImageMagic free open source for that).

 

   I just demonstrated  this application in the last webinar I did on PowerBuilderTV. You can view the recorded presentation (click here😞

  If you are interested, I can also send you the source code for the DEMO application I used. Its written in PB v12.1 and uses hidden DataWindow drawing objects that are made visible and moved in ways similar to what Lars was suggesting.

  The Demo application runs natively as a Win32 - however, the actual production application runs as a web browser application courtesy of Appeon Web.

HTH

Regards ... Chris

ahmed_tawfik
Participant
0 Kudos

Hi Chris;

Yes i am interested

can you send me the source code for demo app

Regards

Ahmed

Former Member
0 Kudos

Hi Ahmed;

   Please send me an email at:

CPollach.at.Travel-Net.dot.com

(Edit accordingly)


And I'll reply with the PB source.  

Regards ... Chris

ahmed_tawfik
Participant
0 Kudos

Hi Chris

I send you my email

If you did not receive it

it is ahtawfik at yahoo

note that

only i can load picture on my app as in your example

https://scn.sap.com/thread/3783940

i use PB 12.5.x

        but i can not edit it as Lars say

        I wish your code show me how to solve this

        Regards Ahmed ;