Login  Register

Re: Cannot use TurboReg plugin by using matlab

Posted by LCY on Dec 03, 2016; 7:49am
URL: http://imagej.273.s1.nabble.com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017679.html

Hi Curtis,

Thank you very much for your help!

This is what I have: window 10 system, Matlab 2015b, Fiji(based on java 6) which I store in "C:\Users\[my name]\Fiji.app".

I want to do matching among many tiff stacks. Because my other codes are programmed by Matlab, I want to use TurboReg plugin from Matlab to process these files automatically.

This is how I do that :
 step 1: update Fiji as you suggested;
 step 2: add path in Matlab:"C:\Users\[my name]\Fiji.app\scripts"
 step 3: start Fiji in my Matlab code by using the command "Miji;"
 step 4: open one tiff stack file by using "MIJ.run('Open...', ['path=','F:\TwoPhotonfile\stack1.tif']);"
step 5: normalize and average my tiff stack file by using MIJ.run('Open...',...) and  MIJ.run('Enhance Contrast...',..) separately.
step 6: now there are two opened windows, one is the normalized tiff stack file, the other is the averaged image file (contains only one image)
step 7: do matching by using
" MIJ.run('TurboReg ', ['-align ', '-file ','stack1.tif',' ','0 0 ',num2str(width),' ',num2str(height),' ',...
    '-file ','AVG_stack1.tif',' ','0 0 ',num2str(width),' ',num2str(height),' ','-rigidBody ',num2str(width/2),...
    ' ',num2str(height/2),' ',num2str(width/2),' ',num2str(height/2),' ','0 ',num2str(height/2),' ','0 ',...
    num2str(height/2),' ',num2str(width-1),' ',num2str(height/2),' ',num2str(width-1),' ',num2str(height/2),' ','-showOutput']); "

The results showed in ImageJ Exception are as follow:
"ImageJ 1.50e; Java 1.7.0_60 [64-bit]; Windows 8 6.2; 178MB of 3725MB (4%)
 
java.lang.NullPointerException
        at TurboReg_.alignImages(TurboReg_.java:893)
        at TurboReg_.run(TurboReg_.java:636)
        at ij.IJ.runUserPlugIn(IJ.java:212)
        at ij.IJ.runPlugIn(IJ.java:176)
        at ij.Executer.runCommand(Executer.java:136)
        at ij.Executer.run(Executer.java:65)
        at ij.IJ.run(IJ.java:292)
        at MIJ.run(MIJ.java:1171)"

This is what I have done:

I try to change the source path to 'F:\TwoPhotonfile\stack1.tif', but this doesn' t work;
I double clicked the information in Exception window, it showed "file is not in a supported format, a reader plugin is not available, or it was not found". But, this plugin works when I use it manually.

Thank you for your help, Curtis!

All the best,

Chunyue