===== ImageJ - ImarisXT-Imaris =====
I made some tiral using ImageJ and Bitplane Imaris (in Windows). software versions are:
ImageJ: 1.44c, Java 1.6.0_20 32 bit
Imaris 7.0.0.
To use ImageJ along with Imaris, install ImageJ plugin from Bitplane as they instruct in Bitplane website. Then start up IJ. A small window that looks like below appears:
{{ :documents:figure201006:imarisadapter.jpg|Imaris Adapter}}
By clicking "Start/Stop" button, Imaris starts up (same as clicking imaris.exe, but connected to ImageJ via COM). To send image stack opened in ImageJ, simply clcik "Export Data" (which means "Export data shown in ImageJ to Imaris workspace").
In this way, viewing 3D dataset in ImageJ stack could be viewed more comfortably in Imaris 3D user interface.
One obvious problem I encountered is when I tired to export 4D dataset from ImageJ to Imaris. I opened a 4D dataset with 8 slices (z) and 46 time points. Since ImageJ plugin interface above does have user input for time point, I input the time points number but this was some how not recognized and stack was exported as 368 slices z-stack.
-> Checking through the source code [[http://www.bitplane.com/ImarisXT/bpImaris_Adapter.java|bpImarisAdapter.java]]", I realized that exporting from IJ to Imaris is only available with single time point (value you input in the text field is a single time index, not the total time points). For this, 4D sequence (such as hyperstack) should be split into sepatate z-stacks and then exported to Imaris one by one. The method for exporting is
public boolean ExportDataSetToImaris(int aSelectedChannel, int aSelectedTimepoint, boolean aCreateNewImage)
So probably, it will be same for channels: channels should be separated stack.
"Import Data" could pull image shown in Imaris into ImageJ, but "surfaces" constructed in Imaris does not appear (probably the same as above, single time point).
Other comments:
Macro file is available only with .txt extension, but it should also include ".ijm", IJmacro extension.
if (!vFileName.endsWith(".txt")) {
// a typical ImageJ macro file ends with .txt!
IJ.showMessage("ImageJ macros are .txt files.");
return;
}
Macro executer is a method in Adaptor class:
/**
* Apply a selected macro to Imaris DataSet
*
* @param aMacroDirectory The folder where the macro is lying
* aMacroFileName The filename of the macro
* aCreateNewChannels true if new channels should be created out of each existing ones
* aSelectedChannels if 0 the macro will apply to all channels and timepoints
*
* @return true if success
*/
public boolean ApplyMacroToWholeDataSet(String aMacroFileName, boolean aCreateNewChannels, int aSelectedChannel)
This method basically import dataset (image in the current window, could include also multiple channels and time points), creates ImagePlus, apply macro, then after processing in IJ, The processed image is exported back into Imaris.
-> plugin would be better with more functionalities to import information such as surface, array of detected spot information, tracks, statistics.. and so on.
------
**Extending the code**\\
* extend bpImaris_Adapter.java (in my case for sending 4D)
* jniwrap.jar, bpImaris_Adapter2.jar should be in the build path.
* latter package is com.bitplane.imaris.imaris.*
* exporting method (Current image stack in ImageJ to Imaris) is below. Iterate this to export time series.
public boolean ExportDataSetToImaris(int aSelectedChannel, int aSelectedTimepoint, boolean aCreateNewImage) {
...
* ... should check if aCreateNewImage means new image within imaris.