
These are the matlab codes for the 3D image processing reported in this manuscript.
Recommend to run on Matlab 2018 or above versions in a computer with at least 20Gb memory to avoid out-of-memory problem.


------------------------------------------------------------------------------------------------------   
FIRST STEP
%% DualFushionTutorial.m

This program provides 2 different methods to get fushion images from the opposite z-stack raw images.

1.Run DualFushionTutorial.m
2.Select file folders containing the two opposite z-stack raw images. 
3.According to the output figure, decide if the maximum-area section is contained in the range. If 
not, input '0' and change the range. Otherwise,input '1' and go on.
4.Choose a method to conduct image fusion. We use the faster but less robust one by default. A more 
robust method is also provided.

More detailed information such as the changeable parameters are well explained in the code.

------------------------------------------------------------------------------------------------------   
SECOND STEP
%% differentAnglePlot.m 

This program helps to get the image of the embryo of a plane crossing the main AP axis.

Change the file directory and parameters in the "Initialization" and "Parameters" part for your own data.

This program is a little memory-consuming and time-consuming. We would recommend 20Gb memory to 
avoid out-of-memory problem.

More detailed information such as the changeable parameters are well explained in the code.

------------------------------------------------------------------------------------------------------   
THIRD STEP
%% Main_ImageAnalysis_fix_embryos.m

This program helps to obtain the profiles of target genes (eg. Hunchback). 

CheckHbboundary_7Eve_LSM.m allows the user to manually check whether the hunchback boundary is properly detected. Input Y if the result is good, otherwise N.

Notes about debug when running:

1. The direction of AP axis can't fliplr, please run the Imge_fliplr.m manually. Also change the PR in 
Main_ImageAnalysis_fix_embryos.m (row 12);

2. To obtain a good embryo mask , please check the threshold value and adjust the cutoff in K_mask_zhc_2.m



------------------------------------------------------------------------------------------------------   
If there are any problems when running, welcome to contact us.






