I have 3D image stacks of a dendrite over time and want to register every image stack to the first one of the series. I found the function imregister and want to use it, but the resulting alignment is not very well. Please find two example images and a registration attempt attached. The images are created using two-photon microscopy.
I played around with the parameters but I feel like I can do this forever and I still have Mean-Squared Errors around 380. The images are also quite small, voxel size of 0.007 microns in X&Y and 0.6 microns in Z; image size = 512x512x22. The 3D array has values from 0-255.
So I wanted to ask for some experience/tips in choosing parameters especially for such an image size, or if you spot any error in my code. How should I proceed?
Here is my code
fixed = get3DImage(<fixedImage>); %returns 3D array containing my image, uint8
moving = get3DImage(<movingImage>);Rfixed = imref3d(size(fixed),0.000007,0.000007,0.0006); %Pixel extent in world parameters
Rmoving = imref3d(size(moving),0.000007,0.000007,0.0006);[optimizer, metric] = imregconfig('monomodal');optimizer.MaximumStepLength = 6.25e-05; optimizer.MinimumStepLength = 0.9e-05;optimizer.MaximumIterations = 1000;movingRegistered = imregister(moving,Rmoving, fixed, Rfixed, 'rigid', optimizer, metric);
Any help appreciated! Thanks
Best Answer