You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: orthogonal_siddon.m
    path of file: ./repos/OMEGA/source
    
    the code of the file until where you have to start completion: function [ lor, indices, alkiot, discard] = orthogonal_siddon( Ny, Nx, Nz, d, dz, by, bx, bz, z_det, x, y, yy, xx , NSinos, NSlices, vaimennus, index, pituus, attenuation_correction)
%IMPROVED_SIDDON_ATTEN Function to calculate the Siddon's algorithm
%   This function calculates the line intersections in a pixel space by
%   using the Siddon's algorithm and converts them to probabilities. This
%   function also determines the LORs that are not in the desired slices.

    
function [ lor, indices, alkiot, discard] = orthogonal_siddon( Ny, Nx, Nz, d, dz, by, bx, bz, z_det, x, y, yy, xx , NSinos, NSlices, vaimennus, index, pituus, attenuation_correction)
%IMPROVED_SIDDON_ATTEN Function to calculate the Siddon's algorithm
%   This function calculates the line intersections in a pixel space by
%   using the Siddon's algorithm and converts them to probabilities. This
%   function also determines the LORs that are not in the desired slices.
%   Only those LORs that are inside the slice interval are taken into
%   account. Returns the LORs, the pixel coordinates, and the
%   probabilities, in addition to the detector pairs that are not included
%   (i.e. they are discarded). This code doesn't take into account the LORs that
%   do not originate from the specified block-interval.
%
% INPUTS: 
%
% LL contains the detector numbers of each LOR in the measurement vector
% LOOP_VAR_PAR is the length of the subset used for the current
% subiteration
% PIKSELIKOKO defines the size of the image matrix in x and y directions
% NY is the length of the y direction
% NX same for x
% NZ same for z
% D defines the square (pixel) length, that is the distance between pixel
% boundaries in x and y directions
% DZ same for z direction
% BY the distance from the origin to the pixel space in y direction
% BX same for x
% BZ same for z
% OSAJOUKOT the subset intervals used for OSEM reconstruction
% TEST current subiteration (subset)
% Z_DET detector ring locations in z dimension (axial)
% X detector ring locations in x direction (radial)
% Y same for y
% IIJ pixel boundaries in x directon (iij=0:Nx)
% JJI same for y
% KKJ same for z
% YY 
bxb = bx + double(Nx) * d;
byb = by + double(Ny) * d;
bzb = bz + double(Nz) * dz;
z_det = z_det(1:NSinos,:);
size_x = size(x,1);
% loop_var_par = NSinos*size(x,1);
indices=cell((pituus),1);
alkiot=cell((pituus),1);
% indices=zeros(100,(loop_var_par)/100,'int32');
% alkiot=zeros(100,(loop_var_par)/100,'int32');
lor=zeros((pituus),2,'int32');
discard=true((pituus),1);
% apu_var=osajoukot(test);
vaimennuskuva = 0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%vaimennusasiat:
if attenuation_correction
    vaimennuskuva = vaimennus(:,:,1:NSlices);
    vaimennuskuva = vaimennuskuva(:);
end