Shifting and drifting of images

65 views
Skip to first unread message

Bryant Walker

unread,
Jun 30, 2015, 4:07:48 PM6/30/15
to microbe...@googlegroups.com
Hello everyone, 

I am having problems using the align part of microbeTracker. I have some images that just drift slightly and when using the align button and even the shift button like the website says to use i get an error from matlab about the shift. If I only hit the align button i cannot tell if all the images have aligned. The directions on the align and shift from the website seem vague so any help would be appreciated.

The other problem I have is in some of my images my phase image and fluorescent images are actually shifted from eachother. Like the outline of the cells from the phase images do not outline the fluorescent image cells do to this shift. Is there any way to shift the phase to match the fluorescent images so the coordinates will be the same during analysis in a different matlab program? I have tried using imageJ and manually shifting the phase but then microbeTracker will not read that shifted image to give coordinate data. So I do not know how to correct for this shift besides just going back and re-imaging and hopefully have no shift.

Thanks
Bryant Walker

jakw...@gmail.com

unread,
Jul 9, 2015, 1:24:18 PM7/9/15
to microbe...@googlegroups.com
Could you paste the error message? It may be easier to answer your questions.

To the other part of your questions, if you know the shift of two images you can either add that shift to every value in the microbeTracker generated file, or you can shift you fluorescent images by this number, or if you wish to do it manually:

ImageJ > Image > Transform > Translate and then just add the shift, and save images. I didn't test it, but if you save your image it should do what you want.

Now I think that the first solution is stupid, but maybe you want to learn matlab.

Best,
J.

Bryant Walker

unread,
Oct 2, 2015, 4:09:39 PM10/2/15
to MicrobeTracker_Jacobs-Wagner Lab, jakw...@gmail.com
I figured out the problems but now I have a different problem. Still have a drift problem but seems microbetracker can not fix it because it is subpixel shift. Does not even shift more than one pixel. And then when I export the images they are not aligned either. I just saw the aligntool program and am trying that and the saw a function for subpixel shifting but not sure how to use that. Any help would be appreciated.

Thanks
Bryant Walker

Seán Murray

unread,
Oct 5, 2015, 5:00:41 AM10/5/15
to MicrobeTracker_Jacobs-Wagner Lab
Have a look at the FRAP tutorial. It shows how to do subpixel alignment of a fluorescent stack if that is what you want. It will not help with phase-fluorescence mis-alignment.

If the phase and fluorescence are off by less than a pixel then you can shift the meshes yourself manually and then calculate the signal.
something like
mesh(:,[1 3])=mesh(:,[1 3])+xshift;
mesh(:,[2 4])=mesh(:,[2 4])+yshift;

Sean

Bryant Walker

unread,
Oct 6, 2015, 5:45:01 PM10/6/15
to MicrobeTracker_Jacobs-Wagner Lab
Yeah I have looked at that but it aligns the contours and not the images. The problem that I am having is I am using the contours to get regions of interest for cells and the region shifts because microbetracker has different contour lengths depending on which image it is. Like it will have a length of 33 pixels and then jump to 32 which will shift my region and then jump back to 33 the next image and so on. So I get in accurate data. So I was trying to use microbeTracker to align the images so I could then just use one contour for all images so it would not shift lengths. Unless anyone knows a way to manually make the contour lengths all the same in microbeTracker because other wise i have a program that does match the correct contour to the correct image to correct for the drifting but then the lengths of the contours change which change the region that I am interested in. 

Seán Murray

unread,
Oct 7, 2015, 3:19:42 AM10/7/15
to MicrobeTracker_Jacobs-Wagner Lab
Cells can grow and contract and is detected by Microbetracker. Of course, there is a certain noise and the contour can change for a cell that is not growing or shrinking.

After aligning the images (I like Align Slices in the cvMatch_Temmplate plugin for FIJI), you can just use the first slice of the phase-contrast stack to get the contour and then copy it to all the other slices. This is explained in the FRAP tutorial.

Alternatively, define your region in a better way, for example relative to cell length e.g. choose the segment closest the 1/4 cell length position...
You can also interpolate the signal to overcome the discreteness of the segments.
If you are actually measuring fluorescence, then you can identify peaks and positions in the signal automatically without having to choose a ROI.

Without a more detailed description of your problem, it's difficult to suggest more.

Bryant Walker

unread,
Oct 7, 2015, 2:21:45 PM10/7/15
to MicrobeTracker_Jacobs-Wagner Lab
Yes I have run the FRAP tutorial and for some reason microbeTracker will not give me the data for the coordinates. In the mesh should be a cellList matrix and when I just have the one phase and then do the subpixelalign of that original contour it will not save the cellList matrix data which is what I need. Do you possibly know why? For your second part about the ROI i need that because the region changes because I am studying how FtsZ is distributed throughout the cell and then how it distributes to the z ring. I am doing power spectral density analysis of these ROI. 

jakw...@gmail.com

unread,
Oct 7, 2015, 6:26:16 PM10/7/15
to MicrobeTracker_Jacobs-Wagner Lab
It could possibly be easier if you say how you are getting ROIs in the first place, maybe the problem is there. Also you can post which commands you input into the Matlab, maybe you are missing something?
It's hard to answer without knowing that, you can look up on the stack overflow how it's usually done.

Bryant Walker

unread,
Oct 8, 2015, 3:04:07 PM10/8/15
to MicrobeTracker_Jacobs-Wagner Lab, jakw...@gmail.com
Actual I figured out that the reason microbeTracker does not save my 300x300 cellList is because it needs matfile v7.3, which still takes forever for it to save since the array is so big. My code for ROI is not the problem because it has been tested and used on a lot of other projects and worked fine its just microbeTracker was producing different length contours for each phase image for one cell which when i analyzed the cell the region is a rectangle and that rectangle will shift back and forth depending on the length of the contour since the rectangle height and width is determined by the contour. 
Reply all
Reply to author
Forward
0 new messages