Académique Documents
Professionnel Documents
Culture Documents
Revision 4.4.0
PLANMECA TWAIN 2014-05-12
Page 2(29)
Planmeca_Twain_Interface.docx 2
PLANMECA TWAIN 2014-05-12
Page 3(29)
PREFACE
Planmeca_Twain_Interface.docx 3
PLANMECA TWAIN 2014-05-12
Page 4(29)
This document describes Planmeca TWAIN Source interface. At the moment the Planmeca TWAIN
layer works on MS Windows and Mac OS X operation systems. (There is a separate document for
Mac OS X.) Use of TWAIN interface to capture medical/dental images maybe subject to regulatory
control and it is the responsibility of the deplorer to ensure that all relevant requirements are
fulfilled. Note! Dimax1 sensor is supported only if Didapi 4.1.0 or newer is used.
Markku Hatakka
Planmeca Oy
Asentajakatu 6
00810 HELSINKI
FINLAND
Or
Email: markku.hatakka@planmeca.com
Planmeca_Twain_Interface.docx 4
PLANMECA TWAIN 2014-05-12
Page 5(29)
TABLE OF CONTENTS
Planmeca_Twain_Interface.docx 5
PLANMECA TWAIN 2014-05-12
Page 6(29)
Planmeca_Twain_Interface.docx 6
PLANMECA TWAIN 2014-05-12
Page 7(29)
This chapter describes installation, using and model of Planmeca TWAIN Data Source in MS
Windows OS. Use of TWAIN interface to capture medical/dental images maybe subject to
regulatory control and it is the responsibility of the deployer to ensure that all relevant requirements
are fulfilled.
1.1 Installation
Make sure that the necessary device drivers are installed. For more
information, see the installation manual of the device in question.
Planmeca_Twain_Interface.docx 7
PLANMECA TWAIN 2014-05-12
Page 8(29)
Planmeca_Twain_Interface.docx 8
PLANMECA TWAIN 2014-05-12
Page 9(29)
Any program that supports TWAIN interface, e.g. TWAIN sample program ‘Twack_32.exe’, can
use in principal Planmeca TWAIN Data Source interface, but please note that the use of TWAIN
interface to capture medical/dental images maybe subject to regulatory control and it is the
responsibility of the deployer to ensure that all relevant requirements are fulfilled! Here TWAIN_32
Twacker application is used only for demonstration purpose!
This must be done only once, if only Planmeca Data Source is used every time the PC is started.
Planmeca_Twain_Interface.docx 9
PLANMECA TWAIN 2014-05-12
Page 10(29)
Planmeca TWAIN supports image capturing with Planmeca 2D intraoral and extraoral X-ray devices. With
Planmeca ProScanner only 1-to-1 ETH and USB modes are supported.
Planmeca_Twain_Interface.docx 10
PLANMECA TWAIN 2014-05-12
Page 11(29)
Application ‘TWAIN acquire’ command starts Planmeca Device Control, e.g. here File->Acquire
…
When the user presses any DIDAPI device button (IntraOral, Panoramic or Cephalo), TWAIN
Source calls DIDAPIUI layer library function (see ‘DidapiUI_Interface.doc’ document) using pre-
defined default values in control file in C:\ProgramData\Planmeca\didapi\PmTwain.ini’. See for
additional information 1.2.5 Device Control File section )
When the user selects ProScanner -device, ProScanner level window and scan functions are called.
The control file of ProScanner ‘ProScanner.ini’ is installed into
C:\ProgramData\Planmeca\ProScanner\Config –folder.
Planmeca_Twain_Interface.docx 11
PLANMECA TWAIN 2014-05-12
Page 12(29)
A DidapiUI layer exposure window is opened when any DIDAPI device button is pressed. Window
will wait for the start of Planmeca device exposure in DIDAPI layer interface. When the exposure is
on, a preview window is updated during the exposure when using Panoramic or Cephalostatic
Dimax2/3 sensor, but not when IntraOral Dixi2/3 sensor is used.
When the exposure is done, ‘Adjust’ and ‘OK’ buttons are activated. Additional image processing
can be done, if necessary, when ‘Adjust’ button is pressed.
If ‘Adjust’ button is pressed, the default values are read from C:\ProgramData\Planmeca\didapi
DidapiUI.ini control file
Planmeca_Twain_Interface.docx 12
PLANMECA TWAIN 2014-05-12
Page 13(29)
- ‘Input Levels’ can be adjusted only when ‘Level’ check box has been first selected. In
‘Input Level’ window the ‘blue’ grab line is for adjusting gamma value, and ‘red’ grab
lines for clipping low and high levels.
- Sharpening filter can be adjusted if ‘Sharpen’ check box has been first selected.
- ‘Soft Tissue Filter’ check box is activated only if DIDAPI driver pre-processing has not
already done the filtering (see ‘Didapi.ini file’ file setting). Note! When using demo
images the ini setting have no effect.
- Note ! There are two manually settable parameters that have effects on the exposure
workflow and two how the final image are looking. Workflow parameters: 1)
StudyExposureEnabled=1, default 0, if for Intra all images are taken before they are sent to
TWAIN, 2) AutoCloseWindow=1, default 0, if the exposure window is close immediately
after the image is taken, 3) Resolution=NORMAL (or MEDIUM or HIGH) controls the
sensor binning resolution and 4) BurnImageInfo=1, default 0, if image info is ‘burned’
permanently for the final image.New parameter SaveSettings in new section [GENERAL]
controls whether new Adjust setting are saved or not when window is closed. Look for the
detailed layout of control file in document ‘DidapiUI_Interface.doc’.
The used values are saved into C:\ProgramData\Planmeca\didapi\DidapiUI.ini file when ‘OK’
button is pressed. The image is transferred into application according to TWAIN specification.
Planmeca_Twain_Interface.docx 13
PLANMECA TWAIN 2014-05-12
Page 14(29)
Planmeca_Twain_Interface.docx 14
PLANMECA TWAIN 2014-05-12
Page 15(29)
For ProScanner image capture description, see Planmeca Romexis user’s manual and Planmeca ProScanner
user’s&installation manual.
Planmeca_Twain_Interface.docx 15
PLANMECA TWAIN 2014-05-12
Page 16(29)
When Planmeca TWAIN image DIDAPI grabbing is completed successfully, the default values for
DIDAPI X-ray control are saved or updated in
‘C:\ProgramData\Planmeca\didapi\Config\PmTwain.ini’ file, see APPENDIX A.1 information flow
graph. Example default sample values are shown below
[Dialog]
FileName=H:\DOCUME~1\username \LOCALS~1\Temp\PmImage.tif
JpegQuality=95 (= percent value for image quality if jpeg format has been
selected)
Note! If for Intra study exposure mode is enabled, the name will have an extra order number
preceding a zero character ‘0’e.g. the name(s) will be in the example case PmImage01.tif,
PmImage02.tif and so on.
Planmeca_Twain_Interface.docx 16
PLANMECA TWAIN 2014-05-12
Page 17(29)
The resulting image parameters are saved into text file in %temp% folder, default file name as
‘PmImage_tif.txt’. The DIDAPI interface (‘Didapi.ini’) settings start with ‘DIDAPI_ ‘ string and
DIDAPIUI interface values with ‘DIDAPIUI_’ string. Note! In this example case no DIDAPI
interface layer corrections has been made, but only in DIDAPIUI interface layer.
Note! The resulting TWAIN DIDAPI image contains DPI resolution value calculated using sensor
pixel size and magnification factor.
DATE=20040824
TIME=130742
TYPE=DIMAX2_P
WIDTH=2200
HEIGHT=920
BIT_DEPTH=8
PIXELSIZE=132
DIDAPI_AUTOLEVELS_ENABLED=1
DIDAPI_GAMMA= 1.00
DIDAPI_CLIPLOWPCT= 0.00
DIDAPI_CLIPHIGHPCT= 0.00
DIDAPIUI_LEVELS_ENABLED=1
DIDAPIUI_GAMMA= 0.40
DIDAPIUI_CLIPLOWPCT= 0.01
DIDAPIUI_CLIPHIGHPCT= 0.01
DIDAPIUI_SHARPENING_ENABLED=1
DIDAPIUI_SHARPENING_FILTERRADIUS=3
Planmeca_Twain_Interface.docx 17
PLANMECA TWAIN 2014-05-12
Page 18(29)
DIDAPIUI_SHARPENING_SCALEFACTOR=189
DIDAPIUI_MEDIANFILTER_ENABLED=1
PARAM_mA=8
PARAM_s= 15.00
SENSOR_NUMBER= 020202
DPARAM_0100=66.0
DPARAM_0101=6.0
DPARAM_0102=80.0
DPARAM_0106=100.0 (because image magnification is taken care; Original DIDAPI value 106.0)
DPARAM_0107=24.3
DPARAM_0108=2.0
DPARAM_0109=5.0
DPARAM_0201=1.0
DPARAM_0202=1.0
DPARAM_0203=1.0
DPARAM_0204=1.0
DPARAM_0205=1.0
DPARAM_0206=0.0
DPARAM_0207=0.0
DPARAM_0208=0.0
DPARAM_0209=0.0
DPARAM_0210=0.0
DPARAM_0502=0.0
DPARAM_0503=0.0
Planmeca_Twain_Interface.docx 18
PLANMECA TWAIN 2014-05-12
Page 19(29)
SPARAM_0111=1.4.2.0.R
SPARAM_0200=b2
SPARAM_0500=720208
EOF
Planmeca_Twain_Interface.docx 19
PLANMECA TWAIN 2014-05-12
Page 20(29)
It is possible to control ProScanner grey levels output image using the control parameter ‘LevelMinVal’ in
section [Processing] in control file ‘Proscanner.ini’ file (see Appendix B.2). Default value is 512; 12 bit image
scale 0 … 4095.
A log file ‘PmTWain.log’ is created or the existing file is opened when device selection window is
opened. The log file is located in C:\ProgramData\Planmeca\Logs -folder. DIDAPI interface layer
has its own log file ‘Didapi.log’, see APPENDIX A.1 graph. Below is an example of the
‘PmTWain.log’ file for DIDAPI interface capture, and then an example of loggings when
ProScanner -device is used.
Below an example content of the log file for DIDAPI Panoramic sample image.
Fri Nov 22 10:13:28 2013 The folder of image will be: C:\Users\hatakma\AppData\Local\Temp
Planmeca_Twain_Interface.docx 20
PLANMECA TWAIN 2014-05-12
Page 21(29)
Fri Nov 22 10:13:28 2013 ERROR: NO license file found. Should be installed on Planmeca DIDAPI
'Program Data' Config- folder(Didapi 5.0 or higher).
Fri Nov 22 10:13:28 2013 Sensor Image size - width: 2200 height:920
Fri Nov 22 10:13:37 2013 Raw DIDAPI Image saved in TIFF format (16 bit) using DIDAPI_save_image()
function : C:\Users\hatakma\AppData\Local\Temp\PmImage_raw.tif
Fri Nov 22 10:13:37 2013 Image regenerated in memory. Settings in didapiUI.ini used.
Planmeca_Twain_Interface.docx 21
PLANMECA TWAIN 2014-05-12
Page 22(29)
Fri Nov 22 10:13:46 2013 Closing didapiUI window: Clearing memory ...
Page 23(29)
Mon Mar 31 14:45:39 2014 RFID read from Image - Serialnumber: DE0E4A46500104E0
Mon Mar 31 14:45:48 2014 16 bit raw image extreme values: min 227 , max 1447
Mon Mar 31 14:48:33 2014 Sending image size for TWAIN: 840 421
Planmeca_Twain_Interface.docx 23
PLANMECA TWAIN 2014-05-12
Page 24(29)
Planmeca_Twain_Interface.docx 24
PLANMECA TWAIN 2014-05-12
Page 25(29)
Interface for DIDAPI devices consists of three interface layers, 1) TWAIN application 2) data
source + DIDAPIUI and 3) DIDAPI. (See the APPENDIX B.1 the graph).
- Layer three, DIDAPI library interface, contains functions for communicating with Planmeca
device drivers and pre-processing of the image. See document ‘DIDAPI_5_0.doc for detailed
descriptions of that layer.
- Layer two, DIDAPIUI layer consist Planmeca TWAIN Data Source that handles communication
to TWAIN Manager interface, contains device control UI and a function for handling user
interface (UI) and the whole DIDAPI grabbing procedure. See and/or document
‘DidapiUI_Interface.doc’ for detailed information.
During the TWAIN DIDAPI grabbing procedure, the image is saved twice. DIDAPI interface layer
grabs the X-ray image and saves it always as a 12(16)-bit TIFF image just after exposure is
finished. DIDAPI has pre-processes the ‘raw’ image according to ‘didapi.ini’ control file settings.
The DIDAPIUI layer modifies the X-ray image using the settings of ‘didapiui.ini’ control file and
saves the final image as a 8 or 12(16)-bit TIFF format (=by default) image when leaving the layer,
look at Planmeca TWAIN Control File. The both layer settings are saved into image information
file ‘PmImage_tif.txt’ (=the default value). The file contains image information and device
parameter values, see Image Information File section. DIDAPIUI layer notifies the TWAIN Source
layer that the image is ready. Planmeca TWAIN Source interface layer opens the image file and
finally sends the image data into the TWAIN Interface of the application.
Planmeca_Twain_Interface.docx 25
PLANMECA TWAIN 2014-05-12
Page 26(29)
Interface consists of three interface layers, 1) TWAIN 2) ProScannerApp and 3) Device driver.
- Layer three, scanner device driver, contains functions for sending to and getting information
from scanner device. See ProScanner application document for detailed information.
- Layer two, ProScanner layer consists of Planmeca TWAIN Data Source that handles
communication to TWAIN Manager interface and to ProScanner capture, contains functions for
handling user interface (UI) and the whole scanning procedure. See ProScanner application
document for detailed information.
Planmeca_Twain_Interface.docx 26
PLANMECA TWAIN 2014-05-12
Page 27(29)
<WINDIR>\twain_32.dll
’PmTWain.ini’
Planmeca TWAIN Device Control Dialog
Level 2
<ALLUSERSPROFILE>\Planmeca\Didapi\Config\
’DidapiUI.ini’
DidapiUI Capture Dialog
%temp%\PmImage.tif <ALLUSERSPROFILE>\Planmeca\Didapi\Config\
’Didapi.ini’
Didapi Level functions via ’didapi.dll’
%temp%\PmImage_raw.tif <ALLUSERSPROFILE>\Planmeca\Didapi\Config\
Level 3
Planmeca_Twain_Interface.docx 27
PLANMECA TWAIN 2014-05-12
Page 28(29)
<WINDIR>\twain_32.dll
’PmTWain.ini’
Planmeca TWAIN Device Control Dialog
Level 2
<ALLUSERSPROFILE>\Planmeca\Didapi\Config\
<ALLUSERSPROFILE>\Planmeca\
ProScanner\Images\
Planmeca_Twain_Interface.docx 28
PLANMECA TWAIN 2014-05-12
Page 29(29)
Planmeca_Twain_Interface.docx 29