Cannot use TurboReg plugin by using matlab

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
LCY
Reply | Threaded
Open this post in threaded view
|

Cannot use TurboReg plugin by using matlab

LCY
Dear all,

I try to align a tiff stack to a tiff template image.  The tiff stack contains more than 900 images, so I write a  Matlab code to use TurboReg to finish this step. The code is as follow:

MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ', num2str(width),' ',num2str(height),' ',
    '-file ',fileNames{2,1},' ','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']);

However, ImageJ Exception showed as follow:
" ImageJ 1.51h; Java 1.7.0_60 [64-bit]; Windows 8 6.2; 422MB of 3725MB (11%)
 
java.lang.UnsupportedClassVersionError: HandleExtraFileTypes : Unsupported major.minor version 52.0
 
This plugin requires Java 1.8 or later."

Fiji outside Matlab showed java' version is 1.8.0_112. But when I launched ImageJ from Matlab, the java version changed to  1.7.0_60.

I have included Fiji's path in Matlab, and I am sure my installation is right. I also updated ImageJ and Fiji many times, but the problem still existed.

Can anyone help me?

Thank you very much!

All the best,

Chunyue
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

Mario Emmenlauer-3
Hi Chunyue,

On 01.12.2016 14:43, LCY wrote:

> Dear all,
>
> I try to align a tiff stack to a tiff template image.  The tiff stack
> contains more than 900 images, so I write a  Matlab code to use TurboReg to
> finish this step. The code is as follow:
>
> MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ',
> num2str(width),' ',num2str(height),' ',
>     '-file ',fileNames{2,1},' ','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']);
>
> However, ImageJ Exception showed as follow:
> " ImageJ 1.51h; Java 1.7.0_60 [64-bit]; Windows 8 6.2; 422MB of 3725MB (11%)
>  
> java.lang.UnsupportedClassVersionError: HandleExtraFileTypes : Unsupported
> major.minor version 52.0
>  
> This plugin requires Java 1.8 or later."
>
> Fiji outside Matlab showed java' version is 1.8.0_112. But when I launched
> ImageJ from Matlab, the java version changed to  1.7.0_60.

Matlab brings its own version of Java. Its an integral part of
Matlab. I can not recommend running Matlab with a different version
of Java, and certainly not going from 1.7 to 1.8 (unless somebody
has by chance good experience with this). I tried it in the past and
got many problems.

It might be a lot easier to compile your Fiji dependencies with
Java 1.7 and use this in Matlab.

Hope this helps...

Viele Grüße,

    Mario Emmenlauer


--
BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
D-81669 München                          http://www.biodataanalysis.de/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
LCY
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

LCY
Hi, Mario,

Thank you very much for your help! Maybe I can try other plugins that have the same function with TurboReg.

All the best,

Chunyue



2016-12-01 22:14 GMT+08:00 Mario Emmenlauer-3 [via ImageJ] <[hidden email]>:
Hi Chunyue,

On 01.12.2016 14:43, LCY wrote:

> Dear all,
>
> I try to align a tiff stack to a tiff template image.  The tiff stack
> contains more than 900 images, so I write a  Matlab code to use TurboReg to
> finish this step. The code is as follow:
>
> MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ',
> num2str(width),' ',num2str(height),' ',
>     '-file ',fileNames{2,1},' ','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']);
>
> However, ImageJ Exception showed as follow:
> " ImageJ 1.51h; Java 1.7.0_60 [64-bit]; Windows 8 6.2; 422MB of 3725MB (11%)
>  
> java.lang.UnsupportedClassVersionError: HandleExtraFileTypes : Unsupported
> major.minor version 52.0
>  
> This plugin requires Java 1.8 or later."
>
> Fiji outside Matlab showed java' version is 1.8.0_112. But when I launched
> ImageJ from Matlab, the java version changed to  1.7.0_60.
Matlab brings its own version of Java. Its an integral part of
Matlab. I can not recommend running Matlab with a different version
of Java, and certainly not going from 1.7 to 1.8 (unless somebody
has by chance good experience with this). I tried it in the past and
got many problems.

It might be a lot easier to compile your Fiji dependencies with
Java 1.7 and use this in Matlab.

