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: importOri.m
    path of file: ./repos/Point_cloud_tools_for_Matlab/classes/@img
    
    the code of the file until where you have to start completion: function importOri(obj, file, varargin)
% IMPORTORI Import image (exterior and inner) orientation from file.

% Input parsing ----------------------------------------------------------------

validFormat = {'own' 'pix4d'};

p = inputParser;
p.addRequired('file', @ischar);
p.addParameter('Format', 'own', @(x) any(strcmpi(x, validFormat)));
p.parse(file, varargin{:});
p = p.Results;
% Clear required inputs to avoid confusion
clear file

% Start ------------------------------------------------------------------------

% procHierarchy = {'IMG' 'IMPORTORI'};
% msg('S', procHierarchy);
% msg('I', procHierarchy, sprintf('Image label = ''%s''', obj.label));

% Import orientation -----------------------------------------------------------

% Read whole file
fid = fopen(p.file);
allData = textscan(fid, '%s', 'Delimiter', '\n');
allData = allData{1}; % each line is one cell
fclose(fid);

if strcmpi(p.Format, 'own')

    % First line of image

    
function importOri(obj, file, varargin)
% IMPORTORI Import image (exterior and inner) orientation from file.

% Input parsing ----------------------------------------------------------------

validFormat = {'own' 'pix4d'};

p = inputParser;
p.addRequired('file', @ischar);
p.addParameter('Format', 'own', @(x) any(strcmpi(x, validFormat)));
p.parse(file, varargin{:});
p = p.Results;
% Clear required inputs to avoid confusion
clear file

% Start ------------------------------------------------------------------------

% procHierarchy = {'IMG' 'IMPORTORI'};
% msg('S', procHierarchy);
% msg('I', procHierarchy, sprintf('Image label = ''%s''', obj.label));

% Import orientation -----------------------------------------------------------

% Read whole file
fid = fopen(p.file);
allData = textscan(fid, '%s', 'Delimiter', '\n');
allData = allData{1}; % each line is one cell
fclose(fid);

if strcmpi(p.Format, 'own')

    % First line of image
    idxFirstLine = find(strncmpi(['# ' obj.label], allData, numel(obj.label)+2));

    % Get next line
    i = 1;
    line = allData{idxFirstLine+i};

    while ~strcmpi(line(1), '#')

        % Add semicolon if not included
        if ~strcmp(line(end