===== Coding memo for JACOB Bridge between Java and Bitplane Imaris =====
In addition to the previous page (http://cmci.embl.de/blogtng/2010-06-17/imaris_-_java), here is a list of commands for JACOB bridge for Java and Imaris.
- To get an Instance of Imaris
ActiveXComponent imarisApplication = new ActiveXComponent("Imaris.Application");
- General syntax for getting/setting field values of IApplication
getter:
imarisApplication.getProperty("FIELD_VALUE", PARAMETER);
setter:
imarisApplication.setProperty("FIELD_VALUE", PARAMETER);
- To keep Imaris opened (otherwise closes after operation)
imarisApplication.setProperty("mUserControl", true);
- To get an Instance of Imaris data
ActiveXComponent IDataSet = imarisApplication.getPropertyAsComponent("mDataSet");
- Creating new data in Imaris (empty)
...
Variant[] parameter = new Variant[6];
int ijXsize = imagestack.getWidth();
int ijYsize = imagestack.getHeight();
int ijnSlices = imagestack.getSize();
parameter[0] = new Variant(1); //1 for type 8bit
parameter[1] = new Variant(ijXsize); //x
parameter[2] = new Variant(ijYsize); //y
parameter[3] = new Variant(ijnSlices); //z
parameter[4] = new Variant(1); //channel
parameter[5] = new Variant(1); //time point
IDataSet.invoke("Create", parameter);
- getting data parameter from Imaris (data shown in Imaris). An example with image size in x\\
int imXsize = localIDataSet.getProperty("mSizeX").changeType(Variant.VariantInt).getInt();