Hope this helps...

Viele Grüße,

    Mario Emmenlauer


--
BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: <a href="tel:+49%2089%2074677203" value="+498974677203" target="_blank">+49-89-74677203
Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
D-81669 München                          http://www.biodataanalysis.de/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017669.html
To unsubscribe from Cannot use TurboReg plugin by using matlab, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

ctrueden
Hi Chunyue,

Download a Life-Line version of Fiji and update it to the latest version.
This will give you a Java 6 compatible version of Fiji, which you can use
with MATLAB.

See:
http://imagej.net/2016-05-10_-_ImageJ_HOWTO_-_Java_8,_Java_6,_Java_3D

I would not recommend trying to compile individual components to use Java
7—you will have many problems.

Alternately, as Mario said, you can try updating MATLAB to use Java 8.

Hopefully Mathworks will update MATLAB to support Java 8 in the future.

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Thu, Dec 1, 2016 at 7:28 PM, LCY <[hidden email]> wrote:

> Hi, Mario,
>
> Thank you very much for your help! Maybe I can try other plugins that have
> the same function with TurboReg.
>
> All the best,
>
> Chunyue
>
>
>
> 2016-12-01 22:14 GMT+08:00 Mario Emmenlauer-3 [via ImageJ] <
> [hidden email]>:
>
> > Hi Chunyue,
> >
> > On 01.12.2016 14:43, LCY wrote:
> >
> > > Dear all,
> > >
> > > I try to align a tiff stack to a tiff template image.  The tiff stack
> > > contains more than 900 images, so I write a  Matlab code to use
> TurboReg
> > to
> > > finish this step. The code is as follow:
> > >
> > > MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ',
> > > num2str(width),' ',num2str(height),' ',
> > >     '-file ',fileNames{2,1},' ','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']);
> > >
> > > However, ImageJ Exception showed as follow:
> > > " ImageJ 1.51h; Java 1.7.0_60 [64-bit]; Windows 8 6.2; 422MB of 3725MB
> > (11%)
> > >
> > > java.lang.UnsupportedClassVersionError: HandleExtraFileTypes :
> > Unsupported
> > > major.minor version 52.0
> > >
> > > This plugin requires Java 1.8 or later."
> > >
> > > Fiji outside Matlab showed java' version is 1.8.0_112. But when I
> > launched
> > > ImageJ from Matlab, the java version changed to  1.7.0_60.
> >
> > Matlab brings its own version of Java. Its an integral part of
> > Matlab. I can not recommend running Matlab with a different version
> > of Java, and certainly not going from 1.7 to 1.8 (unless somebody
> > has by chance good experience with this). I tried it in the past and
> > got many problems.
> >
> > It might be a lot easier to compile your Fiji dependencies with
> > Java 1.7 and use this in Matlab.
> >
> > Hope this helps...
> >
> > Viele Grüße,
> >
> >     Mario Emmenlauer
> >
> >
> > --
> > BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
> > <+49%2089%2074677203>
> > Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
> > D-81669 München                          http://www.biodataanalysis.de/
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-
> > plugin-by-using-matlab-tp5017668p5017669.html
> > To unsubscribe from Cannot use TurboReg plugin by using matlab, click
> here
> > <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
> macro=unsubscribe_by_code&node=5017668&code=Y2h1bnl1ZTA3MjBAZ21haWwuY29tfD
> UwMTc2Njh8MjA3MTgxODY1MQ==>
> > .
> > NAML
> > <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.view.web.template.
> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> instant_email%21nabble%3Aemail.naml>
> >
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.
> com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017670.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

Mario Emmenlauer-3
Hi,

On 02.12.2016 13:16, Curtis Rueden wrote:
> Alternately, as Mario said, you can try updating MATLAB to use Java 8.

I tried to rather discourage this path :-) :-) :-) Whenever I tried
to change Matlab Java (even minor changes in the same major version)
I got into a hell lot of problems. Java is integral to Matlab, and
Matlab brings a whole lot of dependencies (that are not meant to be
modified), so its likely to create a huge mess :-)

Just my two cents! Cheers,

    Mario



