# Interoperation of ISee! and other software

The BAM radiographic image analysis software
by Oleksandr Alekseychuk, BAM VIII.3

ISee! does not provide any plugin interface. ISee! is also not designed for integration with other software on a source-code compile-time level (which is not possible anyway due to closed source code). Despite this, a rather fine interoperation with 3d-party software is easily possible. This can be even done in two different ways depending on the necessity of real-time communication and the complexity which can be accepted. Simultaneous use of both approaches is a possible and a reasonable way too.

## Simple way, serial operation

A simple but nevertheless a powerful way to export information, like regions of interest (ROI), from ISee! to other programs is by using ISee!-datasets ("ics" file extension). A user can create in ISee! a list of ROIs (try the three rightmost buttons in the toolbar). ROIs can be grey value profiles, penetrametric thickness measurements, statistics windows or just rectangular or circular annotations (markings). The last two (both types of annotations) are most interesting for exporting meta information from ISee!. All ROI types can be arbitrary mixed in the ROI list and additionally endowed by free-text comments. Then, the ROI list can be stored in a disk file (via "File / Save Dataset As..." menu). This file (the dataset) has a simple ASCII format (windows ini-file format) and can be later parsed by a 3d-party software in order to extract user selections and comments (which can carry arbitrary tags or commands). The exact format of the ISee!-dataset can be infered from this extensively commented example (please do not hesitate to contact me if you have further questions regarding the meaning and format of the fields in this file).

In a similar way the information can be provided from the external program to ISee! for the display and/or user evaluation/modification. In this case the external program has to create a dataset (ics-file) and call ISee! providing the name of the dataset file as a command line argument (like `"ic.exe my_dataset.ics"`).

A practical example of such concept could be a defect detection program which calls ISee! first time with the image file as a command line argument. ISee! will display the image and allow user to define regions of interest (like welding and heat affected areas, safety critical zones, etc.). After the user save dataset and finishes the ISee!, the defect detection program can proceed with parsing of the ics-file (very easy due to simple format) and actually the defect detection. Then, the result of the detection has to be stored again in the ics-file (may be different one or the same file can be extended) and the ISee! has to be called for the second time for representation of the result with the ics-file as a command line argument. Additionally, due to editable ROI list, the user can modify the result (for example delete spurious detections, add comments, etc.).

This way of interoperation is used in my crack detection software "cognition" and is also illustrated by the example provided by Uwe Zscherpel.

Please note: in order to be able to save dataset you have to use a full version of ISee! (demo does not allow to save anything).

## Client-Server approach for a real-time interoperation

ISee! implements internally a simple telnet server. A client (human user using a telnet client or a standalone 3d-party program) can open a connection to ISee! on a predefined port and virtually fully control ISee! via this connection by sending text commands. Similarly, the ISee! can be configured to echo user commands via telnet session opened to an external telnet service (which can be a locally running program as well as a program on a different computer). This mechanism allows a seamless real-time interoperation between ISee! and an external software, but is also a more complex one regarding implementation.

As an example for this way of communication it is possible to connect two instances of ISee! in order to have one instance to mirror the behaviour of the other one. For this purpose the "remote controller" menu item has to be selected from the "Misc" menu. The dialog, which appears, has two sections. The first one enables/disables the internal telnet server (checkbox "Accept remote commands") and configures the incoming port (free selectable in order to not interfere with other services). In the second section (bottom one) of this dialog, one can specify if ISee! should send commands to remote (external) application, on which host and port the application has to be contacted and which command groups will be sent. Both functionalities (accept commends and send commands) are only active until the dialog stays open! As soon as the user close it, both functionalities will be disabled (for security reasons).

