I’d like to correct pixel shifts in confocal images acquired with bidirectional scanning. The problem is that the shift is variable, as in this example where the shift varies in severity from right to left:
LOL it’s a wonderful approximation for our application! But like you it doesn’t sit well with me either as it’s nowhere near correcting the artifact. I agree that the trivial solution of not getting the artifact in the first place is the best; I believe instrument service is in order…
Please accept the fact that even properly chosen vertical lowpass-filtering does not compensate for the row-shifts but only removes the periodicity introduced by the shifts. This means that the shifts are still there but their appearance is different.
In short, please stay away from this method.
It is signal-theoretically unfounded and its effects may lead to false conclusions.
I wish you the very best with the serviced device.
Thanks so much for your advice; I agree. For that particular image my user just cares about “pretty picture” appearance and they’re zooming way out so it should be ok. I’ll make sure they understand the limitations and disclose the filtering if they publish it.
I’ve seen the variable shift on systems from different manufacturers, though not this severe, so maybe a correction algorithm would have broad appeal. Might you be able to point me to more info about a local correlation approach as you suggest? Would like to at least give a try to coding it myself. Maybe offline at firstname.lastname@example.org and I can post a solution if anything ever comes of it.
I wouldn’t allow somebody to publish such data.
Does it have any medical relevance?
I should like to stay on the Forum for the usual reasons.
As mentioned before, a solution will be costly and I can’t estimate how good the results will be.
If the shifts in question are really due to the scanners, then you should complain to the manufacturers. I can hardly believe that they ship such products. At least they should comment on the very results and perhaps control there production and deliver assistance. For now the best I can recommend is that you carefully watch the servicing process and finally run a scan to check if the image quality is flawless. If not, don’t accept the servicing.
Just take part of a row and compute the 1D-correlation functions with the corresponding part in the row above and in the row below. The maxima of the correlation functions should give you an estimate of the local offset.
Here is an example that allows “correlation by eye”
(gray squares denote single pixels):
The maxium of the correlation function computed from the middle row and the top row is at 3 (shifts to the right positive).
The maxium of the correlation function computed from the middle row and the bottom row is at 4 (shifts to the right positive).
Consequenly, the estimated shift for the middle row is 3.5 pixels to the right, which would require interpolations.
It may however be that the shifts are in fact scale changes …
I don’t think it is worthwhile bothering with remedies if devices are malfunctioning. The effort you put into such undertaking is better spent in constructive research.