From 442a49fc0378ab591baba7ce822699a000b09824 Mon Sep 17 00:00:00 2001 From: Waddah Moghram Date: Thu, 7 Mar 2019 11:25:33 -0600 Subject: [PATCH 1/2] Update setROIfromForcemap.m Unable to open ROI is stage drift stage was not done. Error in opening reference frame --- software/setROIfromForcemap.m | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/software/setROIfromForcemap.m b/software/setROIfromForcemap.m index 6bb59a6..d4b3e22 100644 --- a/software/setROIfromForcemap.m +++ b/software/setROIfromForcemap.m @@ -34,12 +34,18 @@ displProc = tfmPackage.getProcess(2); end displField=displProc.loadChannelOutput; -% SDC proc -try - SDCProc = tfmPackage.getProcess(1); -catch +% % SDC proc--------------- +% % Lines below commented out and corrected by Waddah Moghram on 2/18/2019 +% try +% SDCProc = tfmPackage.getProcess(1); +% catch +% SDCProc = tfmPackage.getProcess(2); +% end +SDCProc = tfmPackage.getProcess(1); +if isempty(SDCProc) % No Stage Drift Step was Done SDCProc = tfmPackage.getProcess(2); end +%----------------------- % Get force map % try % tMap = load(forceProc.outFilePaths_{2}); @@ -63,7 +69,10 @@ % tMap = load(forceProc.outFilePaths_{2}); % tMap = tMap.tMap; % end -refFrame = double(imread(SDCProc.outFilePaths_{2,1})); +%---------------- Corrected by Waddah Moghram. Should be reference frame, not dispMaps.mat on 2/18/2019 +% refFrame = double(imread(SDCProc.outFilePaths_{2,1})); +refFrame = imread(SDCProc.funParams_.referenceFramePath); +%---------------------------------- % Use mask of first frame to filter bead detection firstMask = refFrame>0; %false(size(refFrame)); @@ -80,7 +89,10 @@ else roiMask=imread(MD.roiMaskPath_); boundROI=bwboundaries(roiMask); - hold on, plot(boundROI{1}(:,2),boundROI{1}(:,1),'w') + % ----- if-statement added by Waddah Moghram on 2/18/2019 + if ~isempty(boundROI) + hold on, plot(boundROI{1}(:,2),boundROI{1}(:,1),'w') + end % ------------------------- h=imrect; end ROI_rect = wait(h); From 99541fcc2f3cdbabd535ba8811fe8212090089bc Mon Sep 17 00:00:00 2001 From: Waddah Moghram Date: Thu, 7 Mar 2019 11:38:55 -0600 Subject: [PATCH 2/2] Update setROIfromForcemap.m Fixes the following Error: ===================== tfmPackage=MD.getPackage(MD.getPackageIndex('TFMPackage')); K>> displProc displProc = [] Dot indexing is not supported for variables of this type. Error in setROIfromForcemap (line 36) displField=displProc.loadChannelOutput; Error in forceFieldCalculationProcessGUI>setROIfromForcemap_Callback (line 359) setROIfromForcemap(MD); Error in gui_mainfcn (line 95) feval(varargin{:}); Error in forceFieldCalculationProcessGUI (line 62) gui_mainfcn(gui_State, varargin{:}); Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)forceFieldCalculationProcessGUI('setROIfromForcemap_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback. ===================================================== --- software/setROIfromForcemap.m | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/software/setROIfromForcemap.m b/software/setROIfromForcemap.m index d4b3e22..82dfc06 100644 --- a/software/setROIfromForcemap.m +++ b/software/setROIfromForcemap.m @@ -28,19 +28,15 @@ forceProc = tfmPackage.getProcess(4); p = forceProc.funParams_; % Load displ process -try - displProc = tfmPackage.getProcess(3); -catch +% ---------- Modified by Waddah Moghram on 3/7/2019 +displProc = tfmPackage.getProcess(3); +if isempty(displProc) % No correction to displacement step displProc = tfmPackage.getProcess(2); end displField=displProc.loadChannelOutput; +%------------------------------------ % % SDC proc--------------- -% % Lines below commented out and corrected by Waddah Moghram on 2/18/2019 -% try -% SDCProc = tfmPackage.getProcess(1); -% catch -% SDCProc = tfmPackage.getProcess(2); -% end +% ----------- Lines below commented out and corrected by Waddah Moghram on 3/7/2019 SDCProc = tfmPackage.getProcess(1); if isempty(SDCProc) % No Stage Drift Step was Done SDCProc = tfmPackage.getProcess(2); @@ -69,8 +65,7 @@ % tMap = load(forceProc.outFilePaths_{2}); % tMap = tMap.tMap; % end -%---------------- Corrected by Waddah Moghram. Should be reference frame, not dispMaps.mat on 2/18/2019 -% refFrame = double(imread(SDCProc.outFilePaths_{2,1})); +%---------------- Corrected by Waddah Moghram. Should be reference frame, not dispMaps.mat on 3/7/2019 refFrame = imread(SDCProc.funParams_.referenceFramePath); %---------------------------------- @@ -89,7 +84,7 @@ else roiMask=imread(MD.roiMaskPath_); boundROI=bwboundaries(roiMask); - % ----- if-statement added by Waddah Moghram on 2/18/2019 + % ----- if-statement added by Waddah Moghram on 3/7/2019 if ~isempty(boundROI) hold on, plot(boundROI{1}(:,2),boundROI{1}(:,1),'w') end % ------------------------- @@ -107,19 +102,3 @@ % maskArray = MD.getROIMask; close(h2) disp('ROI created!') - - - - - - - - - - - - - - - -