> Hopefully Mathworks will update MATLAB to support Java 8 in the future.
>
> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - http://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
> Did you know ImageJ has a forum? http://forum.imagej.net/
>
>
> On Thu, Dec 1, 2016 at 7:28 PM, LCY <[hidden email]> wrote:
>
>> Hi, Mario,
>>
>> Thank you very much for your help! Maybe I can try other plugins that have
>> the same function with TurboReg.
>>
>> All the best,
>>
>> Chunyue
>>
>>
>>
>> 2016-12-01 22:14 GMT+08:00 Mario Emmenlauer-3 [via ImageJ] <
>> [hidden email]>:
>>
>>> Hi Chunyue,
>>>
>>> On 01.12.2016 14:43, LCY wrote:
>>>
>>>> Dear all,
>>>>
>>>> I try to align a tiff stack to a tiff template image.  The tiff stack
>>>> contains more than 900 images, so I write a  Matlab code to use
>> TurboReg
>>> to
>>>> finish this step. The code is as follow:
>>>>
>>>> MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ',
>>>> num2str(width),' ',num2str(height),' ',
>>>>     '-file ',fileNames{2,1},' ','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']);
>>>>
>>>> However, ImageJ Exception showed as follow:
>>>> " ImageJ 1.51h; Java 1.7.0_60 [64-bit]; Windows 8 6.2; 422MB of 3725MB
>>> (11%)
>>>>
>>>> java.lang.UnsupportedClassVersionError: HandleExtraFileTypes :
>>> Unsupported
>>>> major.minor version 52.0
>>>>
>>>> This plugin requires Java 1.8 or later."
>>>>
>>>> Fiji outside Matlab showed java' version is 1.8.0_112. But when I
>>> launched
>>>> ImageJ from Matlab, the java version changed to  1.7.0_60.
>>>
>>> Matlab brings its own version of Java. Its an integral part of
>>> Matlab. I can not recommend running Matlab with a different version
>>> of Java, and certainly not going from 1.7 to 1.8 (unless somebody
>>> has by chance good experience with this). I tried it in the past and
>>> got many problems.
>>>
>>> It might be a lot easier to compile your Fiji dependencies with
>>> Java 1.7 and use this in Matlab.
>>>
>>> Hope this helps...
>>>
>>> Viele Grüße,
>>>
>>>     Mario Emmenlauer
>>>
>>>
>>> --
>>> BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
>>> <+49%2089%2074677203>
>>> Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
>>> D-81669 München                          http://www.biodataanalysis.de/
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>> http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-
>>> plugin-by-using-matlab-tp5017668p5017669.html
>>> To unsubscribe from Cannot use TurboReg plugin by using matlab, click
>> here
>>> <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
>> macro=unsubscribe_by_code&node=5017668&code=Y2h1bnl1ZTA3MjBAZ21haWwuY29tfD
>> UwMTc2Njh8MjA3MTgxODY1MQ==>
>>> .
>>> NAML
>>> <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
>> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
>> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
>> web.template.NabbleNamespace-nabble.view.web.template.
>> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
>> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
>> instant_email%21nabble%3Aemail.naml>



Viele Gruesse,

    Mario Emmenlauer


--
BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
D-81669 München                          http://www.biodataanalysis.de/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
LCY
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

LCY
In reply to this post by ctrueden
Dear Curtis,

Thank you very much for your help!

I have tried your method, however, it cannot solve my problem. I still cannot use TurboReg plugin by using following Matlab command:

MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ', num2str(width),' ',num2str(height),' ',...
    '-file ','AVG_',fileNames{1,1},' ','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']);

Thank you all the same.

All the best,

Chunyue
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

ctrueden
Hi Chunyue,

> I still cannot use TurboReg plugin

Presumably you receive a different error message now? Could you please
describe exactly how it fails?

This guide might help:
http://imagej.net/Bug_reporting_best_practices

Regards,
Curtis


--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Fri, Dec 2, 2016 at 8:30 AM, LCY <[hidden email]> wrote:

