clairelbromley / ZebrafishKymographing

Various software tools written for analysis of lumen opening and membrane retraction in zebrafish.
1 stars 0 forks source link

Problems using cziFig for midline dynamics analysis #38

Closed clairelbromley closed 7 years ago

clairelbromley commented 7 years ago

Read with Claire so makes sense!

Step-by-step, analysis plan 1) Go through timelapse of cell of interest and ensure have full z extent for all timepoints 2) Remove any unneccessary z frames (taking into account movement over time) 2) Remove unwanted cells from z stack that overlap with cell of interest (potentially easier to using cropping mask just for unwanted cells - as will be fewer z sections with these in). Due to variations in shape over z and time- need to decide how many frames need to individually draw around cells for 3) Once unwanted regions have been cropped out, do maximum intensity projection (maximum as membrane should be brightest signal, and interested in the cell interface) 4) Kymograph analysis (need to select ROI by drawing a line)

Current hurdles in performing analysis 1) Need to crop out regions. Can do painstakingly in ImageJ, but then produces a tif file, which cannot be uploaded into czifig. Also - will need to do this cropping before max intensity projection 2) Also need to create substacks (can look into Zeiss software, but would be unable to use ImageJ for this due to creation of tifs after) 3) Turning off preprocessing. TO do so set line 81 (handles.params.kernelsize) to 1. Does this remove erosion dilation as well as thresholding 4) How do I change the region analysed over (pixel width) on cziFig, as will need to be optimised. 5) Input image is cropped? Potentially may need to prevent this happening if interface can move outside of the box 6) Double check that the line doesn't get automatically moved, as per basal kymograph analysis method 7) Ideally would want to generate a video that has the kymograph lines overlaid - therefore can see the extent to which sampling different areas of the membrane over time.

clairelbromley commented 7 years ago

Attempt to create macro using ImageJ (used plugins -> macros -> record):

run("Create Mask"); imageCalculator("Subtract create", "c:1:2; z:24:46; t:1:23 - Image 2 #1.tif","Mask"); selectWindow("Result of c:1:2; z:24:46; t:1:23 - Image 2 #1.tif"); selectWindow("c:1:2; z:24:46; t:1:23 - Image 2 #1.tif"); selectWindow("Result of c:1:2; z:24:46; t:1:23 - Image 2 #1.tif"); run("Save", "save=[/Volumes/Arthur/Result of c:1:2; z:24:46; t:1:23 - Image 2 #1.tif]"); close(); selectWindow("c:1:2; z:24:46; t:1:23 - Image 2 #1.tif"); close(); selectWindow("Mask"); close();

clairelbromley commented 7 years ago

It doesn't look like the macro recorder created anything that was much use (maybe?). Therefore, the sequence of steps that I used was: 1) Open movie of interest 2) Convert to 8 bit image 3) Draw freehand line round cells not interested in (note that need to do this for each z level individually, and also will need to repeat for the same z level but at a different time point) 4) Edit --> Selection --> Create mask 5) Process -> image calculator --> subtract mask (image - mask) 6) move on to next image

clairelbromley commented 7 years ago

Order of priorities: 1) Generate a macro in ImageJ that is able to help semi-automate the removal of unwanted cells from the image - steps used described above (if difficult to semi-automate, you can just tell me that I need to do it manually!)

2) Adapt czi viewer to:

