Dental program

Dental program

Postby Willy » Thu Sep 07, 2006 11:16 am

Hello,

A dentist asked me to explore te possibilities to write a dental program.

Normaly a relational database is not a problem.

But a dental program has something specific.

They start from a map with teeth.

They click on one tooth and there comes a graph with that thoot divided in
several parts.

Then they select the parts of the tooth where they are working on.

Is it possible in xHarbour to design a graphical set of teeth in wich I can
select some parts.

What I mean is : Can I show a graph on a screen and select a sub-graph

Thanks a lot.

Willy Hermans.
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby areang » Thu Sep 07, 2006 2:19 pm

Willy.

You can do with xHarbour :
- first you have to scan teeth image for maping
- cut by each teeth to get the number of teeth and save it by number
- for the graph draw with line function

areang
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Willy » Fri Sep 08, 2006 6:09 am

areang,

It is not that simple.

Indaed the first part is. I can add a teeth in a graphical button or I can click on a bmp because they are placed alongside.

But some teeth are divided in 24 zones. These zones are not regulary squares. They are just like pieces af a puzzle.

Each piece can have undergo a different treatment. Depending on that treatment it should have a different color.

So when a dentist select a patient, the system does not have to display a standard set of teeth.
The system has to display the actual set of that patient.
Displaying it teeth by teeth and sub-teeth by sub-teeth means moere then 500 graphs.
It should be very slow.

I thought there has been a third party app with which it is possible to draw maps and select one map into another. Maybe this can be useful.

Can someone tell me where I can find this.

Thanks

Willy Hermans
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby Antonio Linares » Fri Sep 08, 2006 6:15 am

Willy,

> The system has to display the actual set of that patient.

That would make it much more complex as you would need a kind of OCR for each patient set.

If you could use a unique model, then you may use a second bitmap with a colors map, and based on the selected color, you will know what part has been selected.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Willy » Fri Sep 08, 2006 6:45 am

> If you could use a unique model, then you may use a second bitmap with a
> colors map, and based on the selected color, you will know what part has
> been selected.[/quote]

Antonio,

I was already thinking of starting with a unique model.
Then I keep a memo field for each patient.

44\02:12\03:12
38\07:16\08:16

could mean

Teeth 44 color 12 for zones 2 and 3
Teeth 38 color 16 for zones 7 and 8

Those zones should be paint over the uniqe model.

Most zones are stying white.

It keeps impossible to select a zone by just clicking in it.

I think that is the difficult part where I look for a solution.

Thanks for the reply Antonio.

Greetings

Willy Hermans.
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby Antonio Linares » Fri Sep 08, 2006 7:29 am

Willy,

> It keeps impossible to select a zone by just clicking in it.

Its easy but little tricky :-)

You have two bitmaps, one with the set picture and another with only colors, one different color for each area. This second one is hidden.

When the user clicks on the picture, you know the row and col of the mouse, and do a GetPixel( oBmp2:GetDC(), nRow, nCol ), oBmp2:ReleaseDC() on the _second_ bitmap. Based on the color you get with GetPixel(), you know what area was selected.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Willy » Fri Sep 08, 2006 9:05 am

Thanks Antonio,

This is already a big step.

I set up a test app to try this.

But then the next step is also dificult in FW

Once I've selected a treathment (from a listbox) I click on a zone in a tooth.

The zone will be detected by the background bitmap. Then this zone has to be colored in the foreground bitmap in the color corresponding with the treathment.

Is there a way to acces the bitmap in memory and to refresh it ?
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby Antonio Linares » Fri Sep 08, 2006 9:44 am

Willy,

> Is there a way to acces the bitmap in memory and to refresh it ?

You may paint a transparent bitmap on top of the dental set bitmap.

You can have a bitmap for each dental area to paint. Painting them transparently on the set bitmap will provide the desired effect.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Fri Sep 08, 2006 11:38 am

or YOU must make it :
Image
I can click on each dental with a menu

---------------------------------------------
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Willy » Fri Sep 08, 2006 2:04 pm

Hello,

I've done some tests.

I did what you said with a screen designed in Borland Resource Workshop.

It works fine when I place the two bitmaps on the screen - both visible.

When I make the colored bitmap invisible with
| NOT WS_VISIBLE
It did not work anymore.

I tried to be smart and placed the second bitmap out the range of the screen.
No succes.

I placed the second bitmap after the first (by setting the order in workshop)
No succes.

Is it possible that your solution only works without workshop.

Thanks,

Willy Hermans
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby Willy » Fri Sep 08, 2006 3:05 pm

Antonio,

I do not find anything in the help files to display a bitmap over another.

Where can I find it.

Thanks,

Willy Hermans.
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby Antonio Linares » Fri Sep 08, 2006 4:42 pm

Willy,

Hide the second bitmap from the ON INIT clause of the DIALOG:

ACTIVATE DIALOG oDlg ON INIT oBmp2:Hide()

Don't use any special flags at the resources workshop.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Fri Sep 08, 2006 4:48 pm

Willy,

oBmp1:bPainted = { | hDC | TransBmp( oBmpX:hBitmap, oBmp1:nWidth(), oBmp1:nHeight(), nClrTransparent, hDC, 0, 0, oBmp1:nWidth(), oBmp1:nHeight() }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Willy » Sat Sep 09, 2006 7:51 am

Antonio Linares wrote:Willy,

Hide the second bitmap from the ON INIT clause of the DIALOG:

ACTIVATE DIALOG oDlg ON INIT oBmp2:Hide()

Don't use any special flags at the resources workshop.


Antonio,

This is the code I tested.
When the colored bitmap is visible its works.
However when it is not visible (hided, outside te range of the form ...) it does not work.

Function Test()


Local oDlg, oBmpColor , oBmpBlackWhite

Local cTitle := "Testing"

DEFINE DIALOG oDlg FROM 0,0 TO 200, 500 TITLE cTitle Pixel // 500 Width


@ 0, 0 Bitmap oBmpBlackWhite Filename cDataDict+"\BitMaps\01-01.Bmp" Size 80 , 100 Of oDlg Adjust Pixel // 100 High
@ 0,110 Bitmap oBmpColor Filename cDataDict+"\BitMaps\01-00.Bmp" Size 80 , 100 Of oDlg Adjust Pixel

* @ 0,110 Bitmap oBmpBlackWhite Filename cDataDict+"\BitMaps\01-01.Bmp" Size 80 , 100 Of oDlg Adjust Pixel // 100 High

oBmpBlackWhite:bLClicked := {|nRow,nCol|GetZone(nRow,nCol,oBmpColor,oBmpBlackWhite)}
oBmpColor:bLClicked := {|nRow,nCol|GetZone(nRow,nCol,oBmpColor,oBmpBlackWhite)}


* ACTIVATE DIALOG oDlg CENTERED On Init oBmpColor:Hide()
ACTIVATE DIALOG oDlg CENTERED



Return Nil

**************************************************************
Static Function GetZone(nRow,nCol,oBmpColor,oBmpBlackWhite)

Local nColor := GetPixel( oBmpColor:GetDC(), nCol,nRow)

? "Kleur : " + AllTrim(Str(nColor)) , "Col : " + AllTrim(Str(nCol)) , "Row : " + AllTrim(Str(nRow))

oBmpColor:ReleaseDC()



Return Nil
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby Antonio Linares » Sat Sep 09, 2006 8:34 pm

Willy,

Please email me those bitmaps, thanks.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 74 guests