diff --git a/MainScripts/formatTableOuputSurfaceCombine.m b/MainScripts/formatTableOuputSurfaceCombine.m index f0ad0d21ecc8017856f846d21358e7583dbaf882..20347028580fefbdf289efeb04e47473c55a353a 100644 --- a/MainScripts/formatTableOuputSurfaceCombine.m +++ b/MainScripts/formatTableOuputSurfaceCombine.m @@ -1,23 +1,23 @@ -function [tableOutputDeproj, tableOutputBell] = formatTableOuputSurfaceCombine(dataCells,dataSeg) +function tableOutputDeproj = formatTableOuputSurfaceCombine(dataCells,dataSeg) % Format the important variables into a table output for simpler handling tableOutputDeproj = table; -tableOutputBell = table; +% tableOutputBell = table; %% Cell numbering -tableOutputDeproj.Numbers = dataCells.numbers; -tableOutputBell.Numbers = dataSeg.CELLS.numbers(dataCells.numbers); +tableOutputDeproj.cellIdx = dataCells.cellIdx'; +% tableOutputBell.Numbers = dataSeg.CELLS.numbers(dataCells.cellIdx); %% Cell center (ellipse real) -for bioCell = 1:numel(dataCells.numbers) +for bioCell = 1:numel(dataCells.cellIdx) EllipseRealCenter(bioCell,:) = dataCells.cellContour3D{bioCell}.ellipseReal.center; end tableOutputDeproj.EllipseRealCenter = EllipseRealCenter; %% Cell areas -for bioCell = 1:numel(dataCells.numbers) +for bioCell = 1:numel(dataCells.cellIdx) areaEllReal(bioCell) = dataCells.cellContour3D{bioCell}.ellipseRotViaOri.areaEllipse; areaEllProj(bioCell) = dataCells.cellContour2D{bioCell}.ellipseProj.areaEllipse; end @@ -25,26 +25,26 @@ tableOutputDeproj.AreaReal = cell2mat(dataCells.area.areaRealTot); tableOutputDeproj.AreaProj = cell2mat(dataCells.area.areaProjTot); tableOutputDeproj.AreaEllReal = areaEllReal'; tableOutputDeproj.AreaEllProj = areaEllProj'; -tableOutputBell.AreaBell = dataSeg.CELLS.areas(dataCells.numbers); +% tableOutputBell.AreaBell = dataSeg.CELLS.areas(dataCells.cellIdx); %% Cell neighbours -tableOutputDeproj.nbrNeighbours = dataSeg.CELLS.n_neighbors(dataCells.numbers); -tableOutputBell.nbrNeighbours = dataSeg.CELLS.n_neighbors(dataCells.numbers); +% tableOutputDeproj.nbrNeighbours = dataSeg.CELLS.n_neighbors(dataCells.cellIdx); +% tableOutputBell.nbrNeighbours = dataSeg.CELLS.n_neighbors(dataCells.cellIdx); %% Cell anisotropy (Bellaiche style) % Change for precalculated values ! -for bioCell = 1:numel(dataCells.numbers) +for bioCell = 1:numel(dataCells.cellIdx) elongationReal(bioCell) = dataCells.cellContour3D{bioCell}.ellipseRotViaOri.semiMajAx / ... dataCells.cellContour3D{bioCell}.ellipseRotViaOri.semiMinAx; elongationProj(bioCell) = dataCells.cellContour2D{bioCell}.ellipseProj.semiMajAx / ... dataCells.cellContour2D{bioCell}.ellipseProj.semiMinAx; - elongationBell(bioCell) = dataSeg.CELLS.anisotropies(dataCells.numbers(bioCell)); +% elongationBell(bioCell) = dataSeg.CELLS.anisotropies(dataCells.cellIdx(bioCell)); end tableOutputDeproj.anisostropyReal = 1-1./elongationReal'; tableOutputDeproj.anisotropyProj = 1-1./elongationProj'; -tableOutputBell.anisotropyBell = elongationBell'; +% tableOutputBell.anisotropyBell = elongationBell'; %% Cell longer axis -for bioCell = 1:numel(dataCells.numbers) +for bioCell = 1:numel(dataCells.cellIdx) semiMajorAxisReal(bioCell) = dataCells.cellContour3D{bioCell}.ellipseRotViaOri.semiMajAx; semiMajorAxisProj(bioCell) = dataCells.cellContour2D{bioCell}.ellipseProj.semiMajAx; end @@ -52,19 +52,19 @@ tableOutputDeproj.semiMajAxisReal = semiMajorAxisReal'; tableOutputDeproj.semiMajAxisProj = semiMajorAxisProj'; %% Cell angle (Projected only) -for bioCell = 1:length(dataCells.numbers) +for bioCell = 1:length(dataCells.cellIdx) % angleReal(bioCell) = % dataCells.cellContour3D{bioCell}.ellipseRotViaOri.alpha; => Not % calculated yet angleProj(bioCell) = dataCells.cellContour2D{bioCell}.ellipseProj.alpha; - angleBell(bioCell) = dataSeg.CELLS.orientations(dataCells.numbers(bioCell)); +% angleBell(bioCell) = dataSeg.CELLS.orientations(dataCells.cellIdx(bioCell)); end % tableOutputDeproj.angleReal = angleReal'; tableOutputDeproj.angleProj = angleProj'; -tableOutputBell.angleBell = angleBell'; +% tableOutputBell.angleBell = angleBell'; %% Cell orientation real -for bioCell = 1:numel(dataCells.numbers) % Only keep the end point of the vector. The beginning is the ellipse center +for bioCell = 1:numel(dataCells.cellIdx) % Only keep the end point of the vector. The beginning is the ellipse center if isnan(dataCells.cellContour3D{bioCell}.ellipseReal.normOrientation(1,1)) EllipseRealOrient(bioCell,:) = dataCells.cellContour3D{bioCell}.ellipseReal.normOrientation(1,1); else @@ -75,7 +75,7 @@ end tableOutputDeproj.EllipseRealOrient = EllipseRealOrient; %% Cell perimeters -for bioCell = 1:length(dataCells.numbers) +for bioCell = 1:length(dataCells.cellIdx) perimeterReal(bioCell) = dataCells.cellContour3D{bioCell}.perimeterReal; perimeterProj(bioCell) = dataCells.cellContour2D{bioCell}.perimeterProj; perimeterEllipseReal(bioCell) = dataCells.cellContour3D{bioCell}.ellipseRotViaOri.perimeterEllipse; @@ -83,13 +83,13 @@ end tableOutputDeproj.perimeterReal = perimeterReal'; tableOutputDeproj.perimeterProj = perimeterProj'; tableOutputDeproj.perimeterEllipseReal = perimeterEllipseReal'; -tableOutputBell.perimeterBell = dataSeg.CELLS.perimeters(dataCells.numbers); +% tableOutputBell.perimeterBell = dataSeg.CELLS.perimeters(dataCells.cellIdx); %% Field naming tableOutputDeproj.Properties.VariableNames = {'cellID' 'centerEllipseReal' 'AreaReal' 'AreaProj' 'AreaEllipseReal' 'AreaEllipseProj'... - 'NbrNeighbours' 'AnisotropyReal' 'AnisotropyProj' 'semiMajAxReal' 'semiMajAxProj' 'AngleProj' 'OrientationEllipseReal'... + 'AnisotropyReal' 'AnisotropyProj' 'semiMajAxReal' 'semiMajAxProj' 'AngleProj' 'OrientationEllipseReal'... 'PerimeterReal' 'PerimeterProj' 'PerimeterEllipseReal'}; -tableOutputBell.Properties.VariableNames = {'cellID' 'AreaBell' 'NbrNeighbours' 'AnisotropyBell' 'AngleBell'... - 'PerimeterBell'}; +% tableOutputBell.Properties.VariableNames = {'cellID' 'AreaBell' 'NbrNeighbours' 'AnisotropyBell' 'AngleBell'... +% 'PerimeterBell'}; end