Since version 1.8.2 it is possible to start ISee! immediately listening to a port (without users' interactive actions) by providing "--listen=<portnumber>" command line parameter as well as to close ISee! completely (finish the program) directly from the remote client (controller) by using the "close" command.

Commands which ISee! sends and accepts via telnet are as follows. All commands closely resemble menu items, toolbar buttons and respective dialogs of ISee! so their meaning should be self-explanatory. The list of commends can be also invoked using "help" command in the telnet session as soon as the connection to ISee! is established.

### Following commands are working with ISee! 1.10.0 and newer. For older releases see below!

    Image Input, Output, Description:
       exit|quit (finishes telnet session, not the ISee!)
       close     (finishes ISee! (and therefore the telnet session too))
       clear     (clears ISee! contents)
       acquire   (acquire an image via TWAIN interface)
       load_image <filename>
       load_dataset <filename>
       load <filename> - load either a dataset or an image
       save_image_as <filename> <format>
       save_dataset_as <filename>
       set_pixelsize <pixelsize>
       set_basicspatialresolution <basic_spatial_resolution>
       adjust_pixels <configfilename>

    LUT settings:
       load_lut <filename>
       reset_lut
       apply_lut

    Zooming/Panning:
       zoom_to <zoomfactor>
       zoom_in
       zoom_out
       fittoview
       pan <dx> <dy>
       pan3d <dx> <dy> <zoom_factor>
       goto <x> <y>

    Brigtness/Contrast/Gamma ajustments:
       reset_levers
       optimize_full
       optimize_view
       set_black_point <gv>
       set_white_point <gv>
       set_gamma <gamma>
       set_black_white_gamma <gv> <gv> <gamma>

    Filtering:
       execute_batch <filename>
       convolve <filename>
       running_mean <win_x_size> <win_y_size> [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       running_maskmean <filename>  [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       running_median <win_x_size> <win_y_size>  [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       running_maskmedian <filename>  [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       pseudoplast <dx> <dy>
       bessel_fft<dimensions (1|2)> lowpass|highpass|highboost <filtersize> <highpass_scale>|<highboost_boost> <highpass_offset>
       enhance_details
       extract_details
       los_removal <type> <polarity> <min_width> <max_width> <threshold> <detect_only (1|0)> <reconstruction_basis> <repetitions>

    Morphological operations (binary):
       erode
       dilate

    Geometry transforms:
       rotate_180
       rotate_90cw
       rotate_90ccw
       flip_horizontal
       flip_vertical
       sizeinfo
       crop <winstart_x> <winstart_y> <winend_x> <winend_y>
       resize <x_factor> <y_factor> <reduce_method> <enlarge_method>

    ROI management:
       add_roi
       activate_roi <roi_number>
       change_mode <mousemode_code>
       del_active_roi

    Profiling:
       profile_startend <start_x> <start_y> <end_x> <end_y>
       profile_width <width>
       profile_startendwidth <start_x> <start_y> <end_x> <end_y> <width>
       profile_smooth <winsize>
       profile_derivative true|false
       profile_furie true|false
       profile_osd true|false

    Densitometry (penetrameter):
       penetrameter_mue <effective_linear_absorption_k>
       penetrameter_geometry <ref_x> <ref_y> <ref_size> <mes_x> <mes_y> <mes_size>
       penetrameter_osd true|false

    Statistic window:
       statistics_win <winstart_x> <winstart_y> <winend_x> <winend_y>

    Rectangular anotation:
       rect_anotation_win <what1 (0|1|2|3)> <value1_x> <value1_y> <what2 (0|1|2|3)> <value2_x> <value2_y>

    Circular anotation:
       circ_anotation_win<centre_x> <centre_y> <radius>

### Following commands are working with obsolete versions of ISee! (1.9.0 an older) . For newer releases see above!

    Image Input, Output, Description:
       quit     (finishes telnet session, not the ISee!)
       close    (finishes ISee! (and therefore the telnet session too))
       clear    (clears ISee! contents)
       acquire  (acquire an image via TWAIN interface)
       loadimage <filename>
       loaddataset <filename>
       saveimageas <filename> <format>
       savedatasetas <filename>
       setpixelsize <pixelsize>
       setbasicspatialresolution <basic_spatial_resolution>
       adjustpixels <configfilename>

    LUT settings:
       loadlut <filename>
       resetlut

    Zooming/Panning:
       zoomto <zoomfactor>
       zoomin
       zoomout
       fittoview
       pan <dx> <dy>
       goto <x> <y>

    Brigtness/Contrast/Gamma ajustments:
       resetlevers
       optimizefull
       optimizeview
       setblackpoint <gv>
       setwhitepoint <gv>
       setgamma <gamma>
       setblackwhitegamma <gv> <gv> <gamma>

    Filtering:
       convolve <filename>
       runningmean <win_x_size> <win_y_size> [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       runningmaskmean <filename>  [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       runningmedian <win_x_size> <win_y_size>  [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       runningmaskmedian <filename>  [lowpass|highpass|highboost] [<highpass_offset>|<highboost_boost>]
       pseudoplast <dx> <dy>
       besselfft<dimensions (1|2)> lowpass|highpass|highboost <filtersize> <highpass_scale>|<highboost_boost> <highpass_offset>
       enhancedetails
       extractdetails

    Geometry transforms:
       rotate180
       rotate90cw
       rotate90ccw
       fliphorizontal
       flipvertical
       sizeinfo
       crop <winstart_x> <winstart_y> <winend_x> <winend_y>
       resize <x_factor> <y_factor> <reduce_method> <enlarge_method>

    ROI management:
       addroi
       activateroi <roi_number>
       changemode <mousemode_code>
       delactiveroi

    Profiling:
       profilestart <x> <y>
       profileend <x> <y>
       profilestartend <start_x> <start_y> <end_x> <end_y>
       profilewidth <width>
       profilestartendwidth <start_x> <start_y> <end_x> <end_y> <width>
       profilesmooth <winsize>
       profilederivative true|false
       profilefurie true|false
       profileosd true|false

    Densitometry (penetrameter):
       penetrametermue <effective_linear_absorption_k>
       penetrameterref <x> <y>
       penetrameterrefsize <winsize>
       penetrametermes <x> <y>
       penetrametermessize <winsize>
       penetrametergeometry <ref_x> <ref_y> <ref_size> <mes_x> <mes_y> <mes_size>
       penetrameterosd true|false

    Statistic window:
       statisticswin <winstart_x> <winstart_y> <winend_x> <winend_y>

    Rectangular anotation:
       rectanotationwin <what1 (0|1|2|3)> <value1_x> <value1_y> <what2 (0|1|2|3)> <value2_x> <value2_y>

    Circular anotation:
       circanotationwin<centre_x> <centre_y> <radius>

Please note: the interoperation via telnet interface should be considered as semi-experimental since it is rarely used on practice and therefore could be not sufficiently tested. If you decide to use it and found bugs or conceptual errors, do not hesitate to contact me.

## The third, secret way :)

I started recently a free counterpart of ISee! which is released unter GNU General Public License. The name for the project is ISeeMore! ("icm" for short). This development is just started and its functionality, despite the name, is still much less as the original ISee!. But in this project virtually everything is possible - so please take a look and probably you will wish to take part in this open source project or just to use it.

ISee! is developed at BAM (Bundesanstalt für Materialforschung und -prüfung - Federal Institute for Materials Research and Testing) by Dr. Oleksandr Alekseychuk. Do not hesitate to send me technical questions, suggestions, bug reports, etc.

This webpage was designed by Mirko Jechow, last changed: 2009-10-20.