3) Is it possible to create a video that has the kymograph lines overlaid - therefore can see the extent to which sampling different areas of the membrane over time? (if difficult don't worry about this - hopefully drift correction should help)

clairelbromley commented 7 years ago

https://drive.google.com/drive/folders/0B5BMTPgxKjfcdGpGbzMwR0J0bEU?usp=sharing

This googledrive folder contains a couple of example images c/1/2; z/22/46; t/1/23 - Image 2 #1 --> 1 z plane Result of c/1/2; z/22/46; t/1/23 - Image 2 #1 --> 1 z plane with unwanted cells removed (aiming for this!)

E1_09_42_03 --> all timepoints E1_09_42_03-t1 --> first timepoint

clairelbromley commented 7 years ago

Warning: slider control can not have a Value outside of Min/Max range Control will not be rendered until all of its parameter values are valid Warning: slider control can not have a Value outside of Min/Max range Control will not be rendered until all of its parameter values are valid

clairelbromley commented 7 years ago

Couldn't find a membrane front for 230514, Embryo 1 downwards, cut 1 kymograph position 5 - no quantitative kymograph data generated

result =

 kym_number: 6
kym_segment: [50x1 double]

Error using imdilate Expected input number 1, IM, to be non-NaN.

Error in images.internal.morphop>ParseInputs (line 125) validateattributes(A, {'numeric' 'logical'}, ...

Error in images.internal.morphop (line 21) [A,se,pre_pad,...

Error in imdilate (line 120) B = images.internal.morphop(A,se,'dilate',mfilename,varargin{:});

Error in extractQuantitativeKymographData (line 39) dummy = imdilate(kym_segment, se);

Error in cziFig>buttonGenerateKym_Callback (line 258) results = extractQuantitativeKymographData(kymographs, curr_metadata, userOptions);

Error in gui_mainfcn (line 95) feval(varargin{:});

Error in cziFig (line 42) gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)cziFig('buttonGenerateKym_Callback',hObject,eventdata,guidata(hObject))

Error using waitfor Error while evaluating uicontrol Callback

Warning: slider control can not have a Value outside of Min/Max range Control will not be rendered until all of its parameter values are valid Warning: slider control can not have a Value outside of Min/Max range Control will not be rendered until all of its parameter values are valid

clairelbromley commented 7 years ago

Hi, So I used cziFig.m I don't know if this is the correct thing to be using, as it doesn't seem to work for tiff files (which as discussed is the input post drift correction), and I also couldnt get the masking to work. It seemed to go straight to kymographing, even though I ticked the box to say I wanted to draw an exclusion mask?

screen shot 2016-11-29 at 13 50 22

Think you'll need to show me how to use it. Various error messages I got whilst trying to use the software are pasted above

clairelbromley commented 7 years ago

Lets talk about this tonight - ideally it would be good to get the kymograph analysis working for tif files so that I can use it to analyse the movement of my bleach data

For the bleach data I have single z plane timelapses - and I need to be able to draw a 'fake cut' on them so that I can look at the movement in the bleached area :)

clairelbromley commented 7 years ago

https://drive.google.com/drive/folders/0B5BMTPgxKjfcaklqTS11NGt1dFE?usp=sharing

Some example bleach data is in the above folder

Although the basic data is czi, again I will probably need to try drift correction - so the ability to use tiffs is required

clairelbromley commented 7 years ago

screen shot 2017-01-31 at 11 15 32

clairelbromley commented 7 years ago

Believe I'm using the correct code?

screen shot 2017-01-31 at 11 17 30

clairelbromley commented 7 years ago

Don't know if its a PC -> mac issue, or if I'm just doing something wrong - but if I select the image path on cziFig to be a multipage tif, an error comes up saying that the image has to be in czi format

clairelbromley commented 7 years ago

Downloaded the code just to make sure it wasn't just a branch switching error

dsb stop on errors did not stop anywhere, just came up with the error box as in screenshot above

dougkelly88 commented 7 years ago

From the screenshot it looks like you're still on an old commit, if you pull (/fetch then pull if it complains) then make sure you're on the right branch then we should be working from the same version.

That said, if you downloaded the code (zip?) then it may be a Mac issue. I'll check tonight.

On 31 Jan 2017 11:26 am, "clairelbromley" notifications@github.com wrote:

Downloaded the code just to make sure it wasn't just a branch switching error

dsb stop on errors did not stop anywhere, just came up with the error box as in screenshot above

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/clairelbromley/ZebrafishKymographing/issues/38#issuecomment-276339446, or mute the thread https://github.com/notifications/unsubscribe-auth/ADxBsMChS-9OCmXXykzR5f3G_KYPcRs8ks5rXxpygaJpZM4Kmaqs .

dougkelly88 commented 7 years ago

Sourcetree issue; merged cziFig stuff into main. Seems to be working OK on your laptop now.

On 1 February 2017 at 05:57, Doug Kelly dougkelly88@gmail.com wrote:

From the screenshot it looks like you're still on an old commit, if you pull (/fetch then pull if it complains) then make sure you're on the right branch then we should be working from the same version.

That said, if you downloaded the code (zip?) then it may be a Mac issue. I'll check tonight.

On 31 Jan 2017 11:26 am, "clairelbromley" notifications@github.com wrote:

Downloaded the code just to make sure it wasn't just a branch switching error

dsb stop on errors did not stop anywhere, just came up with the error box as in screenshot above

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/clairelbromley/ZebrafishKymographing/issues/38#issuecomment-276339446, or mute the thread https://github.com/notifications/unsubscribe-auth/ADxBsMChS-9OCmXXykzR5f3G_KYPcRs8ks5rXxpygaJpZM4Kmaqs .

dougkelly88 commented 7 years ago

Fixed in commit cbcf565022701a2406ef19eaf0bba9fb0c736d75.