-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusted 3D display code for displaying multiple cell counter types.
- Loading branch information
1 parent
5b3b24e
commit bea9601
Showing
5 changed files
with
110 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ data/* | |
*.backup | ||
gen/* | ||
*.csv | ||
*.asv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,40 @@ | ||
function [im_fn,MarkerXY] = readImageJCellCount(filename,typeIdx) | ||
function [im_fn,Markers] = readImageJCellCount(filename) | ||
|
||
%% load XML | ||
|
||
S = readstruct(filename); | ||
% data structure | ||
% S -> ImageProperties | ||
% -> | ||
% -> | ||
% S.Marker_Data.Marker_Type: struct array of different marker types | ||
% S.Marker_Data.Marker_Type.Marker: 1xn struct array with fields: | ||
% MarkerX | ||
% MarkerY | ||
% MarkerZ | ||
if ~exist('typeIdx','var') || isempty(typeIdx);typeIdx = 1;end | ||
|
||
im_fn = S.Image_Properties.Image_Filename; | ||
if isfield(S.Marker_Data.Marker_Type,'Marker') | ||
MarkerXY = [ [S.Marker_Data.Marker_Type(typeIdx).Marker.MarkerX]',... | ||
[S.Marker_Data.Marker_Type(typeIdx).Marker.MarkerY]' ]; | ||
else | ||
MarkerXY = NaN(0,2); | ||
%% load XML | ||
|
||
S = readstruct(filename); | ||
% data structure | ||
% S -> ImageProperties | ||
% -> | ||
% -> | ||
% S.Marker_Data.Marker_Type: struct array of different marker types | ||
% S.Marker_Data.Marker_Type.Marker: 1xn struct array with fields: | ||
% MarkerX | ||
% MarkerY | ||
% MarkerZ | ||
|
||
im_fn = S.Image_Properties.Image_Filename; | ||
|
||
Markers = struct; | ||
nTypes = length(S.Marker_Data.Marker_Type); | ||
for typeIdx = 1:nTypes | ||
Markers(typeIdx).Type = S.Marker_Data.Marker_Type(typeIdx).Type; | ||
if isfield(S.Marker_Data.Marker_Type,'Name') | ||
Markers(typeIdx).Name = S.Marker_Data.Marker_Type(typeIdx).Name; | ||
else | ||
Markers(typeIdx).Name = ""; | ||
end | ||
Markers(typeIdx).MarkerXY = readCellType(S,typeIdx); | ||
end | ||
end | ||
|
||
function MarkerXY = readCellType(S,typeIdx) | ||
if ~exist('typeIdx','var') || isempty(typeIdx);typeIdx = 1;end | ||
if isfield(S.Marker_Data.Marker_Type,'Marker') && ... | ||
~all(ismissing(S.Marker_Data.Marker_Type(typeIdx).Marker)) | ||
MarkerXY = [ [S.Marker_Data.Marker_Type(typeIdx).Marker.MarkerX]',... | ||
[S.Marker_Data.Marker_Type(typeIdx).Marker.MarkerY]' ]; | ||
else | ||
MarkerXY = NaN(0,2); | ||
end | ||
end |