Filter löschen
Filter löschen

3D image alignment in a stack

6 Ansichten (letzte 30 Tage)
Irene Fernandez Ugidos
Irene Fernandez Ugidos am 16 Dez. 2021
Hi,
I have a stack of images in a 3D matrix (128x128x500) that I want to align.
I tried:
tiff_stack3=imregister(tiff_stack2,tiff_stack2(:,:,1),'translation','RegularStepGradientDescent','MeanSquares');
sliceViewer(tiff_stack3)
where tiff_stack2 is the matrix that I want to align.
However, Matlab dropped me an error like this:
Error using imregtform>parseInputs (line 268)
The value of 'OptimConfig' is invalid. Invalid optimizer configuration object specified.
Error in imregtform (line 124)
parsedInputs = parseInputs(varargin{:});
Error in imregister (line 119)
tform = imregtform(varargin{:});
Error in Diawork3d (line 19)
tiff_stack3=imregister(tiff_stack2,tiff_stack2(:,:,1:3),'translation','RegularStepGradientDescent','MeanSquares');
Does anyone have any clue about how to align a stack of images using a code? Thank you

Akzeptierte Antwort

Matt J
Matt J am 16 Dez. 2021
N=size(tiff_stack2,3);
[opt,metric]=imregconfig('monomodal');
for i=1:N
tiff_stack3{i}=imregister(tiff_stack2(:,:,i),tiff_stack2(:,:,1),'translation',opt,metric);
end
tiff_stack3=cat(3,tiff_stack3{:});
  1 Kommentar
Irene Fernandez Ugidos
Irene Fernandez Ugidos am 22 Dez. 2021
Thank you so much!
It worked beautifully as follows:
N=size(tiff_stack2,3);
[opt,metric]=imregconfig('monomodal');
for i=1:N
tiff_stack3(:,:,i)=imregister(tiff_stack2(:,:,i),tiff_stack2(:,:,1),'translation',opt,metric);
end
sliceviewer(tiff_stack3)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by