> Dear Curtis,
>
> Thank you very much for your help!
>
> I have tried your method, however, it cannot solve my problem. I still
> cannot use TurboReg plugin by using following Matlab command:
>
> MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ',
> num2str(width),' ',num2str(height),' ',...
>     '-file ','AVG_',fileNames{1,1},' ','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']);
>
> Thank you all the same.
>
> All the best,
>
> Chunyue
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.
> com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017676.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

Yuekan Jiao-2
Hi,

I have a comment that may or may not be related to the error (presumably a
different one). If the source and target are files, please make sure the
file paths do not contain spaces, they cause a problem in my ImageJ/Fiji
plugin code. One way to get around this problem is to use windows for
source and target, and load images onto the windows for TurboReg alignment.

Yuekan

On Fri, Dec 2, 2016 at 8:38 AM, Curtis Rueden <[hidden email]> wrote:

> Hi Chunyue,
>
> > I still cannot use TurboReg plugin
>
> Presumably you receive a different error message now? Could you please
> describe exactly how it fails?
>
> This guide might help:
> http://imagej.net/Bug_reporting_best_practices
>
> Regards,
> Curtis
>
>
> --
> Curtis Rueden
> LOCI software architect - http://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
> Did you know ImageJ has a forum? http://forum.imagej.net/
>
>
> On Fri, Dec 2, 2016 at 8:30 AM, LCY <[hidden email]> wrote:
>
> > Dear Curtis,
> >
> > Thank you very much for your help!
> >
> > I have tried your method, however, it cannot solve my problem. I still
> > cannot use TurboReg plugin by using following Matlab command:
> >
> > MIJ.run('TurboReg ', ['-align ', '-file ',fileNames{1,1},' ','0 0 ',
> > num2str(width),' ',num2str(height),' ',...
> >     '-file ','AVG_',fileNames{1,1},' ','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']);
> >
> > Thank you all the same.
> >
> > All the best,
> >
> > Chunyue
> >
> >
> >
> > --
> > View this message in context: http://imagej.1557.x6.nabble.
> > com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017676.html
> > Sent from the ImageJ mailing list archive at Nabble.com.
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
LCY
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

LCY
In reply to this post by ctrueden
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





LCY
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

LCY
In reply to this post by Yuekan Jiao-2
Hi, Yuekan,

Thank you very much for your suggestion!

I have checked my path in the command, they don't contain spaces. But it is a common mistake for me.

All the best,

Chunyue
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

Yuekan Jiao-2
In reply to this post by LCY
Hi Chunyue,

If I understand, you have 2 opened windows "stack1.tif" and
"AVG_stack1.tif",  you need to specify the source and target from ' -file '
to ' -window '. file paths do not matter.

I am not sure that TurboReg can do alignment for a stack, but a single
slice should be fine.

Yuekan

On Fri, Dec 2, 2016 at 11:49 PM, LCY <[hidden email]> wrote:

> 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
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.
> com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017679.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
LCY
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

LCY
Hi Yuekan,

Thank you very much for your help. Maybe you are right. However, I don't know how to specify the source and target from ' -file '  to ' -window '. Could you please show me an example?

All the best,

Chunyue

2016-12-06 0:40 GMT+08:00 Yuekan Jiao-2 [via ImageJ] <[hidden email]>:
Hi Chunyue,

If I understand, you have 2 opened windows "stack1.tif" and
"AVG_stack1.tif",  you need to specify the source and target from ' -file '
to ' -window '. file paths do not matter.

I am not sure that TurboReg can do alignment for a stack, but a single
slice should be fine.

Yuekan

On Fri, Dec 2, 2016 at 11:49 PM, LCY <[hidden email]> wrote:

> 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
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.
> com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017679.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017688.html
To unsubscribe from Cannot use TurboReg plugin by using matlab, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

Yuekan Jiao-2
Hi Chunyue,

In the command of your step 7, replace ' -file ' with ' -window ', as you
have two windows "stack1.tif" and "AVG_stack1.tif". See TurboReg
instruction at
http://bigwww.epfl.ch/thevenaz/turboreg/

Good luck.

Yuekan


On Fri, Dec 9, 2016 at 8:46 PM, LCY <[hidden email]> wrote:

