Home
Radiograph display system with anatomical icon for selecting
Contents
1. CreateGrayPalette This routine creates a 240 shades of the images gray palette for FALSE 0 Windows 3 0 version of use in displaying amp 5 179 579 57 58 HPALETTE CreateGrayPalette void e AE AL AL La int i LOGPALETTE pPal HANDLE hLPal HPALETTE hPal hLPal LocalAlloc LMEM_ZEROINIT LMEM MOVEABLE sizeof LOGPALETTE 240 sizeof PALETTEENTRY if hLPal return NULL pPal LOGPALETTE LocalLock hLPal pPal gt palVersion 0x300 pPal gt palNumEntries 240 for i 0 i lt 240 it 1 pPal gt palPalEntry i peRed pPal gt palPalEntry i peGreen pPal gt palPalEntry i peBlue pPal gt palPalEntry i peFlags for not unsigned char i 0 tou hPal CreatePalette pPal LocalUnlock hLPal LocaliFree hLPal return hPal CreateGrayPalette CreateGrayDIB Local routine to allocate the global DIB which contains 256 shades of gray To use this the window must set the width and height values Also the window must be sure not to surrender control since other windows may wish to use the DIB Sh static HANDLE CreateGrayDIB voia HANDLE hDib LPBITMAPINFO theDib int i Allocate the offscreen bitmap amp hDib GlobalAlloc GMEM MOVEABLE GMEM_ZEROINIT sizeof BITMAPINFOHEADER 256 sizeof RGBQUAD if hDib theDib LPBITMAPINFO GlobalLock hDib Fill the bitmap head
2. The index for this window is stored in the second extra word Use it to compute the index into the data s StudiesPtr GlobalLock ghStudy which long GetWindowWord wnd 2 theBits which s gt x_size s gt y_size HANDLE GetWindowWord wnd 0 GlobalLock hBits Get a display context A BeginPaint wnd amp ps ie Get the palette here ge EA E AEA gPalette 0 RealizePalette hDC sise need the dimensions of the client area of the window GetClientRect wnd amp winRect Compute the height of the bitmap to be displayed to make sure that it is centered in the available space GetStudyDimensions s which amp width amp height if width gt winRect right srcX width winRect right 2 else srcex 0 if if height gt winRect bottom srcY height winRect bottom 2 else srcY 0 if Set the dimension of the DIB theDib gt bmiHeader biWidth width theDib gt bmiHeader biHeight height YA 5 179 579 21 22 Display the bitmap StretchDIBits hDc 0 0 winRect right winRect bottom srcx srcY winRect right winRect bottom LPSTR theBits theDib DIB RGB COLORS SRCCOPY Clean up GlobalUnlock ghStudy GlobalUnlock ghDIB GlobalUnlock hBits EndPaint wnd amp ps break case WM_CHAR YA On a space bar we want to advance the image Otherwise fall through to th
3. Define the ellipse value for the children SetClassWord GetWindow wnd GW_CHILD 0 ellipse Cleanup GlobalUnlock ghStudy CreateTemplate DestroyTemplate Local routine to clean up the child windows static void DestroyTemplate HWND wnd HWND child while child GetWindow wnd GW_CHILD NULL DestroyWindow child while DestroyTemplate SizeTemplate Local routine to re size the template to fit in the space static void SizeTemplate HWND wnd StudiesPtr s double screen physical int width wheight wX wY int twidth theight ExamTypes exam type int width height int X Y exam type s gt exam_type wX GetWindowWord wnd 2 wy GetWindowWord wnd 4 wwidth GetWindowWord wnd 6 wheight GetWindowWord wnd 8 screen double wwidth double wheight twidth intra_modes exam_type mmWidth theight intra_modes exam_type mmHeight physical double twidth double theight if physical lt screen height wheight width wheight physical else width wwidth height width physical if X wX wwidth width 2 Y wY wheight height 2 5 179 579 53 54 MoveWindow wnd X Y width height FALSE SizeTemplate TemplateWindow This is the main callback routine for the window which is used to display a template for retrieving intraoral
4. EXTERN char gDiskPB 128 Disk file position block EXTERN HWND g mageWnd Handle to the currently active image window EXTERN HWND gResultsWnd Handle to the results window EXTERN HANDLE ghDIB Handle to a 256 gray DIB EXTERN HBRUSH ghChildBrush Handle to the brush used to paint the template child windows EXTERN HPALETTE gPalette Handle to palette containing gray levels EXTERN BOOL gAcauiring Is the system in acquisition mode PROGRAM wdpx c PURPOSE This is the main source file for the Windows 3 0 version of DPX1000 define EXTERN pragma hdrstop include windows h include btrieve h include wdpx h include resource h include wdpxdig h include ptd h include mainwind h include dbutil h include cmntwnd h include autownd h include tmplwnd h include tmpichid h include manwnd h include acquire h include acqenti h include wndwords h include toolwnd h include lt string h gt include lt stdio h gt CreateGrayPalette 5 179 579 81 82 This routine creates a 240 shades of gray palette for use in displaying the images HPALETTE CreateGrayPalette void int i LOGPALETTE pPal HANDLE hLPal HPALETTE hPal hLPal LocalAlloc L MEM_ZEROINITILMEM_MOVEABLE sizeof LOGPALETTE 240 sizeof PALETTEENTRY if thLPal return NULL pPal LOGPALETTE LocalLock hLPai pPal gt palVersion
5. i i s StudiesPtr GlobalLock ghStudy GetStudyDimensions s which amp x_size amp y_size GlobalUnlock ghStudy YA Lock the bits handle hBits HANDLE GetClassWord wnd 0 theBits GlobalLock hBits Lock the DIB handle theDib LPBITMAPINFO GlobalLock ghDIB Use the index and dimension information to compute the offset into the data theBits which x_size y_size Get a display context hDC BeginPaint wnd amp ps Get the palette here SelectPalette hDC gPalette 0 RealizePalette hDC Determine the extent of the image area We compute the portion of the bitmap that is visible here amp GetclientRect wnd amp rect GetScrollRange wnd SB HORZ amp sMin amp sMax if sMin sMax The scroll bars are visible so only part of the image shows The x and y coordinates of the portion of the image that needs to be displayed are the current values of the scroll bars X GetScrollPos wnd SB_HORZ Y GetScrollPos wnd SB_VERT else Since neither scroll bar is visible the window is displaying the entire image X 0 Y 0 if Display the bitmap theDib gt bmiHeader biWidth x_size theDib gt bmiHeader biHeight y_size SetDIBitsToDevice hDC The device context X x origin of destination Y y origin of destination 5 179 579 31 32 x size x exten
6. 5 179 579 7 KeyNumber keyNo char key 256 int length KeyRecord KeyRecPtr Database data types typedef struct unsigned char day unsigned char month unsigned short year DBDate typedef struct unsigned char hundredths unsigned char seconds unsigned char minutes unsigned char hours DBTime typedef enum pano_mode intra_mode extra_mode ceph_mode Modalities 0 typedef enun complete type fmx20 type 0 fmx14 type bw4 type bw2 type ExamTypes 0 Database record structures define CHART_LEN 20 define NAME LEN 20 define MAX_COMMENT 2048 typedef struct char chart_number CHART_LEN short modality short exam_type DBDate date of exp StudyKey FAR StudyKeyPtr typedef struct char chart_number CHART_LEN char key first name NAME LEN char key middle name NAME LEN char key last name NAME LEN DBDate date of birth char first name NAME LEN char middle name NAME LENJ char last name NAME LEN PatientRecord FAR PatientPtr typedef struct char chart number CHART LEN short modality short exam type DBDate date of exp DBTime time of exp short x size short y size char referring service NAME LEN char referring doctor NAME LEN char image file 13 YALI YALI 8 Number of selected key String containing key Number of bytes in key Patient s chart number 4 First nam
7. ARII RR HET Ag 5 179 579 1 RADIOGRAPH DISPLAY SYSTEM WITH ANATOMICAL ICON FOR SELECTING DIGITIZED STORED IMAGES A portion of the disclosure of this patent document contains material which is subject to copyright protec tion The copyright owner has no objection to the fac simile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office patent file or records but otherwise reserves all copyright rights whatsoever BACKGROUND OF INVENTION The invention relates to methods and apparatus for displaying stored radiographs particularly intra oral radiographs H is well known in the field of oral radiology to mount dental radiographs in a film holder Use of such film holders minimizes the possibility of misinterpreta tion of radiographs which when loose and unmounted can appear to be guite similar to one another Such film holders can hold as few as one dental radiograph or as many as 20 or more radiographs Interpretation of such mounted radiographs is facilitated by mounting each film in normal anatomic relation to each other In other words each mounting position in a dental film holder corresponds to a particular anatomical site or anatomi cal region Such mounting of dental radiographs also facilitates repeated study and comparison of sets of radiographs taken at different times in order for exam ple to assess the progress of a particular dental
8. case DPX_ChangeMode r Handle the worked associated with changing modes If switching to automatic mode wP TRUE destroy the sub window if there is one Then determine if this window is to be removed When switching to manual mode just clear the removed field GetClientRect wnd amp rect if wP imageWnd GetWindowWord wnd TCHILD_W_Data if imageWnd DestroyWindow imageWna SetWindowWord wnd TCHILD_W_Data 0 InvalidateRect wnd amp rect FALSE if selWindow GetWindowWord GetParent wnd TMPL_W_IimageNumber if selWindow GetWindowWord wnd GWW_ID SetWindowWord wnd TCHILD_W_Data TRUE InvalidateRect wnd amp rect FALSE if else SetWindowWord wnd TCHILD_W_Data FALSE InvalidateRect wnd amp rect FALSE 7 if break case DPX_Changelmage SetWindowWord wnd TCHILD_W_Data wP GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE break case WM_DESTROY F On a destroy message if in manual mode the sub image should be removed 5 179 579 141 142 imageWnd GetWindowWord wnd TCHILD W Data if IsWindow imageWnd DestroyWindow imageWnd df if break case WM_SYSCOLORCHANGE r On a color change all child windows which have a non zero value in word 0 should be re drawn to take into account a possible change in background color if GetWindowWord wnd TCHILD_W_Data GetClientRect wnd amp rect Inva
9. 0 0 0 wnd NULL gInst NULL SetWindowWord imageWnd 0 GetWindowWord wnd GWw ID SetClassWord imageWnd 0 GetClassWord wnd 2 SetWindowWord wnd 0 imageWna GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE Movewindow imageWnd dragRect 1eft dragRect top dragRect right dragRect left 1 dragRect bottom dragRect top 1 1 FALSE ShowWindow imageWnd SW SHOW else retVal DefWindowProc wnd msg WP 1P if 7 break default retVal DefWindowProc wnd msg WP 1P break i switch return retVal TemplateChildWindow include windows h include btrieve h include wdpx h include resource h finclude wdpxdlg h pragma hdrstop include tmplwnd h include messages h ColorChangeEnum Local routine called by EnumChildWindows when a color change occurs The 1P field is not used i static BOOL FAR PASCAL _export ColorChangeEnum HWND wnd DWORD 1P SendMessage wnd WM_SYSCOLORCHANGE 0 0 5 179 579 49 50 return TRUE x ColorChangeEnum ModeChangeEnum Local routine called by EnumChildWindows when a mode change occurs The 1P field is used to hold the new mode amp static BOOL FAR PASCAL _export ModeChangeEnum HWND wnd DWORD 1P SendMessage wnd DPX ChangeMode 1P 0 return TRUE ModeChangeEnum CreateTemplate Local routine to fill the template static void Cr
10. Strings which appear in the modality exam type and interpretation status drop down boxes char far mode strings Panoramic Intraoral Extraoral Cephalometric 0 if 7 Modelnfo pano_modes Complete 1 0 0 0 0 0 0 Modelnfo intra modes FMX 20 20 345 124 AA be nk landscape 4 0 landscape i pea landscape 49 48 landscape 4 87 landscape 49 87 landscape 100 17 portrait 130 17 portrait 11160 17 portrait 190 17 portrait 220 17 portrait 130 70 portrait 160 70 portrait 14190 70 portrait 257 10 landscape 301 10 landscape 257 48 landscape 301 48 landscape 257 87 landscape 301 87 landscape 5 179 579 77 78 FMX 14 14 290 108 3 14 landscape 49 14 landscape 3 66 landscape 49 66 landscape 94 8 portrait 130 8 portrait 165 8 portrait 94 61 portrait 130 61 portrait 165 61 portrait 201 14 landscape 247 14 landscape 201 66 landscape 247 66 landscape BW 4 4 191 70 8 23 landscape 52 23 landscape 98 23 landscape 11142 23 landscape h BW 2 2 102 70 9 22 landscape 54 22
11. a g 63 Sheet 2 of 5 5 179 579 Jan 12 1993 U S Patent 85 6 8 69 52 69 21 8 06 21 5 06 21 85 WAKI SO BLOT YWYLIWOTWHATI Z ME ME Of XWS ALI TAWOP IDAL WIKI TVYHOVYLX 7 TVLOVHLNI TVYOVHLNI TVSOVHLNT IIWYHONVAS ALI7VGOW ye 201M TS a HY OLIOD boss Ss 3704 NOLLVLIAAYILNI AI ya 94 Z7 7 IDAL WYXTI 5 goa AA aa AZA s ALIT GOW BEI ELI UENO FWYN Fe ge Sheet 3 of 5 5 179 579 Jan 12 1993 U S Patent CJ E3 INID TYNNYW NOWLUL TAY TLNT SMS WYXI ALITY GOW JMAYIS YOLION NIY 71TH FOL 3700 9049 SS LAVHI TWN Td U S Patent Jan 12 1993 START DISPLAY PATIENT 76 DISPLAY 78 ANATOMICAL S 7Z CON 79 SI SELECT ANATOMICAL SITE USING ICON 82 Sheet 4 of 5 5 179 579 START ENTER PATIENT oF 66 DIALOG AND EXAM STUDY SELECTION DIALOG 87 DISPLAY ANATOMICAL S TE ICON WA zi SELECT 89 DISPLAY IMAGE U S Patent Jan 12 1993 Sheet 5 of 5 5 179 579 N i ji G i G 5B cg FIG 5C F G 5D LJIEIESES FIC SE FIG SF SAA MARA oognooo 7G 5H FIG 5G FIG 5I oouo Haana joe wandt TEITO muna EGC GAUE FIG SI FIG 5K FIG 5L FIG 5M a ae me Janin os es BB OC ee Bowe FG 5N FIG 50 F G 5P OO DO Do ew Oo Wa opg zip B re 292005 ASIE ool oo polllgg F G 5Q F G 5R F G 5S via kunata AU ANA ai un
12. 0x300 pPal gt palNumEntries 240 for i 0 i lt 240 i 1 pPal gt palPalEntry i peRed pPal gt palPalEntry i peGreen pPal gt palPalEntry i peBlue unsigned char i pPal gt palPalEntry i peFlags 0 for hPal CreatePalette pPal LocalUnlock hL Pal LocalFree hLPal return hPal CreateGrayPalette CreateGrayDIB Local routine to allocate the global DIB which contains 256 shades of gray To use this the window must set the width and height values Also the window must be sure not to surrender control since other windows may wish to use the DIB static HANDLE CreateGrayDIB void HANDLE hDib LPBITMAPINFO theDib inti ja Allocate the offscreen bitmap hDib GlobalAlloc GMEM_MOVEABLE GMEM_ZEROINIT sizeof BITMAPINFOHEADER 4 b 256 sizeof RGBQUAD if hDib theDib LPBITMAPINFO GlobalLock hDib F Fill the bitmap header theDib gt bmiHeader biSize long sizeof BITMAPINFOHEADER theDib gt bmiHeader biWidth 0 theDib gt bmiHeader biHeight 0 5 179 579 83 84 theDib gt bmiHeader biPlanes theDib gt bmiHeader biBitCount 8 theDib gt bmiHeader biCompression BI_RGB theDib gt bmiHeader biSizelmage OL theDib gt bmiHeader bixPelsPerMeter OL theDib gt bmiHeader biYPelsPerMeter OL theDib gt bmiHeader biCirUsed OL theDib gt bmiHeader biClirimportant OL PF Fill the color table f
13. CreateDC DISPLAY NULL NULL NULL SetROP2 hDC R2_XORPEN SelectObject hDC GetStockObject WHITE_PEN SelectObject hDC GetStockObject NULL_BRUSH Rectangle hDc dragRect left dragRect top dragRect right dragRect bottom dragPoint x LOWORD 1P dragPoint y HIWORD 1P ClientToScreen wnd amp dragPoint dragRect right dragPoint x dragRect left dragRect bottom dragPoint y dragRect top 1 dragRect left dragPoint x dragRect top dragPoint y Rectangle hDC dragRect left dragRect top dragRect right dragRect botton DeleteDC hDc else retVal DefWindowProc wnd msg WP 1P if break case WM_LBUTTONUP if captured First undraw the rectangle hDC CreateDC DISPLAY NULL NULL NULL SetROP2 hDC R2_XORPEN 5 179 579 47 48 SelectObject hDC GetStockObject WHITE PEN SelectObject hDC GetStockObject NULL BRUSH Rectangle hDC dragRect left dragRect top dragRect right dragRect botton Ja DeletepDC hDC ReleaseCapture captured FALSE Now create the new window for the image I m not entirely sure why but we need to subtract one extra from the vertical x dimension Probably has something to do with the combined size of the caption and the frame imageWnd CreateWindow manualWClass NULL WS_CAPTION WS_THICKFRAME WS POPUP WS_MINIMIZEBOX WS_MAXIMIZEBOX WS_VSCROLL WS_HSCROLL 0
14. Of course other types of commercially available x ray sources are also accept able Referring now to FIGS 2 and 3 shown are images displayed on display 24 FIG 1 which are illustrative of the present invention Referring first to FIG 2 shown is a patient query dialog field 36 and exam study selection dialog field 37 Patient query dialog field 36 includes several subfields in which are entered patient specific data For example subfields 38 39 and 41 in clude respectively the patient s name the patient s chart number and the patient s date of birth Subfields 42 and 43 respectively display the date and time of examination Subfields 44 and 46 relate to the referring physician Subfield 47 displays the modality of the particular examination for example panoramic intra oral extr aoral and subfield 48 displays the type of examination for example full mouth bitewing complete panorama cephalometric Subfield 49 reveals the interpretation status and subfields 51 and 52 indicate whether the user wishes to interactively choose the images to be dis 20 25 30 35 40 45 50 55 60 65 4 played manual or whether display in a predetermined sequence is desired CINE Exam study selection dialog field 37 lists the various exams which are stored relating to the patient identified in patient query dialog field 36 For example in FIG 2 exam study selection dialog field 37 indicates that five
15. amp wP lt nTools pTools LPToolRec GlobalLock hTools Remove the tool from the list s pTools wP 1 thelcon 0 pTools wP 1 theProcedure 0 Now if this is the end tool resize the window and array if WP nTools for i nTools 1 i gt 0 i 1 if pToolsfi thelcon break for if GlobalUnlock hTools Fe i is now the number of tools remaining if i lt nTools 1 hTools ReAllocTools hTools nTools iti nTools i 1 SetWindowWord wnd 0 hTools SetWindowWord wnd 2 nTools SizeTheWindow wnd nTools if retVal TRUE else retVal FALSE 7 if break case TM_ClearTools hTools GetWindowWord wnd 0 hTools ReAllocTools hTools GetWindowWord wnd 2 0 SetWindowWord wnd 0 hTools SetWindowWord wnd 2 0 SizeTheWindow wnd 0 break default retVal DefWindowProc wnd msg wP IP break 7 switch 5 179 579 111 112 return retVal ToolWndProc RegisterToolWindow This routine can be called to register the Too Window class pragma warn sus BOOL RegisterToolWindow HWND hinstance WNDCLASS we we style NULL we lpfnWndProc ToolWndProc we cbClsExira 0 we cbWndExtra 4 wce hinstance hInstance we hicon NULL we hCursor LoadCursor NULL IDC_ARROW we hbrBackground GetStockObject WHITE_BRUSH we lpszMenuName NULL we lpszClassName ToolWindo
16. newP o o height for DisplayALine hDC newP 1 oldP for EndBlockDisplay hDC GlobalUnlock oldData GlobalUnlock newData ReleaseDC wnd hDC SetCursor oldCursor return newData Rotate270 WINDOW_PROC TemplateWindow HWND WORD WORD LONG include windows h include btrieve h include wdpx h include resource h include wdpxdig h pragma hdrstop include tmplwnd h include messages h include wndwords h StartAcquireEnum Local routine called by EnumChildWindows when an acquisition is started It needs to clear the flags of all the children so that they show up as empty static BOOL FAR PASCAL _export StartAcquireEnum HWND wnd DWORD IP SetWindowWord wnd TCHILD_W_Data 0 return TRUE 7 StartAcquireEnum ColorChangeEnum Local routine called by EnumChildWindows when a color change occurs The IP field is not used static BOOL FAR PASCAL _ export ColorChangeEnum HWND wnd DWORD IP SendMessage wnd WM_SYSCOLORCHANGE 0 0 return TRUE y Spor nangeEnum ModeChangeEnum 5 179 579 129 130 Local routine called by EnumChildWindows when a mode change occurs The IP field is used to hold the new mode static BOOL FAR PASCAL _export ModeChangeEnum HWND wnd DWORD IP SendMessage wnd DPX_ChangeMode IP 0 return TRUE ModeChangeEnum CreateTemplate Local routine t
17. we hbrBackground GetStockObject BLACK_BRUSH we lpszMenuName NULL we lpszClassName manualWClass PF Register the window class if IRegisterClass amp wc return FALSE ja Register the tool window class if tRegisterToo Window hInstance return FALSE ya Everything worked return TRUE return TRUE InitApplication pragma warn sus FUNCTION Initinstance HANDLE int PURPOSE Saves instance handle and creates main window COMMENTS This function is called at initialization time for every instance of this application This function performs initialization tasks that cannot be shared by multiple instances In this case we save the instance handle in a static variable and create and display the main program window gt 4 y static BOOL Initinstance HANDLE hinstance int nCmdShow FARPROC digProc int screenX mainWY RECT rect int patRight patBottom char aString 32 POINT where Save the instance handle in static variable which will be used in any subseguent calls from this application to Windows ginst hinstance It Initialize other global variables B glsAPatient glsAStudy FALSE ghPatient GlobalAlloc GMEM_MOVEABLE GMEM_ZEROINIT sizeof PatientRecord 5 179 579 91 92 ghStudy GlobalAlloc GMEM_MOVEABLE GMEM_ZEROINIT sizeof StudiesRecord ghDisk GlobalAlloc GMEM_MOVEABLE GMEM_ZEROINIT sizeof DiskReco
18. width 2 xIcon 2 icons per row 1 vertical line dividing icons 2 xBorder outline of window height yCaption caption and top of window yBorder I bottom border of window rows ylcon 1 each row of icons horizontal divider 1 one less divider MoveWindow wnd rect left rect top width height FALSE 7 SizeTheWindow ToolWndProc This is the callback routine for the tools window LONG FAR PASCAL _export Too WndProc HWND wnd WORD msg WORD wP LONG IP 5 179 579 103 104 LONG retVal NULL HANDLE hTools LPToolRec pTools int nTools i HTOOL hTool PAINTSTRUCT ps HDC hDC int xicon ylcon int atX atY LPPOINT rgpt RECT rect switch msg case WM_NCCREATE if DefWindowProc wnd msg wP IP hTools GlobalAlloc GMEM_MOVEABLE 0 SetWindowWord wnd 0 hTools SetWindowWord wnd 2 0 retVal hTools if break case WM_CREATE SizeTheWindow wnd 0 break case WM_DESTROY GlobalFree HANDLE GetWindowWord wnd 0 break case WM_GETMINMAXINFO l We need to set the minimum width lower than the default rgpt LPPOINT IP rgpt 3 x rgpt 3 y 0 break case WM_LBUTTONDOWN er Extract the coordinates of the hit from the message atX LOWORD IP atY HIWORD IP i Get icon sizes xlcon GetSystemMetrics SM_CXICON yicon GetSystemMetrics SM_CYICON Convert the coordinate into
19. FAR FlipVertical HWND wnd LPRECT where HANDLE oldData char huge oldP huge newP 5 179 579 119 120 int y HDC hDC int width height long size HANDLE newData HCURSOR oldCursor oldCursor SetCursor LoadCursor NULL IDC WAIT First create a display context and select the gray palette into it hDC GetDC wnd SelectPalette hDC gPalette 0 RealizePalette hDC PF Now set the dimensions of the image using the rectangle width where gt right where gt left height where gt bottom where gt top is We will need a new buffer to hold the image while we rotate it size long width long height newData GlobalAlloc GMEM_MOVEABLE size if newData NULL return NULL Lock both the data handles oldP GlobalLock oldData newP GlobalLock newData Se Now do one row at a time plotting the pixels as they are rotated The rotation can be accomplished by reversing each row ya newP size width oldP size width StartBlockDisplay where width for y 0 y lt height y 1 _hmemcpyb newP width 1 oldP width DisplayALine hDC newP newP width oldP width for EndBlockDisplay hDC i Clean up GlobalUnlock oldData GlobalUnlock newData ReleaseDC wnd hDC SetCursor oldCursor return newData FlipVertical Rotate90 5 179 579 121 122 This routine rotates the image 90 degrees clockwi
20. Loadicon glnst Hand SendMessage gToolWnd TM_AddTool thelcon long DoDropToo iid x Show the window z ShowWindow gToolWnd SW_SHOW AcquisitionToolPalette 5 179 579 155 What is claimed is 1 A method of displaying stored intra oral radio graphs comprising displaying a representation of an intra oral radio graph holder including target intra oral radiologi cal sites arranged according to anatomical location of said sites selecting one of said target intra oral radiological sites and displaying a stored intra oral radiograph correspond ing to said selected target intra oral radiological site 2 A method for storing and displaying intra oral radiographs comprising generating and displaying intra oral radiographs of dentition generating and displaying a representation of an intra oral radiograph holder including selectable intra oral radiological sites arranged according to ana tomical location of said sites storing said intra oral radiograph images responsive to selection of intra oral radiological sites in said representation along with indicia of respective selected intra oral radiological sites and subsequently retrieving and displaying said intra oral 25 30 35 45 50 55 65 156 radiographs responsive to selection of respective intra oral radiological sites in said representation 3 A program storage device readable by a machine and tangibly embodying a r
21. bitewing view of the right maxillary and mandibular premolars position 60 is a periapical view of the right mandibular molars posi tion 61 is a periapical view of the right mandibular premolars position 62 is a periapical view of the right maxillary canine area position 63 is a periapical view of the right maxillary lateral incisor area position 64 is a periapical view of the maxillary central incisor area position 65 is a periapical view of the left maxillary lateral incisor area position 66 is a periapical view of the left maxillary canine area position 67 is a periapical view of the right mandibular canine area position 68 is a periapical view of the mandibular central incisor area position 69 is a periapical view of the left mandibular canine area position 70 is a periapical view of the left maxillary premolars position 71 is a periapical view of the left maxillary molars position 72 is a bitewing view of the left maxillary and mandibular premolars position 73 is a bitewing view of the left maxillary and mandibu lar molars position 74 is a periapical view of the left mandibular premolars and position 75 is a periapical view of the left mandibular molars It should be emphasized that other anatomical conno tations can be applied to the various portions of the icon appearing in icon field 53 without departing from the spirit and scope of the present invention as long as the anatomical sites represented by the icon in icon fie
22. child TCHILD_W_Daia i 0 for J Define the ellipse value and mode for the children child GetWindow wnd GW CHILD SetClassWord child TCHILD_C_Ellipse silipsej PF Cleanup GlobalUnlock ghStudy CreateTemplate DestroyTemplate Local routine to clean up the child windows static void DestroyTemplate HWND wnd HWND child while child GetWindow wnd GW_CHILD NULL DestroyWindow child while 7 DestroyTemplate SizeTemplate Local routine to re size the template to fit in the space static void SizeTemplate HWND wnd StudiesPtr s double screen physical int wwidth wheight wX wY int twidth theight ExamTypes exam type int width height int X Y exam type s gt exam_type 5 179 579 133 134 wX GetWindowWord wnd TMPL_W_FreeLeft wY GetWindowWord wnd TMPL W FreeTop wwidth GetWindowWord wnd TMPL W FreeWidth wheight GetWindowWord wnd TMPL_W_FreeHeight screen double wwidth double wheight twidth intra_modes exam_type mmWidth theight intra_modes exam_type mmHeight physical double twidth double theight if physical lt screen height wheight width wheight physical else width wwidth height width physical 7 if X wX wwidth width 2 Y wY wheight height 2 MoveWindow wnd X Y width height FALSE 7 SizeTemplate T
23. examinations have been completed including a com plete panorama three intra oral examinations including a full mouth 20 film examination FMX 20 a 4 film bitewing BW 4 and a 2 film bitewing BW 2 The fifth examination is a cephalometric extraoral examina tion The entry for each examination in exam study selection dialog field 37 includes three items examina tion modality examination type and date of examina tion When different examinations are to be selected for review fields 42 43 47 and 48 of patient query dialog fields 37 are updated as appropriate by a system user After a particular examination has been selected for review the screen shown in FIG 3 is displayed to the system user Referring to FIG 3 depicted are patient query dialog field 36 displaying the same information as in field 36 of FIG 2 icon or representation field 53 and image display fields 54 Although FIG 3 depicts three image display fields 54 it will be understood that one or more image fields can be used In FIG 3 icon field 53 comprises an image of a full mouth examination 20 film holder Within the icon in icon field 53 of FIG 3 are film positions 56 74 each of which relate to a specific anatomical site Specifically position 56 is a periapical view of the right maxillary molars position 57 is a periapical view of the right maxillary premolars position 58 is a bitewing view of the right maxillary and mandibular molars position 59 is a
24. identification and the number of the tooth in the image Sets of images constituting for example a den tal survey can be stored and recalled for display When sets of related images are displayed miniature versions of the images are presented in one portion of the display monitor for selection by the user and are displayed in another portion of the monitor 0 w 5 45 60 65 2 However these miniature representations of the im ages are in no particular order requiring the user care fully to assess which image among the set of images is the image desired to be displayed and studied This system becomes particularly awkward as the number of images in a set increases given the fact intra oral radio graphs of different anatomical sites can appear to be quite similar SUMMARY OF THE INVENTION The present invention solves the above noted draw backs of the prior art by providing a method and appa ratus for displaying stored radiographic images which takes advantage of dentists knowledge of normal radio logic anatomy and knowledge of anatomical landmarks In particular the present invention includes an x ray sensor and x ray source which are used together to produce images of target anatomical sites The images are then stored preferably after digitization in a com puter memory Then the display of the stored images is facilitated by use of a representation or icon of anatomi cal sites or of the port
25. landscape JE 0 0 0 0 E char far interp_strings Pending Complete 0 endif EKTERN PatientPtr gPatient EKTERN HWND ginst Global copy of current instance of app EXTERN KeyRecord gKey Global pointer to a key record Used to simplify communication between database dialog callback functions EXTERN HWND gMainWindow Handle to the main window EXTERN HWND gPatDig Handle to the non modal dialog which displays the information about the current patient and image set EXTERN HWND gAcaDig Handle to the non modal dialog through which the user controls the acquisition process EXTERN HWND gCommentWnd Handle to the comments entry window 5 179 579 79 80 EXTERN HWND gTemplateWnd Handle to the template window EXTERN HWND gToolWnd Handie to the tools window EXTERN HANDLE ghPatient Global patient record used by dialog callback routines EXTERN BOOL glsAPatient Is there a patient record in gPatient EXTERN HANDLE ghStudy Global studies record used by dialog callback routines EXTERN BOOL glsAStudy Is there a study record in gStudy EXTERN HANDLE ghDisk Global disks database record EXTERN char gOpenName 132 Global filename buffer The result of calling the GetFile dialog is placed in this buffer EXTERN char gPatPB 128 Patient file position block EXTERN char gStudyPB 128 Study file position block
26. the rectangle taking the image orientation into account dragPoint x LOWORD 1P dragPoint y HIWORD 1P ClientToScreen wnd amp dragPoint dragRect left dragPoint x dragRect top dragPoint y if intra_modes s gt exam_type images GetWindowWord wnd GWW_ID dragRect right GragRect left s gt x_size 1 dragRect bottom dragRect top s gt y_size 1 else dragRect right dragRect left s gt y size 1 5 179 579 45 46 dragRect bottom dragRect top s x size 1 if dragRect right 2 GetSystemMetrics SM_CXFRAME dragRect bottom 2 GetSystemMetrics SM_CYFRAME GetSystemMetrics SM_CYCAPTION i amp Now get a device context and draw the first rectangle hDC CreateDC DISPLAY NULL NULL NULL SetROP2 hDC R2_XORPEN SelectObject hDC GetStockObject WHITE_PEN SelectObject hDC GetStockObject NULL_BRUSH Rectangle hDC dragRect left dragRect top dragRect right dragRect bottom DeleteDC hDC GlobalUnI1ock ghStudy if else Automatic mode If this image is not already removed send a message to the template indicating the change if GetWindowWord wnd 0 PostMessage gTemplateWnd DPX_ChangeImage GetWindowWord wnd GWW_ID 0 bof if if break case WM_MOUSEMOVE i if captured Now get a device context undraw the old rectangie and draw the new rectangle hDc
27. treat ment In addition the mounting of dental radiographs in film holders in normal anatomic relation allows a den tist having knowledge of normal radiologic anatomy and knowledge of anatomical landmarks to guickly and easily interpret any set of mounted dental radiographs The anatomical landmarks used by dentists include the maxillary molar area including the posterior wall of the maxillary tuberosity the hamular process the coronoid process of the mandible the maxillary sinus and the zygomatic process the mazillary premolar area in cluding the maxillary sinus the maxillary incisor area including the incisive foramen the cartilage of the nose the nasal septum and the nasal fossae the man dibular molar area including the external oblique line the mylohyoid ridge and the mandibular canal the mandibular premolar area including the mylohyoid ridge and the mental foramen and the mandibular incisor area including the mental ridges lingual fora men and the genial tubercles Film holders present films taken of these anatomical landmark sites in posi tions that are consistent from holder to holder Recent advances in dental radiology include the use of x ray sensitive sensors in place of film to produce digitized x ray images which are stored in a computer memory and viewed on a computer monitor In one such computer system intra oral x ray images are cre ated and stored along with information regarding pa tient
28. ware display In the preferred embodiment an IBM AT compatible PC computer available from Jameco Elec tronics is used This preferred computer system includes an Intel 33 MHz 80386 CPU with 8 megabytes of sys tem RAM 40 megabytes of hard disk drive 5 25 and 3 5 inch floppy disk drives a SuperVGA noninterlaced 1024 x 768 pixel display adapter a noninterlaced Su perVGA monitor and an AT 101 key style keyboard However other combinations of commercially avail able components can also be used without departing from the scope of the invention The preferred x ray sensor is a Sens A Ray sensor available from Regam Medical Systems AB This pre ferred sensor produces a 576 x 386 pixel analog image which is digitized by digitizer 32 before application to data address bus 28 Digitizer 32 is preferably a frame grab board available from Regam Medical Systems AB however other commercially available image digitizers can also be used Digitizer 32 is required in the pre ferred embodiment because the preferred sensor 29 produces a pixelized analog signal However if sensor 29 produced a digital signal sensor 29 could be con nected directly to data address bus 28 and digitizer 32 could be eliminated X ray source 33 can be any commercially available x ray source appropriate for the particular application For example for intra oral radiography x ray source 33 can be for example a type Gendex 1000 x ray source available from Gendex Corp
29. 17 portrait 130 17 portrait 160 17 portrait 190 17 portrait 220 17 portrait 130 70 portrait 160 70 portrait 3 190 70 portrait 257 10 landscape 301 10 landscape 257 48 landscape 301 48 landscape 257 87 landscape 301 87 landscape Ja FMX 14 14 290 108 3 14 landscape 49 14 landscape 3 66 landscape 49 66 landscape 94 8 portrait 130 8 portrait 165 8 portrait 94 61 portrait 130 61 portrait 165 61 portrait 201 14 landscape 247 14 landscape 201 66 landscape 247 66 landscape de BW 4 4 191 70 8 23 landscape 52 23 landscape ss 8 98 23 landscape 142 23 landscape Na rol El os BW 2 2 102 70 9 22 landscape 0 54 22 landscape 5 179 579 13 14 char far interp_strings Pending Complete 0 Ja endif EKTERN PatientPtr gPatient EXTERN HWND gInst Global copy of current instance of app EXTERN KeyRecord gKey Global pointer to a key record Used to simplify communication between database dialog callback functions EXTERN HWND gMainWindow Handle to the main window EXTERN HWND gPatDlg Handle to t
30. 3 Then in block 86 the system user uses the icon in field 53 to select the anatomical site within icon 53 that is to be associated with the x ray image captured in block 79 Such selec tion can be accomplished by use of a keyboard mouse touch sensitive screen or other functionally equivalent user input device After the selection has occurred control passes to block 82 where the captured image is stored along with indicia of the associated location in the icon The steps presented in block 79 81 and 82 are repeated until images have been captured and associ ated with each of the anatomical sites represented by the icon in field 53 The image capture and store process is then ended Referring now to FIG 4B the image retrieval and display process is presented After the process is begun a user enters patient specific data in block 83 Then in block 84 the set of examinations associated with that patient retrieved Control then passes to block 86 wherein the display of FIG 2 is presented including patient specific data in field 36 and study examination data in field 37 After a particular exam study is se lected for review by the user control passes to block 87 where the image of FIG 3 is presented including the appropriate icon in icon field 53 Then in block 88 the system user selects an image to be displayed by selecting the appropriate anatomical site of the icon in icon field 3 This user selection can be by use of a keyboa
31. 4 Also depicted in the graphical representation of FIG 7 are panoramas of immature baby teeth maxil lary and mandibular dental arches 96 and 97 Tooth numbers are also shown in the graphical representation of FIG 7 but can be eliminated if desired When using the graphical representations of FIGS 6 and 7 as icons in icon field 53 FIG 3 user positionable frame 98 can be displayed along with the icon and can be moved once again by use of a keyboard mouse touch sensitive screen or functionally equivalent user input device to select the anatomical site correspond ing to the desired image to be stored or displayed It should be emphasized that although the present invention has been described in relation to intra oral radiography application to other fields of radiology is also contemplated In addition those of ordinary skill in this technology will appreciate that additions deletions and changes can be made to the disclosed preferred embodiment without departing from the scope of the invention APPENDIX Declaration types for callback procedures YA define DIALOG PROC BOOL FAR PASCAL _export define WINDOW_PROC long FAR PASCAL _export Data type which defines the record which is returned from any of the typedef enum NoKey 1 IDKey 0 NameKey DoBKey IDStudyKey LabelKey KeyNumber 0 o II typedef struct Get Key routines and an enum that lists all the key numbers
32. ANDLE oldData char huge oldP huge newP int y HDC hDC int width height long size HANDLE newDaia HCURSOR oldCursor 5 179 579 117 118 oldCursor SetCursor LoadCursor NULL IDC_WAIT Th First create a display context and select the gray palette into it hDC GetDC wnd SelectPalette nDC gPalette 0 RealizePalette hDC Now set the dimensions of the image using the rectangle width where gt right where gt left height where gt bottom where gt top We will need a new buffer to hold the image while we rotate it size long width long height newData GlobalAlloc GMEM_MOVEABLE size if newData NULL return NULL PF Lock both the data handles A oldP GlobalLock oldData newP GlobalLock newData 7 Now do one row at a time plotting the pixels as they are rotated The rotation can be accomplished by moving rows from the beginning of the old image to the end of the new newP size width StartBlockDisplay where width for y 0 y lt height y 1 _hmemepy newP oldP width DisplayALine hDC newP newP width oldP width for EndBlockDisplay hDC J Clean up GlobalUnlock oldData GlobalUnlock newData ReleaseDC wnd hDC a SetCursor oldCursor return newData FlipHorizontal 4 FlipVertical This routine rotates an image about its y axis HANDLE
33. BH GETCHECK 0 0 if manualMode imageWnd GetWindowWord wnd 0 removed imageWnd 0 44 IsWindowVisible imageWnd else removed GetWindowWord wnd 0 5 179 579 43 44 if ellipse GetClassWord wnd 0 Get a device context amp hDC BeginPaint wnd amp ps s Get the correct brush with which to fill the rectangle amp if removed oldBrush else oldBrush SelectObject hDC ghChildBrush il Selectobject hDC GetStockObject DKGRAY BRUSH Fill the window or a rounded rectangle version of it A GetClientRect wnd amp rect RoundRect NDC 0 0 rect right rect botton ellipse ellipse x Clean up SelectObject hDC oldBrush ReleaseDC wnd hDC break case WM_LBUTTONDOWN amp amp Check to see if the program is in automatic or manual mode amp manualMode SendDlgItemMessage gPatDlg IDC_PTD_MANUAL BM_GETCHECK 0 0 if manualMode amp Manual mode If this image is already in a window bring it to the front Otherwise capture the mouse and begin dragging an outline around imageWnd GetWindowWord wnd 0 if imageWnd if IsWindowVisible imageWnd SetFocus imageWnd else ShowWindow imageWnd SW_SHOW GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE if else s ebud tes EE Si opa Hock anetney captured TRUE SetCapture wnd Define
34. LL NULL SetROP2 hDC R2 XORPEN SelectObject hDC GetStockObject WHITE PEN SelectObject hDC GetStockObject NULL BRUSH Rectangle hDC dragRect left dragRect top dragRect right dragRect bottom dragPoint x LOWORD IP dragPoint y HIWORD IP ClientToScreen wnd amp dragPoint dragRect right dragPoint x dragRect left dragRect bottom dragPoint y dragRect top dragRect left dragPoint x dragRect top dragPoint y Rectangle hDC dragRect left dragRect top dragRect right dragRect bottom DeleteDC hDC else retVal DefWindowProc wnd msg wP IP bf if break case WM_LBUTTONUP if GetCapture wnd ia First undraw the rectangle hDC CreateDC DISPLAY NULL NULL NULL SetROP2 hDC R2_XORPEN SelectObject hDC GetStockObject WHITE_PEN SelectObject hDC GetStockObject NULL_BRUSk 5 179 579 147 148 Rectangle hDC dragRect left dragRect top dragRect right dragRect bottom DeleteDC hDC j ReleaseCapture ii Now create the new window for the image I m not entirely sure why but we need to subtract one extra from the vertical dimension Probably has something to do with the combined size of the caption and the frame Sh imageWnd CreateWindow manualWClass NULL WS CAPTION WS THICKFRAME WS POPUP WS_MINIMIZEBOX WS MAXIMI2EBOX WS VSCROLL WS HSCROLL dragRect left dragRect top dragRect right dragRect lett 1 dra
35. Read BYTES PER IO pB BYTES PER IO bytesRead _lread file LPSTR pB BYTES PER IO bytesToRead BYTES PER IO while All done close file GlobalUnlock buffer GlobalUnlock hStudy SetCursor oldCursor return TRUE LoadStudy YALI x x HideStudyWindows This routine destroys any windows which have been opened to display images void HideStudyWindows void if gImageWnd 0 DestroyWindow gqimageWnd gImageWnd 0 if HideStudyWindows DisplayStudyWindows This routine opens and displays the windows used to display images for the current study It uses the global study record The window sizes itself in the WM_CREATE case void DisplayStudyWindows HANDLE hData HWND hWnd Create the window and display it hWnd CreateWindow autoWClass NULL WS_BORDER WS_POPUP 0 0 5 179 579 39 40 0 0 gMainWindow NULL gInst NULL Ja SetWindowWord hWnd 0 hData SetWindowWord hWnd 2 0 ShowWindow hWnd SW_SHOW UpdateWindow hWnd gImageWnd hWnd DisplayStudyWindows UpdateStudyWindow f amp This routine causes the indicated window to be updated from new data amp void UpdateStudyWindow void InvalidateRect gimageWnd NULL FALSE UpdateStudyWindow GetStudyDimensions This routine encapsultates all the computation necessary to determin
36. United States Patent m9 Dove et al 54 RADIOGRAPH DISPLAY SYSTEM WITH ANATOMICAL ICON FOR SELECTING DIGITIZED STORED IMAGES S Brent Dove W Doss McDavid both of San Antonio Tex C Donald Wilcox O Fallon Ill Board of Regents The University of Texas System Austin Tex 21 Appl No 717 211 75 Inventors 73 Assignee 22 Filed Jun 17 1991 51 Int Ch 5 iieeeeeeeeeerreasheansessasasassseasne A61B 6 14 52 U S Cl ceccccccsssssssssseessssssssssessnesees 378 38 378 39 378 40 378 99 378 162 378 165 378 901 378 170 378 168 378 205 364 413 13 364 413 15 364 413 22 58 Field of Search 378 99 38 165 162 378 901 40 39 62 170 168 205 364 413 22 413 13 413 15 413 16 56 References Cited U S PATENT DOCUMENTS 4 409 616 10 1983 Ledley lt mwsmmmme 378 40 4 837 732 6 1989 Brandestini et al 364 413 28 4 852 134 7 1989 Kinanen et al oo cee 378 38 4 856 038 8 1989 Guenther et al 378 39 4 878 234 10 1989 Pfeiffer et al 378 40 5 018 177 5 1991 McDavid et al 378 62 5 021 770 6 1991 Alsaka et al wc cece 378 99 OTHER PUBLICATIONS Trophy Mini Julie User s Manual Jan 1991 a YANA NAI RADI MA US005179579A 11 Patent Number us Date of Patent 5 179 579 Jan 12 1993 Langland et al Textbook of Dental Radiology Charles C Thomas Publisher pp 308 314 Primary Examiner Janic
37. _ChangeImage FALSE 0 5 179 579 55 l PostMessage GetDlgItem wnd wP DPX_ChangeImage TRUE 0 PostMessage gImageWnd DPX_ChangeImage wP 0 SetWindowWord wnd 0 wP break case DPX ChangeMode to automatic mode tell each child so manual image window associated If we need only tell the selected child if wP enumProc EnumChildWindows wnd enumProc wP FreeProcinstance enumProc ShowWindow gImageWnd SW_SHOW else Hide or show the window based upon the value of wP that they can get rid of the switching to manual mode WP TRUE gt switching to automatic mode 56 If changing MakeProcInstance FARPROC ModeChangeEnun ginst PostMessage GetDlgItem wnd GetWindowWord wnd 0 DPX_ChangeMode ShowWindow gImageWnd SW_HIDE if break default retVal DefWindowProc wnd msg WP 1P break switch return retVal TemplateWindow PROGRAM wdpx c PURPOSE This is the main source file for the DPX1000 define EXTERN pragma hdrstop include windows h include btrieve h include wdpx h include resource h include wdpxdlg h include ptd h include mainwind h include dbutil h include cmntwnd h include autownd h include tmplwnd h include tmplchld h f include manimage h include acquire h include lt string h gt include lt stdio h gt
38. alUnlock newData ReleaseDC wnd hDC SetCursor oldCursor return newData Rotate90 Rotate180 This routine rotates an image 180 degrees displaying it in the given window inside the specified rectangle HANDLE FAR Rotate180 HWND wnd LPRECT where HANDLE oldData char huge oldP huge newP int y HDC hDC int width height long size HANDLE newData HCURSOR oldCursor oldCursor SetCursor LoadCursor NULL IDC_WAIT vhs First create a display context and select the gray palette into it hDC GetDC wnd SelectPalette hDC gPalette 0 RealizePalette hDC Now set the dimensions of the image using the rectangle width where sright where gt left height where gt bottom where gt top Fe We will need a new buffer to hold the image while we rotate it size long width Iong height newData GlobalAlloc GMEM_MOVEABLE size if newData NULL return NULL Lock both the data handles oldP GlobalLock oldData newP GiobalLock newData I Now do one row at a time plotting the pixels as they are rotated The rotation can be accomplished by moving pixels from the beginning of the old image to the end of the new moving forward through the old and backward through the new newP size 1 StartBlockDisplay where width for y 0 y lt height y 1 _hmemcpyb newP oldP width newP width DisplayALine hDC n
39. are flow charts of the method of the present invention FIGS 5A S are examples of representations of film holders usable a icons in the present invention FIGS 6 and 7 are examples of representations of dentition usable a icons in the present invention DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring to FIG 1 a computer based system is pres ented embodying the present invention The computer based system includes central process ing unit CPU 21 which in operation first loads soft ware embodying the present invention into memory 22 5 179 579 3 from program storage medium 23 The software of the present invention is presented in flow chart form in FIGS 4A and 4B and is shown in detail in the program listing of the Appendix hereto Program storage me dium 23 can be any machine readable storage medium such as for example a floppy or hard magnetic or opti cal disk or a programmable read only memory The computer system further includes display 24 which is connected in a known manner through display control bus 26 display interface 27 and internal data address bus 28 to CPU 21 The computer based system also includes an x ray sensor 29 which is connected through sensor cable 31 digitizer 32 and internal data address bus 28 to CPU 21 To acquire x ray images sensor 29 is used with x ray source 33 to produce two dimensional x ray images of dentition 34 The computer system can be any computer and hard
40. c style NULL we lpfnWndProc FARPROC TemplateWindow we cbClsExira 0 we cbWndExtra 10 we hinstance hinstance wc hlcon NULL wc hCursor LoadCursor NULL IDC ARROW wc hbrBackground GetStockObject BLACK_BRUSH we lpszMenuName NULL we pszClassName templateWClass J Register the window class if RegisterClass amp wc return FALSE J Register the class that defines the child windows used in the template window Extra data Class 0 Ellipse value 2 Image data handle k 4 Message that caused the creation of the window amp Window 0 Selected or handle to image window for display filled for acquire wc style NULL we lpfnWndProc FARPROC TemplateChildWindow we cbClsExtra 6 wc cbWndExtra 2 we hinstance hinstance we hicon NULL we hCursor LoadCursor NULL IDC ARROW we hbrBackground GetStockObject BLACK_BRUSH we lpszMenuName NULL we lpszClassName templateChildWClass ia Register the window class if IRegisterClass amp wc return FALSE Register the class that defines the windows used in manual image display mode Extra data Class 0 Handle to image data Window 0 Number of image we style NULL we lpfnWndProc FARPROC ManuallmageWindow 5 179 579 89 90 wc cbClsExtra 2 wc cbWndExtra 2 wc hinstance hInstance wc hlcon NULL we hCursor LoadCursor NULL IDC_ARROW
41. con 1 5 179 579 107 108 MoveTo hDC atX 1 atY LineTo hDC atX 1 atYi ylcon if for GlobalUnlock hTools EndPaint wnd amp ps break case TM_AddTool hTool NULL i When adding a tool we need to first scan the array to see if there is an empty slot we can use hTools GetWindowWord wnd 0 pTools LPToolRec GlobalLock hTools nTools GetWindowWord wnd 2 for i 0 i lt nTools i 1 if pTools i thelcon NULL hTool i 1 break fifty 7 for GlobalUnlock hTools id If no empty slot was found hTool will be NULL if hTool NULL PF Re allocate the array to hold an extra item nTools 1 hTools ReAllocTools hTools nTools 1 nTools F If the re allocation was successful place the data into the new slot and resize the window if necessary if hTools SetWindowWord wnd 0 hTools SetWindowWord wnd 2 nTools if nTools 81 SizeTheWindow wnd nTools prit hTool nTools if yri t If everything has gone as expected hTool will be non null if hTool pTools LP TooIRec GlobalLock hTools pTools hTool 1 thelcon WP pTools hTool 1 theProcedure IP GlobalUnlock hTools 5 179 579 109 110 yif retVal hTool break case TM_RemoveTool i Good little programmers always check their input data hTools GetWindowWord wnd 0 nTools GetWindowWord wnd 2 if WP gt 0 amp
42. croll bars We can start with the horizortal since we already have its range newMax x_size newz 1 hPos GetScrollPos wnd SB HORZ if oldMax newMax SetScrollRange wnd SB_HORZ 0 newMax FALSE if hPos gt newMax hPos newMax if Now for the vertical scroll bar k GetScrollRange wnd SB VERT amp oldMin amp 01dMax vPos GetScrollPos wnd SB VERT newMax y_size newY 1 if oldMax newMax SetScrollRange wnd SB_VERT 0 newMax FALSE if vPos gt newMax vPos newMax if Now reset the scroll bar positions Redraw the scroll bars now SetScrollPos wnd SB_HORZ hPos TRUE SetScrollPos wnd SB VERT vPos TRUE else The new window will be large enough for the whole image We can therefore hide the scroll bars SetScrollRange wnd SB VERT 0 0 FALSE SetScrollRange wnd SB HORZ 0 0 FALSE if if AdjustScrollBars Scroll Image Local routine to adjust the image position when the user clicks in the scrollbars 5 179 579 27 28 static void ScrollImage HWND wnd int which WORD wP DWORD 1P int newPos sMin sMax oldPos RECT rect GetScrollRange wnd which amp SMin amp sMax newPos oldPos GetScrollPos wnd which switch wP case SB BOTTOM newPos sMax break case SB_LINEDOWN if oldPos lt sMax newPos oldPos 1 break case SB LINEUP if ol
43. dPos gt sMin newPos oldPos 1 break case SB_PAGEDOWN newPos oldPos 16 if newPos gt sMax newPos sMax break case SB _PAGEUP newPos oldPos 16 if newPos lt sMin newPos sMin break case SB _THUMBPOSITION newPos LOWORD 1P break case SB TOP newPos sMin break switch If the click caused the image to scroll invalidate the image to get it redrawn if newPos oldPos SetScrollPos wnd which newPos TRUE GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE X if ScrollImage ManualImageWindow x This is the main callback routine for the window which is used to display image in manual windows WINDOW _PROC ManualImageWindow HWND wnd WORD msg WORD wP LONG 1P LONG retVal NULL LPBITMAPINFO theDib HANDLE hBits char huge theBits HDC hDC PAINTSTRUCT ps LPPOINT rgpt POINT pt RECT rect long which StudiesPtr s int x_size y_size HWND owner int X Y int sMin sMax switch msg case WM CREATE 5 179 579 29 30 k Make sure that the ranges for the 2 scroll bars are 0 thereby _ x making them already invisible SetScrollRange wnd SB_HORZ 0 0 FALSE SetScrollRange wnd SB_VERT 0 0 FALSE break case WM_PAINT The index for this window is stored in the second extra word which long GetWindowWord wnd 0 YALI Get the x and y sizes from the study record
44. de wdpx h include resource h include wdpxdlg h pragma hdrstop include study h include acquire h include studydb h finclude lt string h gt include lt io h gt include lt fentl h gt include lt sys stat h gt define BYTES PER IO 32768 StudySpaceRequirements This routine computes the amount of disk space required by a study lt unsigned long StudySpaceRequirements HANDLE hStudy return AcquireSize hStudy StudySpaceRequirements ExistingStudySize This routine returns the amount of memory required to read an existing study from disk ee a 5 179 579 35 36 unsigned long ExistingStudySize HANDLE hStudy StudiesPptr s unsigned long space s StudiesPtr GlobalLock hStudy space NumImages s space space s gt x_Size s gt y_size GlobalUnlock hStudy return space ExistingStudySize SaveStudy This routine manages the file I O needed to store a study to disk BOOL SaveStudy HANDLE hStudy HANDLE data StudiesPtr s StudiesPtr GlobalLock hStudy char fullFilename 16 int f char drive 2 HCURSOR oldCursor This could take a while display the hourglass cursor oldCursor SetCursor LoadCursor NULL IDC WAIT Get the drive name from the initialization file GetProfilesString gAppName Image Drive G drive 2 Now we need to create the filename for the image file i lst
45. e the width and height of an image in a study void GetStudyDimensions StudiesPtr s int which int width int height switch s gt modality i case pano mode amp idth s gt 4 size height s gt y size break case intra mode if intra_modes s gt exam_type images which portrait width s gt x_size height s gt y_size else ewidth s gt y_size height s gt x_size if break switch GetStudyDimensions include windows h include btrieve h include wdpx h include resource h include wdpxdlg h pragma hdrstop include tmplichld h include messages h include manimage h Local variables used when dragging the outline of a window which will be used to display the image when the user releases the mouse static BOOL captured Is mouse captured to display rect static RECT dragRect Rectangle most recently drawn static POINT dragPoint Location of last mouse move message TemplateChildwindow This is the main callback routine for the window which is used to display a template for retrieving intraoral images WA WINDOW PROC TemplateChildWindow HWND wnd WORD msg WORD wP LONG 1P LONG retval NULL HDC hDC PAINTSTRUCT ps RECT rect 5 179 579 41 42 BOOL removed HANDLE oldBrush int ellipse HWND imageWnd StudiesPtr s int selWindow BOOL manualMode switch msg cas
46. e A Howell Assistant Examiner Kim Kwok Chu Attorney Agent or Firm Arnold White amp Durkee 57 ABSTRACT A method and apparatus for storing and displaying radiographs particularly intra oral radiographs is pres ented Radiographs are captured digitized and dis played along with an icon of a portion of the anatomy from which the radiograph was taken The anatomical sites represented by the icon are arranged according to their normal anatomical relationship The icon is used by the system user to select a portion of the anatomy corresponding to the displayed radiograph and the radiograph is stored along with indicia of the selected anatomical site Then when the stored radiograph is desired to be viewed the icon is again displayed and the appropriate anatomical site is selected which causes the corresponding radiograph to be retrieved from stor age and displayed When processing intra oral radio graphs the icon can take the form of a dental film holder with the positions of the film holder corre sponding to anatomical sites readily recognized by den tists each position of the film holder being arranged in anatomical relation to other positions of the film holder icon An image of dentition for example a dental arch can also be used as an icon to facilitate the storage and display of intra oral radiographs 5 Claims 5 Drawing Sheets U S Patent Jan 12 1993 Sheet 1 of 5 5 179 579 22 PROGRAM LOAD
47. e DPX_ChangeMode Handle the worked associated with changing modes If switching to automatic mode wP TRUE destroy the sub window if there is one Then determine if this window is to be removed When switching to manual mode just clear the removed field GetClientRect wnd amp rect if wP imageWnd GetWindowWord wnd 0 if imageWnd DestroyWindow imageWnd SetWindowWord wnd 0 0 InvalidateRect wnd amp rect FALSE X selWindow GetWindowWord GetParent wnd 0 if selWindow GetWindowWord wnd GWW_ID SetWindowWord wnd 0 TRUE InvalidateRect wnd amp rect FALSE x if else SetWindowWord wnd 0 FALSE InvalidateRect wnd amp rect FALSE if break case DPX_ChangeImage SetWindowWord wnd 0 wP GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE break case WM_DESTROY On a destroy message if in manual mode the sub image should be removed imageWnd GetWindowWord wnd 0 if IsWindow imageWnd DestroyWindow imageWnd if break case WM_SYSCOLORCHANGE On a color change all child windows which have a non zero value amp in word 0 should be re drawn to take into account a possible change in background color if GetWindowWord wnd 0 GetClientRect wnd amp rect InvalidateRect wnd amp rect ees if case WM_PAINT manualMode SendDlgItemMessage gPatDlg IDC_PTD_MANUAL
48. e in a form that allows for case insensitive lookups Middle name case insensitive Last name case insensitive Patient s date of birth First name as entered by user Middle name Last name Patient s chart number Study modality Integer from enum Type of exam Integer from enum Date of examination Time of examination X dimension of study i k Y size of images Name of referring service Name of referring doctor Image filename 5 179 579 9 10 char disk_label 13 Label of disk in which image file iss short status Interpretation status Integer from en char comments MAX_COMMENT Comments Variable length StudiesRecord FAR StudiesPtr typedef struct char disk_label 13 unsigned long last_file unsigned long capacity unsigned long volume DiskRecord FAR DiskPtr typedef enum portrait TRUE landscape FALSE Orientations typedef struct POINT corner Position of upper left corner in mm BOOL portrait x ray is oriented portrait in holder ImageInfo NEAR ImageInfoPtr typedef struct char far name Name to be displayed int numImages Number of images in study short mmWidth Width of holder in mn short mmHeight Height of holder in mn ImageInfo images 24 Data for each image in holder ModeInfo NEAR ModeInfoPtr typedef enum January 0 February March Apr
49. e instance of the application int PASCAL WinMain HANDLE instance HANDLE prev LPSTR cmdLine int cmdShow MSG msg char acquireString 64 int px py ix iy BOCL found if prev return FALSE else if InitApplication instance return FALSE if if i Perform initializations that apply to a specific instance A if HnitInstance instance cmdShow return FALSE I Set the acquired image sizes based upon values in the win ini file GetProfileString gAppName Acquire sizes nzi acguireString 64 if acquireString 0 z px 1024 py 512 ix 384 iy 576 found FALSE else sscanf acquireString d d d d amp px amp py amp ix amp iy found TRUE ES SetAcquireDim pano_mode px py FALSE 5 179 579 97 98 SetAcquireDim intra_mode ix iy found gAcquiring FALSE r s Initially we would like the about box displayed so we will post a fake WM_COMMAND message to the main window PostMessage gMainWindow WM_COMMAND IDM About 0 J Acquire and dispatch messages until a WM_QUIT message is received while GetMessage amp msg NULL NULL NULL if IeDialogMessage gPatDlg amp msg amp amp lisDialogMessage gAcaDlg amp msd TranslateMessage amp msa DispatchMessage amp msg if while i Got to close the database s CloseDB i Free up the global memory we allocated GlobalF
50. e intra mode intra_x X intra_y y break switch if rewrite wsprintf textBuffer ld ld ld ld pano_x pano_y intra_x intra_y WriteProfileString gAppName Acquire sizes textBuffer 7 if SetAcquireDim je GetAcquireDim This routine returns the acquire sizes for a study of the indicated size void GetAcquireDim Modalities modality short x short y switch modality case pano_mode x pano_x y pano_y break case intra_mode x intra_x 151 5 179 579 152 y intra_y break switch 1 GetAcquireDim AcquirePano Local routine to contro the acquisition of a panoramic X Ray static BOOL AcquirePano HANDLE buffer return TRUE AcquirePano Lu Acauirelntra Local routine to control the acquisition of a series of intraoral x rays ri N static BOOL Acauire ntra HANDLE buffer return TRUE Acquirelntra AcquireStudy This routine controls the acquisition of any type of study Naturally it makes heavy use of the more specific local routines in this source file It acquires based upon the study stored in the global study record BOOL AcquireStudy HANDLE buffer BOOL retVal TRUE StudiesPtr s StudiesPtr GlobalLock ghStudy Modalities mode Modalities s gt modality GlobalUnlock ghStudy switch mode case pano_mode retVal AcquirePano buffer break case intra_
51. e mouse down code if wP break case WM_LBUTTONDOWN First get the current image number from the extra area and compute the new selected image s StudiesPtr GlobalLock ghStudy oldSelected GetWindowWord wnd 2 newSelected oldSelectedti1 tNumImages s if s gt modality intra_mode Notify the template window which will control the changing of the image PostMessage gTemplateWnd DPX_ChangeImage newSelected 0 if 1obaltniock ghstudy break case DPX_ChangeImage s TstudiesPtr GlobalLock ghStudy i ChangeImage wnd s GetWindowWord wnd 2 wP GlobalUnlock ghStudy A break default retVal DefWindowProc wnd msg wP 1P break switch return retVal AutomaticWindow ManImage c This file contains the callback routine for the window which is used to display images in manual mode This window has a caption and can be resized When the window is not large enough for the whole image then scroll bars are shown to allow the user to view different portions of the image Change log 04 15 91 CDW Changed to use built in scroll bars 5 179 579 23 24 amp include windows h include btrieve h include wdpx h include resource h include wdpxdlg h pragma hdrstop include study h include manimage h include messages h AdjustScrollBars Local routine to resize and adjust the scrol
52. e the comments entry window LoadString ginst IDS_CommentsTitle aString 31 gCommentWnd CreateWindow commentWClass aString WS_OVERLAPPED WS_MAXIMIZEBOX screenX 200 2 mainWY 30 400 200 gPatDig NULL hinstance NULL r If window could not be created return failure if igCommentWna return FALSE Create the template window but leave it hidden Fill in the extra words GetWindowRect gPatDig amp rect patRight rect right patBottom rect bottom gTemplateWnd CreateWindow templateWClass NULL WS_POPUP WS_BORDER patRight 1 mainWY 1 screenx patRight 2 patBottom mainWY 2 gMainWindow NULL hinstance NULL if IgTemplateWnd return FALSE er Create the tool window where x GetSystemMetrics SM_CXSCREEN 200 where y GetSystemMetrics SM_CYSCREEN 2 gToolWnd CreateToolWindow hInstance Tools amp where SetWindowWord gTemplateWnd TMPL_W_ImageNumber 0 SetWindowWord gTemplateWnd TMPL_W_FreeLeft patRight 1 SetWindowWord gTemplateWnd TMPL_W_FreeTop mainWY 1 5 179 579 95 96 SetWindowWord gTempiateWnd TMPL_W_FreeWidth screenX patRight 2 SetWindowWord gTemplateWnd TMPL_W_FreeHeight patBottom mainWY 2 gResultsWnd NULL je Open the database All done everything was successful return TRUE InitInstance WinMain Calls initialization function processes message loop We allow only on
53. eateTemplate HWND wnd StudiesPtr study int wheight wwidth long top left height width int twidth theight int images ExamTypes exam_type Orientations 0 int ellipse int i RECT rect Get the size of the window GetClientRect wnd amp rect wwidth rect right _wheight rect bottom study StudiesPtr GlobalLock ghStudy Get the information to compute the scaling factor for this template exam type study gt exam_type twidth intra_modes exam_type mmWidth theight intra_modes exam_type mmHeight images intra_modes exam_type numImages Now use these values to create the sub windows for the template width 40L width twidth height 30L wheight theight ellipse 5L wwidth twidth for i 0 i lt images i 1 HWND child int w h left intra_modes exam_type images i corner x top intra_modes exam_type images i corner y o intra modes exam type images iJ portrait left left wwidth twidth top top wheight theight w o landscape width height h o landscape height width child CreateWindow templateChildwWclass NULL WS_CHILDWINDOW WS_VISIBLE left top 5 179 579 51 52 h wnd i GetWindowWord wnd GWW HINSTANCE NULL if chila MessageBox wnd Cannot create template NULL MB_OK MB_SYSTEMMODAL MB_ICONSTOP it amp SetWindowWord child 0 0 for
54. emplateWindow This is the main callback routine for the window which is used to display a template for retrieving intraoral images WINDOW_PROC TemplateWindow HWND wnd WORD msg WORD wP LONG IP LONG retVal NULL StudiesPtr study FARPROC enumProc RECT rect HWND cWnd switch msg case WM_SYSCOLORCHANGE i Create a new brush the same color as the background and invalidate all the children who are affected DeleteObject ghChildBrush ghChildBrush CreateSolidBrush GetSysColor COLOR_BACKGROUND enumProc MakeProcinstance FARPROC ColorChangeEnum ginst EnumChildWindows wnd enumProc 0 FreeProcinstance enumProc break case DPX_StartAcauire enumProc MakeProcinstance FARPROC StartAcquireEnum ginst EnumChildWindows wnd enumProc 0 FreeProcinstance enumProc break case DPX ChangeStudy if IgAcquiring Fe Here if the current study is an intraoral display the appropriate 5 179 579 135 136 template study StudiesPtr GlobalLock ghStudy if study gt modality intra mode ShowWindow wnd SW HIDE DestroyTemplate wnd SizeTemplate wnd study CreateTemplate wnd ShowWindow wnd SW SHOW SetWindowWord wnd TMPL_W_ImageNumber 0 ki Keep the image handle SetClassWord GetWindow wnd GW_CHILD TCHILD_C_ImageHandle wP SetClassWord GetWindow wnd GW_CHILD TCHILD_C_Message msg else ShowWindow wnd SW_HIDE DestroyTemp
55. ent region is the entire area inside the borders Check to see if that is enought space in which to display the entire image if newz lt x_size newY lt y size int newMax Scroll bars need to be shown Start with the horizontal since we already have its range newMax x_size newX xvScroll 1 SetScrollRange wnd SB_HORZ 0 newMax FALSE SetScrollPos wnd SB_HORZ 0 FALSE Now for the vertical scroll bar amp 5 179 579 25 26 GetScrollRange wnd SB VERT amp oldMin amp oldMax newMax y size newY yhScroll 1 SetScrollRange wnd SB_VERT 0 newMax FALSE SetScrollPos wnd SB VERT 0 FALSE else amp amp The scroll bars can remain invisible Just cause the image to be redrawn WA GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE y if s else k Since the scroll bars are currently visible the client rectangle excludes the space for the scroll bars To determine if the window is big enough for the whole image we need to add in the area of the scroll bars if newXt xvScroll lt x_size newy yhScroll lt y_size int newMax int hPos vPos This window will still not be large enough for the whole image so we should invalidate the current client area and let the partial image be redrawn Li GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE Now rescale the s
56. epresentation of a program of instructions adaptable to be executed by said machine to perform the method of any one of claims 1 or 2 4 A device for storing and displaying intra oral radi ographs comprising an x ray source a sensor for producing x ray images of dentition placed between said source and said sensor a memory in which said x ray images are stored a display means for generating and displaying on said display a representation of an intra oral radiograph holder including selectable intra oral radiological sites arranged according to anatomical location of said sites and means responsive to selection of said selectable sites for displaying corresponding stored x ray images 5 The device of claim 4 further comprising an image digitizer for digitizing x ray images pro duced by said sensor before storage in said mem ory
57. er k theDib gt bmiHeader biSize long sizeof BITMAPINFOHEADER theDib gt bmiHeader biWidth 0 theDib gt bmiHeader biHeight 0 theDib gt bmiHeader biPlanes 1 theDib gt bmiHeader biBitCount 8 theDib gt bmiHeader biCompression BI_RGB theDib gt bmiHeader biSizeImage OL theDib gt bmiHeader bixXPelsPerMeter OL theDib gt bmiHeader biyPelsPerMeter OL theDib gt bmiHeader biClrUsed OL theDib gt bmiHeader biClrImportant OL amp Fill the color table for i 0 i lt 256 i 1 theDib gt bmiColors i rgbRed theDib gt bmiColors i rgbGreen theDib gt bmiColors i rgbBlue BYTE i for 5 179 579 59 60 All done with the display context GlobalUnlock hDib if return hDib CreateGrayDIB FUNCTION InitApplication HANDLE PURPOSE Initializes window data and registers window class COMMENTS This function is called at initialization time only if no other instances of the application are running This function performs initialization tasks that can be done once for any number of running instances In this case we initialize a window class by filling out a data structure of type WNDCLASS and calling the Windows RegisterClass function Since all instances of this application use the same window class we only need to do this when the first instance is initialized e OF OF OF EO OO OE OO WA pragma warn sus static BOOL InitApplica
58. ewP 1 oldP width 5 179 579 125 126 for _ EndBlockDisplay hDC GlobalUnlock oldData GlobalUnlock newData ReleaseDC wnd hDC SetCursor oldCursor return newData Rotate180 Rotate270 HANDLE FAR Rotate270 HWND wnd LPRECT where HANDLE oldData char huge oldP huge o huge newP int x y HDC hDC int width height long size HANDLE newData HCURSOR oldCursor oldCursor SetCursor LoadCursor NULL IDC_WAIT PF First create a display context and select the gray palette into it hDC GetDC wnd SelectPalette hDC gPalette 0 RealizePalette hDC Now set the dimensions of the image using the rectangle width where gt right where gt left height where gt bottom where gt top We will need a new buffer to hold the image while we rotate it size long width long height newData GlobalAlloc GMEM_MOVEABLE size if newData NULL return NULL ia Lock both the data handles oldP GlobalLock oldData newP GlobalLock newData PF Now do the rotation It can be done by copying columns from the old image starting from the right into rows of the new image starting at the bottom We must keep in mind that the orientation has been changed newP size StartBlockDisplay where width 127 5 179 579 128 for y 0 y lt height y 1 o oldP for x 0 x lt width x 1
59. gRect bottom dragRect top 1 wnd NULL glnst NULL SetWindowWord imageWnd MAN W ImageNumber GetWindowWord wnd GWW ID SetClassWord imageWnd MAN_C_ImageHandle GetClassWord wnd TCHILD_C_ mageHandle SetWindowWord wnd TCHILD_W_Data imageWnd GetClientRect wnd amp rect InvalidateRect wnd amp rect FALSE ShowWindow imageWnd SW_SHOW else retVal DefWindowProc wnd msg wP IP bi break default retVal DefWindowProc wnd msg wP IP break i switch return retVal TemplateChildWindow void SetAcquireDim Modalities modality int x int y BOOL rewrite void GetAcquireDim Modalities modality short x short y BOOL AcquireStudy HANDLE buffer void AcquisitionToo lPalette void 5 179 579 149 150 include windows h include btrieve h include wdpx h include resource h include wdpxdilg h pragma hdrstop include acquire h include acgcnti h include study h include studydb h include toolwnd h include utils h include wndwords h include lt io h gt static char textBuffer 128 static long intra_x static long intra_y static long pano_x static long pano y SetAcquireDim This routine is called whenever the user changes the size of acquired images y void SetAcquireDim Modalities modality int x int y BOOL rewrite switch modality case pano_mode pano_x X pano_y y break cas
60. he non modal dialog which displays the information about the current patient and image set EXTERN HWND gCommentWnd Handle to the comments entry window EXTERN HWND gTemplateWnd Handle to the template window EXTERN HANDLE ghPatient Global patient record used by dialog callback routines EXTERN BOOL gIsAPatient Is there a patient record in gPatient EXTERN HANDLE ghStudy Global studies record used by dialog caliback routines EXTERN BOOL gIsAStudy Is there a study record in gStudy EXTERN HANDLE ghDisk Global disks database record EXTERN char gOpenName 132 Global filename buffer The result of calling the GetFile dialog is placed in this buffer EXTERN char gPatPB 128 Patient file position block EXTERN char gStudyPB 128 Study file position block EXTERN char gDiskPB 128 Disk file position block EXTERN HWND gimageWnd Handle to the currently active image window EXTERN HWND gResultsWnd Handle to the results window EXTERN HANDLE ghDIB Handle to a 256 gray DIB EXTERN HBRUSH ghChildBrush Handle to the brush used to paint the template child windows EXTERN HPALETTE gPalette Handle to palette containing gray levels About c This source file contains the callback routine for the About box dialog Change log 04 15 91 CDW Added WM_INITDIALOG processing to center box on monitor include wind
61. hich is being displayed This routine does not do the painting just updates the information and invalidates the window static void ChangeImage HWND wnd StudiesPtr s int old int new RECT winRect amp Store the new selected image in the window SetWindowWord wnd 2 new Resize the image if the orientation changes if intra_modes s gt exam_type images old portrait intra_modes s gt exam_type images new portrait SizeTheWindow wnd s new if Have the whole thing redrawn WA GetClientRect wnd amp winRect InvalidateRect wnd amp winRect FALSE ChangeImage AutomaticWindow This is the main callback routine for the window which is used to display automatic images WINDOW_PROC AutomaticWindow HWND wnd WORD msg WORD wP LONG 1P LONG retVal NULL HDC hDC char huge theBits HANDLE hBits RECT winRect 5 179 579 19 20 PAINTSTRUCT ps LPBITMAPINFO theDib long which StudiesPtr s int newSelected oldSelected int width height srcY srcX switch msg case WM CREATE When the window is created we need to size it appropriately for the first image s StudiesPtr GlobalLock ghStudy SizeTheWindow wnd s 0 GlobalUnlock ghStudy break case WM_DESTROY break case WM_PAINT Aa Lock the bits handle amp hBits theBits ja Lock the DIB handle theDib LPBITMAPINFO GlobalLock ghDIB
62. ic int BLOCK width define LINESINABLOCK 16 amp static void StartBlockDisplay LPRECT bound int width BLOCK left bound gt left BLOCK_top bound gt top BLOCK width width BLOCK_data NULL 7 StartBlockDisplay static void DisplayALine HDC hDC char huge data LPBITMAPINFO theDib if BLOCK_data NULL BLOCK data data BLOCK count 0 i BLOCK data data BLOCK count 1 if BLOCK count LINESINABLOCK theDib LPBITMAPINFO GlobalLock ghDIB theDib gt bmiHeader biWidth BLOCK widih theDib gt bmiHeader biHeight BLOCK_count 5 179 579 115 116 StretchDIBits hDC BLOCK left BLOCK top BLOCK width BLOCK count 0 0 BLOCK width BLOCK count LPSTR BLOCK data theDib DIB_RGB_COLORS SRCCOPY GlobalUnlock ghDIB BLOCK_data NULL BLOCK_top LINESINABLOCK if 7 DisplayALine static void EndBlockDisplay HDC hDC LPBITMAPINFO theDib if BLOCK_data NULL theDib LPBITMAPINFO GlobalLock ghDIB theDib gt bmiHeader biWidth BLOCK widih theDib gt bmiHeader biHeight BLOCK_count StretchDIBits hDC BLOCK left BLOCK_top BLOCK_width BLOCK_count 0 0 BLOCK width BLOCK count LPSTR BLOCK data theDib DIB RGB COLORS SRCCOPY GiobalUnlock ghDIB if EndBlockDisplay FlipHorizontal This routine rotates the image about its x axis HANDLE FAR FlipHorizontal HWND wnd LPRECT where H
63. il May June July August September October Novenber December monthEnun typedef unsigned char far ImagePtr Global data Most global variable names begin with the letter g ifndef EXTERN define EXTERN extern EXTERN char gAppName EXTERN char month_names 12 EXTERN char month_abbrs 12 EXTERN int month days 12 EXTERN char far mode_strings EXTERN ModeInfo pano_modes EXTERN ModeInfo intra_modes EXTERN char far interp_strings else The application name char gAppName WDPX Stuff for converting dates char month_names 12 January February March April May June July August September October November December ya char month_abbrs 12 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Ja int month days 12 31 28 31 30 31 30 31 31 30 31 30 31 5 179 579 11 12 Strings which appear in the modality exam type and interpretation status drop down boxes char far mode_strings Panoramic Intraoral Extraoral Cephalometric 0 Ja ModeInfo pano modes Complete 1 00 0 0 0 0 0 ModeInfo intra_modes FMX 20 20 345 124 4 10 landscape 49 10 landscape 4 48 landscape 49 48 landscape 4 87 landscape 49 87 landscape 100
64. images WINDOW_PROC TemplateWindow HWND wnd WORD msg WORD wP LONG 1P LONG retVal NULL StudiesPtr study FARPROC enumProc switch msg case WM_DESTROY break case WM_SYSCOLORCHANGE Create a new brush the same color as the background and invalidate all the children who are affected DeleteObject ghChildBrush ghcChildBrush CreateSolidBrush GetSysColor COLOR_BACKGROUND enumProc MakeProcInstance FARPROC ColorChangeEnum gInst EnumChildWindows wnd enumProc 0 FreeProcinstance enumProc break case DPX_ChangeStudy amp Here if the current study is an intraoral display the appropriate template WA study StudiesPtr GlobalLock ghStudy if study gt modality intra_mode ShowWindow wnd SW_HIDE DestroyTemplate wnd SizeTemplate wnd study CreateTemplate wnd ShowWindow wnd SW SHOW SetWindowWord wnd 0 0 Keep the image handle SetClassWord GetWindow wnd GW CHILD 2 wP else ShowWindow wnd SW_HIDE DestroyTemplate wnd if GlobalUnlock ghStudy break case DPX_ClearPatient case DPX_ChangePatient In either of these cases we should hide the window and destroy all the child windows ShowWindow wnd SW HIDE DestroyTemplate wnd break case DPX ChangeImage Tell the image window and the two children involved that the image has changed PostMessage GetDlgItem wnd GetWindowWord wnd 0 DPX
65. ion of the anatomy from which the images were taken The system user selects the image to be displayed by selecting the appropriate ana tomical site from the representation of anatomical sites or portion of anatomy The preferred application for the present invention is in intra oral radiology In such an application sets of stored radiographs are displayed by using a representa tion of a dental film holder or of dentition such as a dental arch The system user selects the portion of the representation corresponding to the desired image to be displayed and the desired image is then retrieved and displayed Use of a representation of a dental film holder permits a dentist to use his or her knowledge of the anatomical significance of the positions of the mounting positions in the film holder Thus the present invention combines the organiza tional and interpretational advantages of film holders with the advantages of digital x ray imaging techniques REFERENCE TO APPENDIX A source code listing of a computer program that embodies the present invention is included in an Appen dix to this patent document BRIEF DESCRIPTION OF THE DRAWINGS FIG 1 is an apparatus embodying the present inven tion FIG 2 is a screen display in accordance with the present invention produced by the apparatus of FIG 1 FIG 3 is another screen display in accordance with the present invention produced by the apparatus of FIG 1 FIGS 4A and 4B
66. is local routine does all the work involved in sizing the window in the open area under the patient display ae box taking the study type and image orientation into account static void SizeTheWindow HWND wnd StudiesPtr s int which int width height int screenx screeny int borderX borderY int nX nY nW nH RECT ptdRect ya First we take the exam type into account to compute the expected width and height of the image GetstudyDimensions s which amp width amp height Some metrics we can use here border GetSystemMetrics SM_CXBORDER borderY GetSystemMetrics SM_CYBORDER 5 179 579 17 18 width 2 borderX height 2 borderY Center the image horizontally in the space available screenX GetSystemMetrics SM_CXSCREEN if width gt screenx nX 0 nW screenX else nX screenX width 2 nW width if Center the image vertically making sure not to overrun into the patient display WA GetWindowRect gPatDlg amp ptdRect screenY GetSystemMetrics SM_CYSCREEN if screenY height lt ptdRect bottom ny ptdRect bottom nH screenY nyY else ny ptdRect bottom screenY ptdRect bottom height 2 nH height if And now actually move the window MoveWindow wnd nX nY nW nH FALSE SizeTheWindow ChangeImage Local routine to change the image w
67. l bars when the window is resized static void AdjustScrollBars HWND wnd DWORD 1P int newX newY int xvScroll yhScroli long which StudiesPtr s int x_size y_size RECT rect int oldMin oldMax First g t the system metrics for scroll bars xvScroll GetSystemMetrics SM_CXVSCROLL yhScroll GetSystemMetrics SM_CYHSCROLL Extract the new height and width of the window from the message newX LOWORD 1P newY HIWORD 1P The index for this window is stored in the second extra word We need to get the size of intraoral images in this study so that we can decide whether or not to show the scroll bars which long GetWindowWord wnd 0 s StudiesPtr GlobalLock ghStudy GetStudyDimensions s which amp x_size amp y_size GlobalUnlock ghStudy All set now for the real purpose for this work If the visibility of the scroll bars changes we need only reset the ranges of the scroll bars This will trigger a new WM_SIZE message If the visibility does not change then we can invalidate the window to cause the re display of the image The first thing to do it find out if the scroll bars are currently visible since this affects the computation of whether they ought to be visible as a result of resizing the window amp GetScrollRange wnd SB_HORZ amp oidMin amp oldMax if oldMin oldMax The scroll bars are currently not visible so the cli
68. late wnd it GlobalUnlock ghStudy if break case DPX_EndAcauire If wP is TRUE then the acquisition was completed normally The window need to remain but changing over into study review mode Otherwise we can just fall through into the close up case if wP break if case DPX_ImagePlaced When we get an image stored message we need to update the child cWnd GetDigltem wnd wP SetWindowWord cWnd TCHILD W Data 1 GetClientRect cWnd amp rect InvalidateRect cWnd amp rect FALSE break case DPX ClearPatient case DPX_ChangePatient In any of these cases we should hide the window and destroy and the child windows ShowWindow wnd SW_HIDE DestroyTemplate wnd break case DPX_Changelmage t s Tell the image window and the two children involved that the image has changed PostMessage GetDigltem wnd GetWindowWord wnd TMPL_W_ImageNumbenr DPX_Changelmage 5 179 579 137 138 FALSE 0 PostMessage GetDigltem wnd wP DPX Changelmage TRUE 0 PostMessage glmageWnd DPX Changelmage wP 0 SetWindowWord wnd TMPL W ImageNumber wP break case DPX ChangeMode J Hide or show the window based upon the value of wP If changing to automatic mode teli each child so that they can get rid of the manual image window associated lf switching to manual mode we need only tell the selected child WP TRUE gt switching to automa
69. ld 53 appear in normal anatomical relation to one another In addition although the icon illustrated in FIG 3 comprises an image of a full mouth examination 20 film holder different examinations may require different icons For example the icon appearing in icon field 53 for a 2 film bitewing examination would be that of a 2 film holder for example as shown in FIGS 5A 5B or 5C described in more detail below 5 179 579 5 The flow charts of FIGS 4A and 4B reveal the oper ation of the apparatus of FIG 1 in combination with the display screens of FIGS 2 and 3 to practice the method of the present invention FIG 4A relates to capturing and storing radiographs according to the present inven tion whereas FIG 4B relates to retrieving and display ing stored radiographs in accordance with the present invention Referring to FIG 4A after the process has begun in block 76 a user enters patient specific data using patient query dialog field 36 shown in FIG 2 Then in block 76 the user enters exam study selection data using exam study selection dialog field 37 also shown in FIG 2 Then control passes to block 78 where the display of FIG 3 is presented along with an appropriate icon in icon field 53 in accordance with the examina tion data entered in blocks 76 and 77 Control then passes to block 79 where using x ray source 33 sensor 29 and digitizer 32 FIG 1 an x ray image is captured and displayed in field 54 of FIG
70. lidateRect wnd amp rect FALSE if case WM PAINT manualMode SendDig temMessage gPatDlg IDC PTD MANUAL BM GETCHECK 0 0 if gAcquiring removed GetWindowWord wnd TCHILD_W_Data if manualMode imageWnd GetWindowWord wnd TCHILD_W_Data removed imageWnd 0 amp amp IsWindowVisible imageWnd Temoved GetWindowWord wnd TCHILD W Data BIA GetClassWord wnd TCHILD_C_ Ellipse f Get a device context i BeginPaint wnd amp ps a Get the correct brush with which to fill the rectangle if removed oldBrush SelectObject hDC ghChildBrush else oldBrush SelectObject hDC GetStockObject DKGRAY_BRUSh i Fill the window or a rounded rectangle version of it GetClientRect wnd amp rect RoundRect hDC 0 0 rect right rect bottom ellipse ellipse r Clean up SelectObject hDC oldBrush EndPaint wnd amp ps break 5 179 579 143 144 case WM_LBUTTONDOWN r Check to see if the program is in automatic or manua mode manualMode SendDigltemMessage gPatDig IDC_PTD_MANUAL BM_GETCHECK 0 0 if manualMode ir Manual mode If this image is already in a window bring it to the front Otherwise capture the mouse and begin dragging an outline around imageWnd GetWindowWord wnd TCHILD W Data if imageWna if IsWindowVisible imageWnd SetFocus imageWnd else ShowWindow imageWnd SW_SHOW GetClientRect wnd am
71. mode retVal Acaquirelntra buffer break default wsprintf textBuffer I do not know how to acquire Yos images mode_strings s gt modality MessageBox GetFocus textBuffer Acquire Problem MB_OK MB_ICONINFORMATION MB_APPLMODAL retVal FALSE break 7 switch return retVal AcquireStudy AcquisitionToolPalette 5 179 579 153 154 This routine adds the acquisition tools to the tool window and displays the window void AcquisitionToolPalette void HICON thelcon PF l the tool window is visible hide it if lsWindowVisible gToolWnd ShowWindow gToolWnd SW_HIDE Remove all tools from the window SendMessage gToolWnd TM_ClearTools 0 0 ia Now lead each icon and add the tools First the flip horizontal tool thelcon Loadicon gI nst Flip Around Horax SendMessage gToolWnd TM_AddTool thelcon 0 I Now the flip vertical tool thelcon Loadicon gInst Flip Around Vert SendMessage gToolWnd TM_AddTool thelcon 0 Now the rotate 90 tool thelcon Loadicon gInst Rotate 270 SendMessage gToolWnd TM_AddTool thelcon 0 jisi Now the rotate 90 tool thelcon Loadicon ginst Rotate 90 SendMessage gToolWnd TM_AddTool thelcon 0 Now the rotate 180 tool thelcon Loadicon ginst Rotate 180 SendMessage gToolWnd TM_AddTool thelcon 0 F Now the auto drop tool thelcon
72. ng 64 int px py ix iy BOOL found if prev return FALSE else if InitApplication instance return FALSE if if Perform initializations that apply to a specific instance if InitInstance instance cmdShow return FALSE x Set the acquired image sizes based upon values in the win ini file GetProfileString gAppName Acquire sizes Le Abie acquireString 64 if acquireString 0 z px 1024 py 512 384 iy 576 found FALSE else sscanf acquireString td d d d amp px amp py kik amp iy 5 179 579 69 70 found TRUE y if SetAcguireDim pano mode px py FALSE SetAcquireDim intra_mode ix iy found Initially we would like the about box displayed so we will post a fake WM_COMMAND message to the main window PostMessage gMainWindow WM_COMMAND IDM_About 0 Acquire and dispatch messages until a WM_QUIT message is received amp while GetMessage amp msg NULL NULL NULL if gPatDlg NULL IsDialogMessage gPatDlg amp msg TranslateMessage amp msq DispatchMessage amp msg f if while Got to close the database CloseDB Free up the global memory we allocated WA GlobalFree ghPatient GlobalFree ghStudy GlobalFree ghDisk Get rid of the GDI objects we created DeleteObject gPalette DeleteObject ghChildBrush return msg
73. none Window 0 Handle to image data 2 Image index we style NULL we lpfnWndProc FARPROC AutomaticWindow wo cbClsExtra 0 wo cbWndExtra 4 wce hinstance hinstance we hicon NULL we hCursor LoadCursor NULL IDC ARROW we hbrBackground GetStockObject BLACK _BRUSH NULL templateWClass wc lpszMenuName we lpszClassName Register the window class if RegisterClass amp wc return FALSE Fill in window class structure with parameters that describe the template window We keep 2 extra bytes around so that the window can keep track of which image is current and 8 bytes to keep the rectangle of the free area we style NULL we lpfnWndProc FARPROC TemplateWindow we cbClsExtra 0 we cbWndExtra 10 we hInstance hInstance we hicon NULL we hCursor LoadCursor NULL IDC ARROW we hbrBackground GetStockObject BLACK_BRUSH GetStockObject BLACK_BRUSH NULL templateChildWClass we hbrBackground wc lpszMenuName wc lpszClassName 4 Register the window class amp f if RegisterClass amp wc return FALSE Register the class that defines the child windows used in the template window Extra data Class 0 Ellipse value 2 Image data handle Window 0 Selected or handle to image window wc style NULL we ipfnWndProc FARPROC TemplateChildWindow wo cbClsExtra 4 we cbWndExtra 2 we hi
74. nstance hinstance wc hIcon NULL wc hCursor LoadCursor NULL IDC ARROW Register the class that defines the windows used in manual image display mode i Extra data 5 179 579 63 64 Class 0 Handle to image data Window 0 Number of image we style NULL we lpfnWndProc FARPROC ManualImageWindow we cbClsExtra 27 vwc cbwndExtra 2 WC hinstance hInstance wc hIcon NULL wc hCursor wc hbrBackground we lpszMenuName wc lpszClassName Register the window class amp if RegisterClass amp wc return FALSE LoadCursor NULL IDC ARROW GetStockObject BLACK BRUSH NULL manualWClass tniunrn dn nt te tt Everything worked return TRUE return TRUE InitApplication pragma warn sus e He HF HF OF OO OO FUNCTION InitInstance HANDLE int PURPOSE Saves instance handle and creates main window COMMENTS l This function is called at initialization time for every instance of this application This function performs initialization tasks that cannot be shared by multiple instances In this case we save the instance handle in a static variable an create and display the main program window static BOOL InitInstance HANDLE hinstance int nCmdShow FARPROC digProc int screenx mainWY RECT rect int patRight patBottom char aString 32 Save the instance handle in static variable which will be used in any subseque
75. nt calls from this application to Windows ginst hInstance Initialize other global variables gisAPatient gIsAStudy FALSE ghPatient GlobalAlloc GMEM_MOVEABLE GMEM_ZEROINIT sizeof PatientRecord ghStudy GlobalAlloc GMEM_MOVEABLE GMEM_ZEROINIT sizeof StudiesRecord GlobalAlloc GMEM_MOVEABLE GMEM_ZEROINIT sizeof DiskRecord ghDisk gImageWnd 0 gPalette CreateGrayPalette if gPalette NULL return FALSE ghDIB CreateGrayDIB if ghDIB NULL return FALSE 5 179 579 65 66 amp we need a brush which we use to paint empty tmeplate child windows We will use a brush the same color as the background ghchildBrush CreateSolidBrush GetSysColor COLOR_BACKGROUND Get the screen sizes which we use to size the windows screenX GetSystemMetrics SM_CXSCREEN mainWy GetSystemMetrics SM_CYCAPTION GetSystemMetrics SM_CYMENU 2 GetSystemMetrics SM_CYBORDER 1 Create a main window for this application instance gMainWindow CreateWindow wdpxWClass WDPX WS_OVERLAPPED WS_CAPTION WS_SYSMENU WS_MINIMIZEBOX WS VISIBLE 0 0 screenx mainWy NULL NULL hinstance NULL yi If window could not be created return failure if qMainWindow return FALSE Create and display the patient info dialog dlgProc MakeProcInstance FARPROC PatientDisplay gInst gPatDlg CreateDialog gIn
76. o fill the template static void CreateTemplate HWND wnd StudiesPtr study int wheight wwidih long top left height width int twidth theight int images ExamTypes exam type Orientations o int ellipse int i RECT rect HWND child is Get the size of the window GetClientRect wnd amp rect wwidth rect right wheight rect bottom study StudiesPtr GlobalLock ghStudy e Get the information to compute the scaling factor for this template exam_type study gt exam_type twidth intra_modes exam_type mmWidth theight intra_modes exam_type mmHeight l images intra_modes exam_type numimages gt Now use these values to create the sub windows for the template vdi 40L wwidth twidth height 30L wheight theight ellipse 5L wwidth twidth for i 0 i lt images i 1 int w h left intra_modes exam_type images i corner x top intra modes exam type images li corner y o intra_modes exam_type images i portrait left left wwidth twidth top top wheight theight 131 5 179 579 132 w o landscape width height h o landscape height width child CreateWindow templateChildWClass NULL WS_CHILDWINDOW WS_ VISIBLE left top W h wnd l GetWindowWord wnd GWW HINSTANCE NULL if Ichild MessageBox wnd Cannot create template NULL MB_OK MB_SYSTEMMODAL MB_ICONSTOP 7 if SetWindowWord
77. or i O i lt 256 i 1 theDib gt bmiColors i rqgbRed theDib gt bmiColors i rgbGreen theDib gt bmiColors i rgbBlue BYTE i for I All done with the display context GlobalUnlock hDib if return hDib 7 CreateGrayDIB FUNCTION InitApplication HANDLE PURPOSE Initializes window data and registers window class COMMENTS h This function is called at initialization time only if no other instances of the application are running This function performs 3 initialization tasks that can be done once for any number of running instances In this case we initialize a window class by filling out a data zi structure of type WNDCLASS and calling the Windows RegisterClass function Since all instances of this application use the same window s class we only need to do this when the first instance is initialized pragma warn sus static BOOL InitApplication HANDLE hlinstance WNDCLASS we Fill in window class structure with parameters that describe the main window we style NULL we lpfnWndProc MainWndProc we cbCisExtra 0 we cbWndExtra 0 wc hinstance hinstance we hicon Loadicon hinstance XRaylcon we hCursor LoadCursor NULL IDC_ARROW we hbrBackground GetStockObject WHITE_BRUSh 5 179 579 85 86 wdpxMenu wc ipszMenuName wdpxWClass wc lpszClassName Register the window class if RegisterClass amp wc
78. ows h include btrieve h include wdpx h include resource h include wdpxdlg h pragma hdrstop include about h x About ae This is the callback for the about box DIALOG PROC About HWND dlg WORD msg WORD wP DWORD 1P BOOL retVal FALSE RECT rect int xScreen yScreen width height 5 179 579 15 16 switch msg case WM INITDIALOG xScreen GetSystemMetrics SM_CXSCREEN yScreen GetSystemMetrics SM_CYSCREEN GetWindowRect dlg amp rect width rect right rect left height rect bottom rect top MoveWindow dlg xScreen width 2 yScreen height 2 width height FALSE retVal TRUE break case WM_COMMAND if wP IDOK wP IDCANCEL EndDialog dlg TRUE retVal TRUE if break switch return retVal About YALI AutoWnd c This source file contains the callback routine for the windows which are used to display the images when in automatic mode This same window is used to display panoramic x rays x Change log 04 09 91 CDW Created and debugged originally 05 03 91 CDW Changed so that window would only use the available space under the ptd dialog include windows h include btrieve h include wdpx h include resource h include wdpxdlg h pragma hdrstop include study h include autownd h include studydb h include messages h SizeTheWindow Th
79. p rect InvalidateRect wnd amp rect FALSE if else int width height s StudiesPtr GlobalLock ghStudy SetCapture wnd i Define the rectangle taking the image orientation into account dragPoint x LOWORD IP dragPoint y HIWORDI IP ClientToScreen wnd amp dragPoint dragRect left dragPoint x dragRect top dragPoint y GetStudyDimensions s GetWindowWord wnd GWW ID amp width amp height dragRect right dragRect left width 2 GetSystemMetrics SM_CXFRAME 1 dragRect bottom dragRect top height 2 GetSystemMetrics SM_CYFRAME GetSystemMetrics SM_CYCAPTION 1 id Now get a device context and draw the first rectangle hDC CreateDC DISPLAY NULL NULL NULL SetROP2 hDC R2_XORPEN SelectObject hDC GetStockObject WHITE_PEN SelectObject hDC GetStockObject NULL_BRUSH Rectangle hDC dragRect left dragRect top dragRect right 145 5 179 579 146 dragRect bottom DeleteDC hDC GlobalUnlock ghStudy br if else J Automatic mode If this image is not already removed send a message to the template indicating the change if GetWindowWord wnd TCHILD_W_Data PostMessage gTemplateWnd DPX_Change mage GetWindowWord wnd GWW ID 0 if 7 if break case WM_MOUSEMOVE if GetCapture wnd Now get a device context undraw the old SEISE and draw the new rectangle s hDC CreateDC DISPLAY NULL NU
80. rd if ghPatient amp amp ghStudy 88 ghDisk return FALSE gimageWnd 0 gPalette CreateGrayPalette if gPalette NULL return FALSE ghDIB CreateGrayDIB if ghDIB NULL return FALSE We need a brush which we use to paint empty tmeplate child windows We will use a brush the same color as the background ghChildBrush CreateSolidBrush GetSysColor COLOR_BACKGROUND Get the screen sizes which we use to size the windows screenX GetSystemMetrics SM_CXSCREEN mainWY GetSystemMetrics SM_CYCAPTION GetSystemMetrics SM_CYMENU 2 GetSystemMetrics SM CYBORDER 1 Create a main window for this application instance gMainWindow CreateWindow wdpxWClass WDPX WS_OVERLAPPED WS_CAPTION WS_SYSMENU WS_MINIMIZEBOX WS_VISIBLE 0 0 screen mainWY NULL NULL hinstance NULL If window could not be created return failure if gMainWindow return FALSE Create and display the patient info dialog digProc MakeProcinstance FARPROC PatientDisplay glnst gPatDig CreateDialog ginst PatientDisplay gMainWindow digProc if gPatDlg NULL return FALSE J 5 179 579 93 94 Create the hidden acquisition control dialog digProc MakeProclinstance FARPROC AcaquireControl ginst gAcqDig CreateDialog ginst AcquireControl gMainWindow dligProc if gAcqDig NULL return FALSE i Creat
81. rd 20 25 30 35 40 45 6 mouse touch screen or any other functionally similar user input device After the particular anatomical site has been selected control passes to block 89 where the image is displayed The steps of blocks 88 and 89 can be repeated to display additional images from the examina tion selected in block 86 The image retrieval and dis play process is then ended Referring now to FIGS 5A S presented are various icons of film holders that can be used in the present invention for displaying in icon field 53 FIG 3 to facilitate user selection of images to be displayed based on desired anatomical site FIGS 5A 5B and 5C are known as 2 film bitewings FIGS 5D and 5F are examples of 3 film bitewings FIG 5E is a 4 film bitewing and FIGS 5G S are ex amples of full mouth surveys having various numbers of films For each of the film holders depicted in FIGS 5A S each of the film positions corresponds to a partic _ular anatomical site within the dental arch FIGS 6 and 7 are examples of different types of graphical representations of dentition that can also be used as the icon displayed in icon field 53 FIG 3 in accordance with the present invention The graphical representation of FIG 6 includes maxillary dental arch 91 and mandibular dental arch 92 The graphical repre sentation of FIG 7 includes a panorama of maxillary dental arch 93 and a panorama of mandibular dental arch 9
82. ree ghPatient GlobalFree ghStudy GlobalFree ghDisk Get rid of the GDI objects we created DeleteObject gPalette DeleteObject ghChildBrush return msg wParam WinMain ifndef TOOLWND_H define TOOLWND_H I The only way to talk about tools is by the handle that this window assigns them typedef short HTOOL w Message sent to add a tool to the tool window wP HICON for icon which should be displayed IP FAR pointer to Tool Proc Return value 5 HANDLE for added tool 5 define TM_AddTool WM_USER 0 Message sent to remove a single tool from the window wP HTOOL of tool to remove 5 179 579 99 100 Je unused Return value TRUE if tool was present define TM RemoveToo WM_USER 1 Message sent to clear all tools from window wP unused IP unused Return value s none define TM ClearTools WM_USER 2 LONG FAR PASCAL _export ToolWindowProc HWND WORD WORD LONG BOOL RegisterToolWindow HWND HWND CreateToolWindow HWND LPSTR LPPOINT Tool procedures are really simple beasts they take no parameters and return no values I typedef void FAR PASCAL ToolProc void endif ToolWnd c This file contains the callback routine for the tool window class Each window requires extra space as follows Class data Window data i 0 2 bytes Handle to array of tool records 2 2 by
83. repy fullFilename drive lstrcat fullFilename lstrcat fullFilename s gt image_file Now open the file f open fullFilename O RDWR O CREAT O BINARY S_IREAD S_IWRITE Now write out the data Clean up close f SetCursor oldcCursor GlobalUnlock hStudy return TRUE SaveStudy LoadStudy This routine manages the file I O needed to retrieve a stored study from disk E BOOL LoadStudy HANDLE hStudy HANDLE buffer StudiesPtr theStudy unsigned char huge pB int file char fullFilename 16 unsigned bytesRead char drive 2 long bytesToRead HCURSOR oldCursor This could take a while display the hourglass cursor 5 179 579 37 38 _oldCursor SetCursor LoadCursor NULL IDC_WAIT Get the drive name from the initialization file GetProfileString gAppName Image Drive G drive 2 Lock the handles theStudy StudiesPtr GlobalLock hStudy pB GlobalLock buffer Open the file for the study istrepy fullFilename drive lstrcat fullFilename lstrceat fullFilename theStudy gt image_file file open fullFilename O_RDONLY Read in the file amp bytesToRead long theStudy 2x size long theStudy gt y_size long NumImages theStudy bytesRead _lread file LPSTR pB BYTES PER IO bytesToRead BYTES PER IO while bytesToRead gt 0 amp amp bytes
84. return FALSE Fill in window class structure with parameters that describe the comments window i I wc style NULL we lpfnWndProc FARPROC StudyComments we cbClsExtra 0 i wc cbWndExtra 0 wc hinstance hinstance wc hlcon NULL we hCursor LoadCursor NULL IDC_ARROW we hbrBackground GetStockObject WHITE_BRUSH we lpszMenuName NULL we lpszClassName commentWClass Register the window class if RegisterClass 8wc ye return FALSE amp Fill in window class structure with parameters that describe the auto image window We keep 2 extra bytes around so that each window can keep track of which image it is and 2 bytes to hold the handle to the image data Extra data Class 0 Handle to image data Window 0 Image index we style NULL we lpfnWndProc FARPROC AutomaticWindow we cbCisExtra 2 we cbWndExira 22 we hinstance hinstance we hicon NULL we hCursor LoadCursor NULL IDC ARROW we hbrBackground GetStockObject BLACK_BRUSH we lpszMenuName NULL we lpszClassName autoWClass Register the window class if RegisterClass amp wc return FALSE Fill in window class structure with parameters that describe the template window Extra data Class none ji 5 179 579 87 88 Window 0 image data 2 Free area left g 4 Free area top la 6 Free area right 4 8 Free area bottom w
85. se The window into which we are to draw has already been re oriented HANDLE FAR Rotate90 HWND wnd LPRECT where HANDLE oldData char huge oldP huge o huge newP int x y HDC hDC int width height long size HANDLE newData HCURSOR oldCursor oldCursor SetCursor LoadCursor NULL IDC_WAIT ja First create a display context and select the gray palette into it 4 i hDC GetDC wnd SelectPalette hDC gPalette 0 RealizePalette nDC J Now set the dimensions of the image using the rectangle E width where gt right where gt left height where gt bottom where gt top i We will need a new buffer to hold the image while we rotate it size long width Iong height newData GlobalAlloc GMEM_MOVEABLE size if newData NULL return NULL i Lock both the data handles oldP GlobalLock oldData newP GlobalLock newData ja Now do the rotation It can be done by copying columns from the old image starting from the right into rows of the new image starting at the bottom We must keep in mind that the orientation has been changed oldP size newP size StartBlockDisplay where width for y 0 y lt height y 1 o oldP for x 0 x lt width x 1 newP o o height for DisplayALine hDC newP 1 oldP for EndBlockDisplay hDC l Clean up 123 5 179 579 ii Global Unlock oldData Glob
86. sitive lookups char key middle name NAME LEN Middle name case insensitive char key last name NAME LEN Last name case insensitive DBDate date of birth Patient s date of birth char first_name NAME_LEN First name as entered by user char middle name NAME_LEN Middle name char Jast_name NAME_LEN Last name PatientRecord FAR PatientPtr typedef struct char chart_number CHART_LEN Patient s chart number short modality Study modality Integer from enum short exam type Type of exam Integer from enum DBDate date_of_exp Date of examination DBTime time_of_exp Time of examination short x_size X dimension of study images 5 179 579 73 74 short y size Y size of images char referring_service NAME_LEN Name of referring service char referring doctor NAME LENJ Name of referring doctor char image_file t 3 Image filename char disk_label 13 Label of disk in which image file is stored short status Interpretation status Integer from enum char comments MAX COMMENT Comments Variable length StudiesRecord FAR StudiesPtr typedef struct char disk_label 13 unsigned long last file unsigned long capacity unsigned long volume DiskRecord FAR DiskPtr typedef enum portrait TRUE landscape FALSE Orientations typedef struct POINT corner Posi
87. st PatientDisplay gMainWindow dlgProc gt if gPatDlg NULL return FALSE Create the comments entry window amp LoadString ginst IDS CommentsTitle aString 31 gCommentWnd CreateWindow commentWClass aString WS_OVERLAPPED WS_MAXIMIZEBOX screenX 200 2 mainWY 30 400 200 gPatDlg NULL hinstance NULL If window could not be created return failure if gCommentWnd return FALSE Create the template window but leave it hidden Fill in the extra words i GetWindowRect gPatDlg amp rect patRight rect right patBottom rect bottom gTemplateWnd CreateWindow templateWClass 5 179 579 67 68 NULL WS_POPUP WS_BORDER patRight 1 mainWY 1 screenX patRight 2 patBottom mainWY 2 gMainWindow NULL hinstance NULL if gTemplateWnd return FALSE SetWindowWord gTemplateWnd 0 0 SetWindowWord gTemplateWnd 2 patRight 1 SetWindowWord gTemplateWnd 4 mainWY 1 SetWindowWord gTemplateWnd 6 screenX patRight 2 SetWindowWord gTemplateWnd 8 patBottom mainWy 2 gResultsWnd NULL Open the database OpenDB All done everything was successful return TRUE InitInstance WinMain Calls initialization function processes message loop We allow only one instance of the application amp int PASCAL WinMain HANDLE instance HANDLE prev LPSTR cmdLine int cmdShow MSG msg char acquireStri
88. t of DIB rect y_size y extent of DIB rect 0 x origin of source 0 y origin of source 0 starting scan line y size number of scan lines LPSTR theBits the bits theDib the DIB DIB_RGB_ COLORS color usage YA Clean up GlobalUnlock ghDIB GlobalUnlock hBits EndPaint wnd amp ps break case WM_SIZE if wP SIZENORMAL amp amp IsWindowVisible wnd AdjustScrollBars wnd 1P break case WM_SYSCOMMAND if wP SC_MINIMIZE wP SC_ICON zi te Whenever the window is minimized the template holder window corresponding to this window should be re drawn ShowWindow wnd SW_HIDE owner GetDligItem gTemplateWnd GetWindowWord wnd 0 GetClientRect owner amp rect InvalidateRect owner amp rect FALSE else if wP SC_MAXIMIZE wP SC_ZOOM POINT rgpt 5 RECT rect When the window is maximized we need to resize the window to its maximum size Send the window a WM_GETMINMAXINFO message to get the maximum size SendMessage wnd WM_GETMINMAXINFO 0 LONG rgpt Now size the window appropriately ad GetWindowRect wnd amp rect MoveWindow wnd rect left rect top rgpt 4 x rgpt 4 y TRUE else retVal DefWindowProc wnd msg wP 1P x if f break ise WM GETMINMAXINFO int xVScroll xFrame yHScroll yFrame yCaption The index for this window is stored in the second ex
89. tes Number of slots in the array Change log K 04 29 90 CDW Created original version include lt windows h gt include toolwnd h Structure containing information about tools typedef struct HICON thelcon The icon which is displayed for this tool long theProcedure The procedure which performs the work ToolRecord FAR LPToolRec ReAllocTools Local routine to allocate a new buffer for the tool records and copy the old tools into the new 5 179 579 101 102 static HANDLE ReAllocTools HANDLE hOld int nOld int nNew HANDLE hNew LPToolRec pOld pNew int i hNew GlobalAlloc GMEM_MOVEABLE nNew sizeof ToolRecord pOld LPToolRec GlobalLock hOld pNew LPToolRec Globallock hNew for i 0 i lt min nOld nNew i 1 pNew i pOld i FR for GlobalUnlock hOld GlobalUnlock hNew GlobalFree hOld return hNew ReAllocTools SizeTheWindow Local routine to size the window to the correct size for the given number of icons static void SizeTheWindow HWND wnd int n int xlcon ylcon xBorder yBorder yCaption RECT rect int rows int width height GetWindowRect wnd amp rect xlcon GetSystemMetrics SM_CXICON ylcon GetSystemMetrics SM_CYICON xBorder GetSystemMetrics SM_CXBORDER yBorder GetSystemMetrics SM_CYBORDER yCaption GetSystemMetrics SM_CYCAPTION rows n 1 2
90. the row and column numbers and from there into a tool number atX xicon 1 atY yicon 1 hTool atY 2 atX J Convert tool number into rectangle SetRect amp rect atX xicon 1 atY yicon 1 atX xlcon 1 xIlcon atY yicon 1 ylcon 5 179 579 105 106 i Get a display context and invert the rectangle hDC GetDC wnd InvertRect hDC amp rect we Call the tool proc hTools GetWindowWord wnd 0 pTools LPToolRec GlobalLock hTools if pTools hTool theProcedure __ ToolProc pTools hTool theProcedure if GlobalUnlock hToois Js Invert the rectangle and free up the display context InvertRect hDC amp rect ReleaseDC wnd hDC break case WM PAINT xlcon GetSystemMetrics SM CXICON ylcon GetSystemMetrics SM_CYICON hTools GetWindowWord wnd 0 pTools LPToolRec GlobalLock hTools nTools GetWindowWord wnd 2 hDC BeginPaint wnd amp ps atX 0 atY 0 for i 0 i lt nTools i 1 f Plot the icon if one is assigned to this slot if pTools i thelcon Drawlcon hDC atX atY pTools i thelcon if Move to draw next icon if i amp 1 I Just drew right side Move down and draw dividing line atX xlcon 1 atY ylcon 1 MoveTo hDC 0 atY 1 LineTa hDC x con 1 xIcon atY 1 else PF Just drew left side Draw vertical divider 7 atX xl
91. tic mode if wP enumProc MakeProcinstance FARPROC ModeChangeEnum ginst EnumChildWindows wnd enumProc wP FreeProclnstance enumProc ShowWindow glmageWnd SW SHOW else PostMessage GetDigltem wnd EUNANA TMPL_W_lmageNumber DPX ChangeMode FALSE 0 ShowWindow glmageWnd SW_HIDE if break default retVal DefWindowProc wnd msg wP IP break switch return retVal TemplateWindow WINDOW_PROC TempiateChildWindow HWND WORD WORD LONG include windows h include btrieve h include wdpx h include resource h include wdpxdig h pragma hdrstop include tmplchld h include messages h include manwnd h include study h include wndwords h Local variables used when dragging the outline of a window which will be used to display the image when the user releases the mouse 5 179 579 139 140 S static RECT dragRect Rectangle most recently drawn static POINT dragPoint Location of last mouse move message TemplateChildWindow This is the main callback routine for the window which is used to display a template for retrieving intraoral images WINDOW_PROC TemplateChildWindow HWND wnd WORD msg WORD wP LONG IP LONG retVal NULL HDC hDC PAINTSTRUCT ps RECT rect BOOL removed HANDLE oldBrush int ellipse HWND imageWnd StudiesPtr s int selWindow BOOL manualMode switch msg
92. tion HANDLE hInstance WNDCLASS wc k Fill in window class structure with parameters that describe the amp main window wdpxMenu wadpxWClass we lpszMenuName wc lpszClassName Register the window class if RegisterClass amp wc return FALSE WA wc style NULL wc lpfnWndProc MainWndProc we cbClsExtra 0 we cbWndExtra 0 wc hinstance hInstance we hiIcon LoadIcon hInstance XRayIcon we hCursor LoadCursor NULL IDC_ARROW we hbrBackground GetStockObject WHITE_BRUSH Fill in window class structure with parameters that describe the comments window we hbrBackground we lpszMenuName GetStockObject WHITE _BRUSH NULL we style NULL we lpfnWndProc FARPROC StudyComments we cbClsExtra 0 we cbWndExtra 0 we hinstance hInstance we hicon NULL we hCursor LoadCursor NULL IDC ARROW we lpszClassName commentWClass Register the window class if RegisterClass amp wc return FALSE Fill in window class structure with parameters that describe the auto image window We keep 2 extra bytes around so that each window can keep track of which image it is and 2 bytes to hold the handle to the image data i ee FF E 5 179 579 NULL autoWClass wc lpszMenuName we lpszClassName Register the window class WA if RegisterClass amp wc return FALSE 61 62 x j amp Extra data Class
93. tion of upper left corner in mm BOOL portrait x ray is oriented portrait in holder Imageinfo NEAR ImagelnfoPtr typedef struct char far name Name to be displayed int numimages Number of images in study short mmWidth Width of holder in mm short mmHeight Height of holder in mm Imageinfo images 24 Data for each image in holder Modetnfo NEAR ModelnfoPtr typedef enum January 0 February March April May June July gt August September October Novenber December monthEnum typedef unsigned char far ImagePtr Global data Most global variable names begin with the letter o ifndef EXTERN define EXTERN extern EXTERN char gAppName EXTERN char month names 12 EXTERN char month abbrs 12 EXTERN int month_days 12 EXTERN char far mode_strings EXTERN Modelnfo pano_modesJ EXTERN Modeinfo intra_modesj EXTERN char far interp_stringsf 5 179 579 75 76 else w The application name char gAppName WDPX Stuff for converting dates char month names 12 January February March April May June July August September October November December char month abbrs 12 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec int month days 12 31 28 31 30 31 30 31 31 30 31 30 31 S
94. tra word WA which long GetWindowWord wnd 0 Get the x and y sizes from the study record s StudiesPtr GlobalLock ghStudy GetStudyDimensions s which amp x_size amp y size GlobalUnlock ghStudy Cast 1P into the correct type rgpt LPPOINT 1P Get the needed system metrics 5 179 579 33 34 amp xVScroll GetSystemMetrics SM CXVSCROLL yHScroll GetSystemMetrics SM CYHSCROLL xFrame GetSystemMetrics SM_CXFRAME yFrame GetSystemMetrics SM_CYFRAME yCaption GetSystemMetrics SM_CYCAPTION Compute the minimum tracking size width CXVSCROLL 2 CXFRAME 128 height CYHSCROLL 2 CYFRAME 1 CYCAPTION 128 pt x xVScroll 2 xFrame 128 pt y yHScroll 2 yFrame 1 yCaption 128 rgpt 3 pt Compute the maximum tracking size which is the size of the original image width 2 CXFRAME x size height 2 CYFRAME 1 CYCAPTION y size pt x 2 xFrame x_size pt y 2 yFrame 1 yCaption y size rgpt 4 pt break case WM_VSCROLL if we SB _ENDSCROLL amp amp wP SB THUMBTRACK ScrollImage wnd SB_VERT wP 1P i break case WM HSCROLL if wP SB ENDSCROLL amp amp wP SB THUMBTRACK ScrollImage wnd SB HORZ wP 1P break aefault retVal DefWindowProc wnd msg WP 1P break switch return retVal TemplateWindow include windows h include btrieve h inclu
95. wClass return RegisterClass amp wc RegisterToolWindow pragma warn sus CreateToolWindow This routine can be used to create a window of the tool window class HWND CreateToo lWindow HWND hinstance LPSTR title LPPOINT where HWND theWindow theWindow CreateWindow ToolWindowClass title WS_OVERLAPPED WS_CAPTION where gt x where gt y 0 0 NULL NULL hinstance NULL return theWindow 7 CreateToolWindow HANDLE FAR FlipHorizontal HWND LPRECT HANDLE HANDLE FAR FlipVertical HWND LPRECT HANDLE HANDLE FAR Rotate90 HWND LPRECT HANDLE HANDLE FAR Rotate180 HWND LPRECT HANDLE HANDLE FAR Rotate270 HWND LPRECT HANDLE 5 179 579 113 114 Tools c This file contains the routines which implement the various image processing tools Change log 04 30 91 CDW Created original version include lt windows h gt include tools h include utils h extern HPALETTE gPalette extern HANDLE ghDIB gt StartBlockDisplay DisplayALine EndBlockDisplay These routines are used to isolate from the tools the buffering of display lines to speed up incremental display All the tools need to do is call StartBlockDisplay before beginning work call DisplayALine for every processed line and EndBlockDisplay when finished static char huge BLOCK_data static int BLOCK_count static int BLOCK left static int BLOCK top stat
96. wParam WinMain Declaration types for callback procedures detine DIALOG_PROC BOOL FAR PASCAL _ export define WINDOW_PROC long FAR PASCAL _export Data type which defines the record which is returned from any of the Get Key routines and an enum that lists all the key numbers typedef enum NoKey 1 IDKey 0 NameKey DoBKey IDStudyKey 0 LabelKey 0 KeyNumber typedef struct KeyNumber keyNo Number of selected key char key 256 String containing key int length i Number of bytes in key KeyRecord KeyRecPtr Database data types typedef struct unsigned char day 5 179 579 71 72 unsigned char month unsigned short year DBDate typedef struct unsigned char hundredths unsigned char seconds unsigned char minutes unsigned char hours DBTime typedef enum pano mode 0 intra_mode extra_mode ceph_mode Modalities typedef enum complete_type 0 fmx20_type 0 fmx14 type bw4 type bw2 type ExamTypes x Database record structures define CHART_LEN 20 define NAME_LEN 20 define MAX_COMMENT 2048 typedef struct char chart_number CHART_LEN short modality short exam type DBDate date_of_exp StudyKey FAR StudyKeyPtr typedef struct char chart_number CHART_LEN Patient s chart number char key first name NAME LEN First name in a form that allows for case insen
Download Pdf Manuals
Related Search
Related Contents
User`s Manual for the Elite Retinoscope Avteq AWM-52T flat panel wall mount IH ELECTRONIC RICE COOKER/WARMER M3 Operation Guide Automated Protocol for Extract-N-Amp™ Tissue - Sigma LE FAFSEA EN LIGNE ET SUR MOBILE Ficha GS1 in Europe Selective Distribution of Cosmetics Guideline Fiche Technique BIOSTART VITALE SK11 Copyright © All rights reserved.
Failed to retrieve file