Creating an Image-Pro Premier Add-in

Introduction
This short tutorial explains how to create an add-in for Image-Pro Premier using Microsoft Visual Studio. An add-in is an extension to Image-Pro Premier, which has full access to the Premier automation APIs (Application Programming Interface) and commands and implements some custom User Interface providing additional functionality to the product. It is similar to an Image-Pro Premier App but is compiled, developed and debugged using one of the versions of Microsoft Visual Studio, the Microsoft Integrated Development Environment (IDE), instead of the Premier Project Workbench. A free version, called Visual Basic Express 2010, can be downloaded on the Microsoft website.

Installing Visual Studio
The first step required to configure a computer to enable the development of such add-ins is to make sure that you have access to a copy of Microsoft Visual Studio 2010, either the free one, or the professional version with support for the VB.NET language. 

Mapping the Image-Pro Premier Installation Folder
Once Visual Studio is installed, the next step is to create a X: logical drive to facilitate access to the Image-Pro premier installation directory and its dlls. This operation is performed in a DOS prompt, using the command subst to map the Premier installation folder (e.g. C:\Program Files\Media Cybernetics\Image-Pro Premier 9.1).


Installing the Add-in Template
After the X: drive is created, it is now time to download the attached ZIP file (Image-Pro Premier Add-in.zip) and save it to the Visual Studio Templates folder: My Documents\Visual Studio 2010\Templates\ProjectTemplates. Doing this, will allow us next, to use the Premier add-in template when creating a new project in Visual Studio.


Compiling the Project
Finally it's only a matter of compiling the resulting project, to create our first add-in. Note that you must have write access to the Image-Pro Premier application folder in order to compile successfully to that location which is the default output folder in this project. Once the project is successfully compiled to the X:\ folder, you can restart Image-Pro Premier and it should have a new Samples tab containing a "Sample Tool" button which when clicked will toggle the "Sample Tool" panel, displaying the name of the active document as an example.


Conclusion
At this point you have all the tools needed to build new Image Analysis features, as sophisticated as required, using the Image-Pro Premier commands and APIs, just like you would do with macros and Apps. Add-ins created using this approach will be compatible with all the variants of Image-Pro Premier, as well as the new Image-Pro Insight 9.1 as long as the APIs used are part of Insight.

Comments

  • edited September 2015
    The equivalent template for C# is now attached, the instructions are the same.
  • Note: The X:\ drive mentioned above needs to be defined for the user account used to run Visual Studio, so if you run it "As Administrator", X:\ needs to be defined in an administrator DOS prompt.
  • As Ip-Premier does not yet have a solution to incorporate microscope hardware like stages etc. ( ref.  Stage/Scope Pro in Ip-Pro) would it be an easy and the best task to do this using ad-ins ? And do you know if this has successfully been done?
  • This approach involves some development but yes it has been used successfully by other partners.
  • 2017-03-29-094914

    Rita --

    I have created a PREMIER APP which supports the PRIOR STAGE and FOCUS via the OPTISCAN and PROSCAN controllers.

    This APP is not as flexible as SCOPE-PRO / STAGE-PRO but it provides a solid foundation for anyone that would like to control the XYZ on a SCOPE via PRIOR HARDWARE from within PREMIER.  The APP also includes a DEMO APP that illustrates how to communicate with the XYZ APP and therefore how to communicate with the XYZ HARDWARE.

    Below is the TITLE PAGE from the DOCUMENTATION for this APP and a zoomed in view of the GRAPHIC that shows the UI.

    I hope this information is helpful

    -- Matt




  • Add-in is supported only by Visual Studio 2010? Or its also supported with Visual Studio 2012 and 2015?
  • Hi Joel,

    Current versions of Visual Studio, including VS 2015 are also supported. Just copy the template to the corresponded VS folder (e.g. C:\Users\<<USER>>\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual Basic)

    Yuri

  • Hi Yuri,

    Is there a demo add-in program which can be used for reference?

    Thanks,
    Joel
  • edited August 2017
    Hi Joel,

    We don't have Addin demos, but I just created an addin  in VB 2015 using the wizard (described above) and added one button "Apply Sobel filter" to the panel.

    You can download the attached project, compile it and then run (don't forget to map Premier folder as X drive, as explained above). Then you can run Image-Pro Premier.exe and will see "Samples" tab in the ribbon, which will have one button that will open a panel with "Apply Sobel filter" button.

    The same way you can create own addins using the wizard.

    There are many apps available as demo samples, you can use code from any of our apps in addins.

    Yuri


Sign In or Register to comment.