Coding Regulations - MATLAB and Python Examples

MATLAB Example

% <CustomTools>
% <Menu name="Image Processing ">
% <Submenu name=" Imaris Open ">
% <Item name=" MATLAB file name description" icon="Matlab">
% <Command> MatlabXT:: XT MATLAB file name(%i)</Command>
% </Item>
% </Menu>
% </CustomTools>

function XT MATLAB file name (aImarisApplicationID)

if ~isa(aImarisApplicationID, 'Imaris.IApplicationPrxHelper')
javaaddpath ImarisLib.jar
vImarisLib = ImarisLib;
if ischar(aImarisApplicationID)
aImarisApplicationID = round(str2double(aImarisApplicationID));
end
vImarisApplication = vImarisLib.GetApplication(aImarisApplicationID);
else
vImarisApplication = aImarisApplicationID;
end

Explanation

Copy and paste the code example into your MATLAB file.

The first part of the file is a header that Imaris uses to add a XTension with name MATLAB file name to the Image Processing menu, located in the submenu Imaris Open, and to run the code of the MATLAB file name file.

The second part establishes the connection between MATLAB and Imaris

The aImarisApplicationID input parameter is the well-known ID that Imaris passes to the XTension when it is launched.

To create your XTension adjust the MATLAB file name.

This must be done in the XML part at the beginning of the file (<Item name=" XT MATLAB file name description "), in the MATLAB command a (<Command>MatlabXT:: XT MATLAB file name (%i)</Command>), and in the function definition (function XT MATLAB file name (aImarisApplicationID)).

Your XTension now has a point-and-click access within Imaris.

Restart Imaris and you can find your XTension in the ImarisOpen submenu of the ImageProcessing menu.

Once the XTension is completed it can be uploaded to ImarisOpen.

Python Example

# <CustomTools>
# <Menu name="Image Processing ">
# <Submenu name=" Imaris Open ">
# <Item name="Snakes on a bitplane" icon="Python" tooltip="Well, that's good news. Snakes on crack">
# <Command> PythonXT::XTPython file name (%i)</Command>
# </Item>
# </Menu>
# </CustomTools>

import bpImarisLib

def XTPython file name (aImarisId):

print 'ID', aImarisId

print 'Hello, snake!'

vImaris = ImarisLib.GetImarisApplication(aImarisId)

Explanation

Copy and paste the code example into your Python file.

The first part of the file is a header that Imaris uses to add a XTension with a Python file name to the Image Processing menu, located in the submenu Imaris Open, and to run the code of the Python file name file.

The second part establishes the connection between Python and Imaris

The aImarisApplicationID input parameter is the well-known ID that Imaris passes to the XTension when it is launched.

To create your XTension adjust the Python file name.

This must be done in the XML part at the beginning of the file (<Item name=" XT Python file name "), in the Python command a (<Command> Python XT:: XT Python file name (%i)</Command>), and in the function definition (function XT Python file name (aImarisApplicationID)).

Your XTension now has a point-and-click access within Imaris.

Restart Imaris and you can find your XTension in the ImarisOpen submenu of the ImageProcessing menu.

casque beats pas cher casque beats by dre pas cher beats by dre pas cher beats by dre pas cher maillot foot pas cher maillot de foot pas cher maillot foot pas cher 2014 maillot de foot pas cher maillot foot pas cher maillot de foot pas cher maillot foot pas cher 2014 maillot de foot pas cher maillot foot pas cher 2014 maillot de foot pas chere maillot foot pas cher maillot de foot pas cher Ralph Lauren Homme Polo Manche Longue Ralph Lauren Polo Ralph Lauren Pas Cher Homme Polo Ralph Lauren Homme Pas Cher Ralph Lauren Soldes Ralph Lauren Big Pony Ralph Lauren Soldes Ralph Lauren Big Pony Ralph Lauren Soldes Ralph Lauren Big Pony Ralph Lauren Soldes Ralph Lauren Big Pony