> Hi Yuekan,
>
> Thank you very much for your help. Maybe you are right. However, I don't
> know how to specify the source and target from ' -file '  to ' -window '.
> Could you please show me an example?
>
> All the best,
>
> Chunyue
>
> 2016-12-06 0:40 GMT+08:00 Yuekan Jiao-2 [via ImageJ] <
> [hidden email]>:
>
> > Hi Chunyue,
> >
> > If I understand, you have 2 opened windows "stack1.tif" and
> > "AVG_stack1.tif",  you need to specify the source and target from ' -file
> > '
> > to ' -window '. file paths do not matter.
> >
> > I am not sure that TurboReg can do alignment for a stack, but a single
> > slice should be fine.
> >
> > Yuekan
> >
> > On Fri, Dec 2, 2016 at 11:49 PM, LCY <[hidden email]
> > <http:///user/SendEmail.jtp?type=node&node=5017688&i=0>> wrote:
> >
> > > 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
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context: http://imagej.1557.x6.nabble.
> > > com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017679.html
> > > Sent from the ImageJ mailing list archive at Nabble.com.
> > >
> > > --
> > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-
> > plugin-by-using-matlab-tp5017668p5017688.html
> > To unsubscribe from Cannot use TurboReg plugin by using matlab, click
> here
> > <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
> macro=unsubscribe_by_code&node=5017668&code=Y2h1bnl1ZTA3MjBAZ21haWwuY29tfD
> UwMTc2Njh8MjA3MTgxODY1MQ==>
> > .
> > NAML
> > <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.view.web.template.
> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> instant_email%21nabble%3Aemail.naml>
> >
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.
> com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017745.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
LCY
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

LCY
Hi  Yuekan ,

Thank you very much! It works now! 


2016-12-10 14:03 GMT+08:00 Yuekan Jiao-2 [via ImageJ] <[hidden email]>:
Hi Chunyue,

In the command of your step 7, replace ' -file ' with ' -window ', as you
have two windows "stack1.tif" and "AVG_stack1.tif". See TurboReg
instruction at
http://bigwww.epfl.ch/thevenaz/turboreg/

Good luck.

Yuekan


On Fri, Dec 9, 2016 at 8:46 PM, LCY <[hidden email]> wrote:

> Hi Yuekan,
>
> Thank you very much for your help. Maybe you are right. However, I don't
> know how to specify the source and target from ' -file '  to ' -window '.
> Could you please show me an example?
>
> All the best,
>
> Chunyue
>
> 2016-12-06 0:40 GMT+08:00 Yuekan Jiao-2 [via ImageJ] <
> [hidden email]>:
>

> > Hi Chunyue,
> >
> > If I understand, you have 2 opened windows "stack1.tif" and
> > "AVG_stack1.tif",  you need to specify the source and target from ' -file
> > '
> > to ' -window '. file paths do not matter.
> >
> > I am not sure that TurboReg can do alignment for a stack, but a single
> > slice should be fine.
> >
> > Yuekan
> >
> > On Fri, Dec 2, 2016 at 11:49 PM, LCY <[hidden email]
> > <http:///user/SendEmail.jtp?type=node&node=5017688&i=0>> wrote:

> >
> > > 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
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context: http://imagej.1557.x6.nabble.
> > > com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017679.html
> > > Sent from the ImageJ mailing list archive at Nabble.com.
> > >
> > > --
> > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-
> > plugin-by-using-matlab-tp5017668p5017688.html
> > To unsubscribe from Cannot use TurboReg plugin by using matlab, click
> here

> > <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
> macro=unsubscribe_by_code&node=5017668&code=Y2h1bnl1ZTA3MjBAZ21haWwuY29tfD
> UwMTc2Njh8MjA3MTgxODY1MQ==>
> > .
> > NAML
> > <http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?
> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.view.web.template.
> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> instant_email%21nabble%3Aemail.naml>
> >
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.
> com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017745.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5017746.html
To unsubscribe from Cannot use TurboReg plugin by using matlab, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

rmd06
Hi, LCY

 I copy your code and runy in my Matlab to register a stack tif to a single tif.

After I run, only two slice were registered, not the whole stack.

 Do you know what's the possible reason? Thanks.

