Skip to content

Commit 54cddc0

Browse files
committed
Fixed sprintf not Windows path compatible issue. Bug fixed, error occurred when click results button of Check3DCellSegmentationProcess for some dataset.
1 parent 1cf7bbc commit 54cddc0

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

MovieData/Check3DCellSegmentationProcess.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
%% WIP - fix volume size change issue?
8080
zp = floor((size(stack3D,3)-obj.owner_.zSize_)/2)+1;
8181
xyp = floor((size(stack3D,1)-obj.owner_.imSize_(1))/2);
82-
mask = stack3D(xyp:(size(stack3D,2)-xyp),xyp:(size(stack3D,2)-xyp),zp:(size(stack3D,3)-zp));
82+
mask = stack3D(xyp:(size(stack3D,1)-xyp),xyp:(size(stack3D,2)-xyp),zp:(size(stack3D,3)-zp));
8383

8484
mask = mask(:, :, p.iZ+1);
8585
% mask = stack3D(:,:,p.iZ-zp);

PatchMerge/patchMergeMeshMD.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ function patchMergeMeshMD(processOrMovieData, varargin)
114114
disp([' image ' num2str(t) ' (channel ' num2str(c) ')'])
115115

116116
% load the surface, curvature and patch segmentation data
117-
sStruct = load(sprintf(surfacePath, c, t));
118-
cStruct = load(sprintf(curvaturePath, c, t));
119-
cuStruct = load(sprintf(curvatureUnsmoothedPath, c, t));
120-
gStruct = load(sprintf(gaussPath, c, t));
121-
nStruct = load(sprintf(neighborsPath, c, t));
122-
csStruct = load(sprintf(surfaceSegPath, c, t));
123-
psStruct = load(sprintf(pairStatsPath, c, t));
117+
sStruct = load(sprintfPath(surfacePath, c, t));
118+
cStruct = load(sprintfPath(curvaturePath, c, t));
119+
cuStruct = load(sprintfPath(curvatureUnsmoothedPath, c, t));
120+
gStruct = load(sprintfPath(gaussPath, c, t));
121+
nStruct = load(sprintfPath(neighborsPath, c, t));
122+
csStruct = load(sprintfPath(surfaceSegPath, c, t));
123+
psStruct = load(sprintfPath(pairStatsPath, c, t));
124124

125125
% merge patches using an SVM
126126
surfaceSegmentPatchMerge = mergePatchesSVM(sStruct.surface, csStruct.surfaceSegment, psStruct.pairStats, svmStruct.inModelAll, svmStruct.SVMmodelAll, nStruct.neighbors, cStruct.meanCurvature, cuStruct.meanCurvatureUnsmoothed, gStruct.gaussCurvatureUnsmoothed, MD.pixelSize_);

patchDescribe/patchDescriptionForMergeMeshMD.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ function patchDescriptionForMergeMeshMD(processOrMovieData, varargin)
9898
disp([' image ' num2str(t) ' (channel ' num2str(c) ')'])
9999

100100
% load the surface, curvature and patch segmentation data
101-
sStruct = load(sprintf(surfacePath, c, t));
102-
cStruct = load(sprintf(curvaturePath, c, t));
103-
cuStruct = load(sprintf(curvatureUnsmoothedPath, c, t));
104-
gStruct = load(sprintf(gaussPath, c, t));
105-
nStruct = load(sprintf(neighborsPath, c, t));
106-
csStruct = load(sprintf(surfaceSegPath, c, t));
101+
sStruct = load(sprintfPath(surfacePath, c, t));
102+
cStruct = load(sprintfPath(curvaturePath, c, t));
103+
cuStruct = load(sprintfPath(curvatureUnsmoothedPath, c, t));
104+
gStruct = load(sprintfPath(gaussPath, c, t));
105+
nStruct = load(sprintfPath(neighborsPath, c, t));
106+
csStruct = load(sprintfPath(surfaceSegPath, c, t));
107107

108108
% calculate statistics for adjacent pairs of patches
109109
patchPairs = findAdjacentPatchPairs(csStruct.surfaceSegment, nStruct.neighbors);

utilities/sprintfPath.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function path=sprintfPath(XYProjTemplate,fIdx)
1+
function path=sprintfPath(XYProjTemplate,varargin)
22
% making sprintf windows-path-proof
33
% sprintf applied on the filename only
44
%
@@ -21,5 +21,5 @@
2121
%
2222
%
2323
[folder,file,ext]=fileparts(XYProjTemplate);
24-
filename=sprintf(file,fIdx);
24+
filename=sprintf(file,varargin{:});
2525
path=fullfile(folder,[filename ext]);

0 commit comments

Comments
 (0)