To extract the angle data between the Nucleus-Golgi axis and the optogenetic axis (follow the scripts by the roman numerals in the beginning of the name):


1) Get centroid positions of the cell, nucleus, Golgi and optogenetic activation area:

	- Segment cell shape and get the centroid of the cell by running "I_segment_cell.m" script and loading a "*_561.tif" movie file of a selected cell (analyzed cell by cell, by adjusting the fluorescent threshold with the help of the GUI). 

	- Get the centroid of Golgi by running "II_segment_golgi.m" script and loading a "_642.tif" movie file of a selected cell (analyzed cell by cell, by adjusting the fluorescent threshold with the help of the GUI).

	- Get the centroid of the optogenetic area by running "III_segment_opto.m" script and loading a "*_Sola_bright.tif" filr of a selected cell (analyzed cell by cell, by adjusting the fluorescent threshold with the help of the GUI). If difficult to to segment, manual tracking can be used ("tracknuc.m" - positioning two axes to point the extremes, "tracknucSingleClick.m" - positioning a blue dot in the center or "tracknucSingleClick2.m" - clicking in the center (find these scripts in the "IV_TRACKNUC" folder).

	- Get the centroid of the nucleus by the before mentioned "IV_TRACKNUC" scripts.


2) Correct the extracted centroids according to the movement of the microscope stage ("*_Positions.mat" file needed; be careful with the interval number between frames (every 10th frame in optogenetic experiments)) and, like this get the information of the trajectory of the cell:
	
	- Correct the "*_res_cell.mat" file with "V_saveCellTrajectory_new.m" script.

	- Correct the "*_res_golgi.mat" file with "VI_saveCellTrajectory_new_golgi.m" script.

	- Correct the "*_res_opto.mat" file with "VII_saveCellTrajectory_new_opto.m" script.

	- Correct the "*_res_nucleusSC.mat" file with "IVa_nucleusSC_to_nucleus_centroid.m" and "VIII_saveCellTrajectory_new_nucleus.m" script.

	- Plot all different trajectories to verify the results with "IX_plot_coord_trajectory.m" script.


3) Plot the angle between the Nucleus-Golgi and the Nucleus-optogenetic activation axes:
	
	- Use "Xa_angle_trajectory_new.m" or "Xb_angle_trajectory_new_L.m" scripts, depending on the axis movement direction.

SAVE the "*_angleReorient.mat" file for FURTHER ANALYSIS.