Re: Cannot use TurboReg plugin by using matlab
Posted by rmd06 on Jul 19, 2017; 12:08pm
URL: http://imagej.273.s1.nabble.com/Cannot-use-TurboReg-plugin-by-using-matlab-tp5017668p5019086.html
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.