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: computeCellDistances.m
    path of file: ./repos/ciatah/@ciatah
    
    the code of the file until where you have to start completion: function obj = computeCellDistances(obj)
	% Calculates within session cell-cell distances.
	% Biafra Ahanonu
	% started: 2014.07.31
		% 2021.07.23 [13:50:08] branched from CIAtah
		% branch from calciumImagingAnalysis 2020.05.07 [15:16:56]
	% inputs
		%
	% outputs
		%
		
	% changelog
		% 2021.07.23 [00:22:22] - Added plots that show the distribution of cell-cell distances.
		% 2021.08.10 [09:57:36] - Updated to handle CIAtah v4.0 switch to all functions inside ciapkg package.

	import ciapkg.api.* % import CIAtah functions in ciapkg package API.
		
	obj.sumStats = [];
	obj.sumStats.cellDistances = [];
	obj.sumStats.cellPairs = [];
	obj.sumStats.sessionStr = {};

	[fileIdxArray, idNumIdxArray, nFilesToAnalyze, nFiles] = obj.getAnalysisSubsetsToAnalyze();

	for thisFileNumIdx = 1:nFilesToAnalyze
		try
			thisFileNum = fileIdxArray(thisFileNumIdx);
			obj.fileNum = thisFileNum;
			% disp(repmat('=',1,21))
			fprintf('%s\n %d/%d (%d/%d): %s\n',repmat('=',1,21),thisFileNumIdx,nFilesToAnalyze,thisFileNum,nFiles,obj.fileIDNameArray{obj.fileNum})
			% disp([num2str(thisFileNum) '/' num2str(nFiles) ': ' obj.fileIDNameArray{obj.fileNum}]);

			% try
			% obj.modelVarsFromFilesCheck(thisFileNum);
			 obj.modelVarsFromFilesCheck(thisFileNum);
			methodNum = 2;
			if methodNum==1
				disp('Using previously computed centroids...')
				[inputSignals, inputImages, signalPeaks, signalPeaksArray, valid] = modelGetSignalsImages(obj,'returnOnlyValid',1);
				xCoords = obj.objLocations{obj.fileNum}.(obj.signalExtractionMethod)(valid,1);

    
function obj = computeCellDistances(obj)
	% Calculates within session cell-cell distances.
	% Biafra Ahanonu
	% started: 2014.07.31
		% 2021.07.23 [13:50:08] branched from CIAtah
		% branch from calciumImagingAnalysis 2020.05.07 [15:16:56]
	% inputs
		%
	% outputs
		%
		
	% changelog
		% 2021.07.23 [00:22:22] - Added plots that show the distribution of cell-cell distances.
		% 2021.08.10 [09:57:36] - Updated to handle CIAtah v4.0 switch to all functions inside ciapkg package.

	import ciapkg.api.* % import CIAtah functions in ciapkg package API.
		
	obj.sumStats = [];
	obj.sumStats.cellDistances = [];
	obj.sumStats.cellPairs = [];
	obj.sumStats.sessionStr = {};

	[fileIdxArray, idNumIdxArray, nFilesToAnalyze, nFiles] = obj.getAnalysisSubsetsToAnalyze();

	for thisFileNumIdx = 1:nFilesToAnalyze
		try
			thisFileNum = fileIdxArray(thisFileNumIdx);
			obj.fileNum = thisFileNum;
			% disp(repmat('=',1,21))
			fprintf('%s\n %d/%d (%d/%d): %s\n',repmat('=',1,21),thisFileNumIdx,nFilesToAnalyze,thisFileNum,nFiles,obj.fileIDNameArray{obj.fileNum})
			% disp([num2str(thisFileNum) '/' num2str(nFiles) ': ' obj.fileIDNameArray{obj.fileNum}]);

			% try
			% obj.modelVarsFromFilesCheck(thisFileNum);
			 obj.modelVarsFromFilesCheck(thisFileNum);
			methodNum = 2;
			if methodNum==1
				disp('Using previously computed centroids...')
				[inputSignals, inputImages, signalPeaks, signalPeaksArray, valid] = modelGetSignalsImages(obj,'returnOnlyValid',1);
				xCoords = obj.objLocations{obj.fileNum}.(obj.signalExtractionMethod)(valid,1);
				yCoords = obj.objLocations{obj.fileNum}.(obj.signalExtractionMethod)(valid,2);
				% npts = length(xCoords);
				% distanceMatrix = diag(zeros(1,npts))+squareform(distMatrix);
			else
			% catch
				[inputSignals, inputImages, signalPeaks, signalPeaksArray, valid] = modelGetSignalsImages(obj,'returnType','raw');
				nIDs = length(obj.stimulusNameArray);
				nSignals = size(inputSignals,1);
				if isempty(inputImages);continue;end