code is below: Miji();
imgpath = 'D:\Lab\tempdate\123\2X2-MB-epac\ATM-Bad-1\Stack.tif';

MIJ.run('Open...',['path=[',strrep(imgpath,'\','\\'),']']);

 imgpath = 'D:\Lab\tempdate\123\2X2-MB-epac\ATM-Bad-1\AAA.tif';

MIJ.run('Open...',['path=[',strrep(imgpath,'\','\\'),']']);

 aSize = size(MIJ.getCurrentImage);
width = aSize(2);
height = aSize(1);

MIJ.run('TurboReg ',... ['-align -window ','AAA.tif',... ' 0 0 ',num2str(width),' ',num2str(height),' ',... '-window ','Stack.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']);


 _____________________________________ Sent from http://imagej.1557.x6.nabble.com ÿ
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

rmd06
In reply to this post by LCY
Hello, LCY

I tried your suggestion and exchange the stack.tif and AAA.tif, but the output is still a stack with two image, but the second slice is different.

As I'm not very understand about the input argument, is there posible something wrong with other input argument?

Thanks.

below is the code:

Stack.tif has 62 slice;

AAA.tif is one slice from stack.tif.

====
  Miji();
 
  imgpath = 'D:\Lab\tempdate\123\2X2-MB-epac\ATM-Bad-1\Stack.tif';
  MIJ.run('Open...',['path=[',strrep(imgpath,'\','\\'),']']);
  imgpath = 'D:\Lab\tempdate\123\2X2-MB-epac\ATM-Bad-1\AAA.tif';
  MIJ.run('Open...',['path=[',strrep(imgpath,'\','\\'),']']);
  aSize = size(MIJ.getCurrentImage);
 
  width = aSize(2);
  height = aSize(1);
 

 
  MIJ.run('TurboReg ',...
      ['-align ',...%  // Register the two images that we have just prepared
      '-window ','AAA.tif',...% // Source (window reference).
       ' 0 0 ',num2str(width-1),' ',num2str(height-1),... % // No cropping.
       ' -window ','Stack.tif',...% Target
       ' 0 0 ',num2str(width-1),' ',num2str(height-1),...% // No cropping.
       ' -rigidBody ',...% // This corresponds to rotation and translation.
       num2str(width/2),' ',num2str(height/2),' ',...% // Source translation landmark.
       num2str(width/2),' ',num2str(height/2),' ',...% // Target translation landmark.
       '0 ',num2str(height/2),' ',...% // Source first rotation landmark.
       '0 ',num2str(height/2),' ',...% // Target first rotation landmark.
       num2str(width-1),' ',num2str(height/2),' ',...%// Source second rotation landmark.
       num2str(width-1),' ',num2str(height/2),' ',...% // Target second rotation landmark.
       '-showOutput']); %  // In case -hideOutput is selected, the only way to retrieve the registration results is by the way of another plugin.

Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

rmd06
In reply to this post by rmd06
Hi, LCY

I found just now that if I click "automatic", only two slice appears. However, if I click "batch", every slcie are successfully registrated. So it seems that the matlab code just run in "automatic",not the "batch". That's the reason.

Do you know how to make the input argument as "batch" mode?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

rmd06
In reply to this post by LCY
Hi

I found a way in macro:

In macro  beginning, add the line :

setBatchMode(true);

when finished,

setBatchMode(false);


But I do not know how to made it in matlab Miji.

MIJ.setBatchMode(true);  

erorr: Undefined function or variable 'setBatchMode'.
LCY
Reply | Threaded
Open this post in threaded view
|

Re: Cannot use TurboReg plugin by using matlab

LCY
Hi, rmd06,

I don't know how to set batch mode. Maybe StackReg or using a for loop can help.


Chunyue


2017-07-19 21:58 GMT+08:00 rmd06 [via ImageJ] <[hidden email]>:
Hi

I found a way in macro:

In macro  beginning, add the line :

setBatchMode(true);

when finished,

setBatchMode(false);


But I do not know how to made it in matlab Miji.

MIJ.setBatchMode(true);  

erorr: Undefined function or variable 'setBatchMode'.


If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5019089.html
To unsubscribe from Cannot use TurboReg plugin by using matlab, click here.
NAML