Difference between revisions of "EyeSeeCam SCI"

From biophysics
Jump to navigation Jump to search
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
[[File:EyeSeeCam_SCI2.png|thumb|EyeSeeCam SCI]]
 
[[File:EyeSeeCam_SCI2.png|thumb|EyeSeeCam SCI]]
 
==Description==
 
==Description==
 +
 +
==Matlab programming==
 +
 +
===Matlab interface===
 
%todo
 
%todo
 +
 +
===Converting rotation speed===
 +
<pre>
 +
%make a coordinate object
 +
mycoordinates_XYZ = coordinates_XYZ(startingGaze);
 +
 +
% initialize R_total to 3D unit matrix
 +
R_total = [1,0,0;0,1,0;0,0,1];
 +
 +
%loop through al timesteps
 +
for i = (timeRange)
 +
 +
    % determine the angle changes between time t(i)-delta_t/2 to t(i)+delta_t/2
 +
    delta_angleX = Vx(i)*delta_t;
 +
    delta_angleY = Vy(i)*delta_t;
 +
    delta_angleZ = Vz(i)*delta_t;
 +
 +
    %create a rotation matrices
 +
    delta_Rx = Rx(delta_angleX);
 +
    delta_Ry = Ry(delta_angleY);
 +
    delta_Rz = Rz(delta_angleZ);
 +
 +
    %multiply rotation matrices (order is not important if angles are small enough)
 +
    delta_R = delta_Rx * delta_Ry * delta_Rz;
 +
 +
    % determine new R_total
 +
    % rotation in device coordinates, order: R_total * delta_R   
 +
    R_total = R_total * delta_R;
 +
 +
    %rotate startingpoint with R_total
 +
    newpoint = R_total * startingGaze;
 +
 +
    %add new position to list of coordinates
 +
    mycoordinates_XYZ.add(newpoint);   
 +
end
 +
 +
% transform XYZ to RAS coordinates with EyeSeeCam definition
 +
mycoordinates_RAS = transform_XYZ2RAS(mycoordinates_XYZ, definition_XYZ2RAS_EyeSeeCam_Sci);
 +
mycoordinates_DP  = transform_RAS2DP(mycoordinates_RAS);
 +
 +
</pre>

Revision as of 10:04, 1 May 2024

EyeSeeCam SCI

Description

Matlab programming

Matlab interface

%todo

Converting rotation speed

%make a coordinate object 
mycoordinates_XYZ = coordinates_XYZ(startingGaze);

% initialize R_total to 3D unit matrix
R_total = [1,0,0;0,1,0;0,0,1];

%loop through al timesteps
for i = (timeRange)

    % determine the angle changes between time t(i)-delta_t/2 to t(i)+delta_t/2
    delta_angleX = Vx(i)*delta_t;
    delta_angleY = Vy(i)*delta_t;
    delta_angleZ = Vz(i)*delta_t;

    %create a rotation matrices
    delta_Rx = Rx(delta_angleX);
    delta_Ry = Ry(delta_angleY);
    delta_Rz = Rz(delta_angleZ);

    %multiply rotation matrices (order is not important if angles are small enough) 
    delta_R = delta_Rx * delta_Ry * delta_Rz;

    % determine new R_total 
    % rotation in device coordinates, order: R_total * delta_R    
    R_total = R_total * delta_R;

    %rotate startingpoint with R_total
    newpoint = R_total * startingGaze;

    %add new position to list of coordinates
    mycoordinates_XYZ.add(newpoint);    
end

% transform XYZ to RAS coordinates with EyeSeeCam definition
mycoordinates_RAS = transform_XYZ2RAS(mycoordinates_XYZ, definition_XYZ2RAS_EyeSeeCam_Sci);
mycoordinates_DP  = transform_RAS2DP(mycoordinates_RAS);